Ask the Expert - Email Integration with Prasad Akella

Join Prasad ( @nvkap ) in this Ask the Expert session (2nd - 11th September) on Email Integration.

About Prasad: Prasad Akella is the Senior Product Manager with focus on adding product capabilities that make integrations easy. Prasad Akella has over 18 years of experience working on providing java/j2ee solutions to complex integrations with the last few years focused on Pega platform. His work drives toward ensuring that customers working with the Pega platform can easily achieve integrations without compromising on the industry standard best practices.

Message from Prasad: I am very passionate about enabling developers of the Pega platform, integrate applications easily and securely using the state-of-the-art industry standard technologies and best practices. I can answer questions about integration capabilities in Pega and more broadly about data and integration practices in general. I look forward to all your integration specific questions.

Ask the Expert Rules

  • Follow the Pega Support Community's Community Rules of Engagement
  • This is not a Live Chat - Prasad will reply to your questions over the course of the week (2-11 September)
  • Questions should be clearly and succinctly expressed
  • Questions should be of interest to many others in the audience
  • Have fun!

Group Tags


Keep up to date on this post and subscribe to comments

August 27, 2019 - 6:08am

Hello Prasad,

Would you able to give some light on how we can handle the Spamming of Mail Boxes which are listened to by Pega Email Listeners. Below are some of the scenario we would like to address,

some rare instance Customer keep on spamming mailbox every 10 minutes asking same clarification or no clarification, just wanted to spam.

Other cases, they could possibly write an automation code or some BOT to send an email every minute from same email id or different IDs

How these kinds of exceptional situations are handled by the listener when there is no such restrictions or filters from Mailbox servers?


Thank you



August 28, 2019 - 1:57pm
Response to Mathan

Hello Mathan,

Nowadays most email servers provide sophisticated spam filtering infrastructure and the email sever takes care of getting rid of these spam emails in most cases. A lot of the popular providers also rely on machine learning techniques and keep their spam filtering algorithms upto date so that the spam email detection is very accurate. In my opinion this is one of the common approaches to handle spam emails. 

The ones email servers can't detect are the ones that are more believable direct spam emails like the ones you mentioned. In this case I would think that you need to write custom solution to detect very targeted direct spam emails. You could also look at using text analytics and NLP techniques to get smart at detecting these direct spam emails and accordingly process them. I hope this helps.


August 27, 2019 - 12:40pm

Hi Prasad,

My question is regarding auto creating of cases using Channel and Interfaces for Email channel.

I have used Channel and Interfaces landing page to create an email channel, I define the different case types for my requirement and do the configuration in Behavior tab.

When an email comes to the email account, it creates the email triage cases and does the text categorization, entity extraction and every thing that it needs to do, but it sits in the assignment Work-Channel-Email-Triage class.

How do I auto create cases for my requirement ??

August 28, 2019 - 9:48am
Response to Jagdish Makana

Hi Jagdish,

In the "Intelligent routing" section in "Behavior" tab there is an option to create a case automatically based on conditions you could define. You could also use NLP or message headers to create conditions and case gets created automatically when the condition is evaluated to true.


August 28, 2019 - 1:58pm
Response to nvkap


Thanks, I was able to make changes and it worked for me.


August 28, 2019 - 6:48am

Hi, I am facing an issue related to Email Listener. Created Email Account providing gmail id and password. Test Connectivity is successful. But whenever the mail comes to my gmail INBOX, Email listener is not getting triggered.and also some junk mails are coming to my gmail INBOX. 

my question is : how to run my logic once a mail comes to my INBOX (to trigger Email Listener)?

why i was getting such junk mails?

August 28, 2019 - 10:51am
Response to RavikumarVelagala

Hi Ravikumar,

Use email service rules to manage incoming email. If you configure the email listener correctly then it monitors an email inbox on a server identified by an email server configured in the email account. When messages arrive in that inbox, the email listener routes them to an email service rule. So you need to create a email service rule and typically the service activity configured in that email service uses the information in the message to perform your logic such as create a work item. You can create a Service Email rule by selecting "Service Email" from the "Integration-Services" category in records explorer in Dev Studio.

Regarding junk mails, could you check from which email account are you getting those and what is the content of those email look like?


August 28, 2019 - 2:11pm

September 1, 2019 - 2:24pm

September 9, 2019 - 10:15am

I am facing some issues when use email functions in our system. Could you give some advice about the following scenarios

When sending the mail with big size attachment (10M)it take about 1mins to send the email. Do we have any solutions to resolve this issue.

Email listener read the email with big size attachment (10M) consume about 3 mins. Do we have any suggestions about this?

Sometimes take more than 10mins

September 4, 2019 - 2:05pm
Response to Shipeng_Tian

Hello Shipeng Tian,

Usually size of the attachments has some impact on the overall processing time. Moreover there are also other parameters such as network latency, email connectivity with the email server could cause performance degradation. Could you please share more details around where exactly most of the time is being spent? Is the time spent while establishing the connection with email server, reading the attachments from the server, the service activity execution etc. These details would help us understand where the bottleneck is. I hope this helps.


September 9, 2019 - 10:21am
Response to nvkap

Could you let me know how to get the time spent while establishing the connection with email server and the time spent on reading the attachments for the server?

September 11, 2019 - 10:09am
Response to Shipeng_Tian

Hello Shipeng Tian,

Did you try enabling debug on Email Listener (com.pega.pegarules.integration.engine.internal.services.email.EmailListener)? I would suggest you try that and see as this would write useful of information to logs that would help debugging the issue. Moreover you could also use "Test Connectivity" in the email account to test the connectivity and any issues connecting to the email server. It usually comes back pretty fast unless there are any network latency issues or any other connectivity issues.


September 4, 2019 - 3:45am

Hello Prasad,

I configured Email listener and it is working fine.Properties are mapping perfectly with the data in the email. But i want to create a case based on the attachment data. How to configure this?

Please guide me 

Thanks in advance


September 4, 2019 - 1:22pm
Response to Vinoth

Hi Vinoth,

Thanks for asking this question.

The messages for email services are routed by email listeners. When an email listener routes a message that has files attached to it, the listener creates a page named pyAttachmentPage (of class Data-ServiceMessage) and puts the file(s) on that page, using the properties pyAttachNames and pyAttachValues.

If you want an email service to save the attached files from incoming email messages as work object attachments or use the contents of the attachments to create a work-object then configure the service activity to extract the files from the pyAttachmentPage and create the work object accordingly.

I hope this helps. Please let me know if you have any further questions.



September 4, 2019 - 6:01am

How to connect to 0365 based email accounts? Can I still use standard email accounts or customized SendEmail activities for my need?

September 4, 2019 - 12:46pm
Response to Jay_KS

Hello Jayakumar,


Thanks for asking this question.


Today we support SMTP for sending and IMAP/POP3 for receiving emails. If you are using any of these protocols to connect to Office 365 email accounts

then this is no different than using another other email accounts. You need to configure the email account accordingly and use the same for sending or

receiving emails. 

As part of Pega Platform™ 8.3 we also introduced purpose-built universal automations (APIs) for composing and sending emails. If you are using Pega Platform 8.3 then I would recommend using these send email automations. 


If you are referring to latest web based methods for connecting to Office 365 accounts, we are currently working on adding native Office 365 integration to

access Office 365 accounts using Microsoft Graph and you will be able use this feature once it is made available in the upcoming releases.


I hope this helps, Please let me know if you have any other questions.



September 5, 2019 - 10:20am

Which protocol (IMAP or POP3) do you recommend for enterprise applications to process incoming emails using Pega email listeners?

What criteria would you suggest determining which protocol to follow for large applications considering reliability, security, storage, etc. ?

Is it advisable to use IMAP or POP3 when there are large attachments in inbound emails?


September 6, 2019 - 2:24pm
Response to BalajiS6010

Hello Balaji,

Generally speaking IMAP is usually preferred over POP3 as IMAP is more modern and is the most widely supported protocol in the industry. POP3 was primarily designed keeping the single device access model in mind which might not be a fit for today's modern world where most consumers have atleast 2 devices (smart phone and computer) IMAP also comes with its own advantages such as portability, accessibility and performance.

In Pega, E-mail listeners process only those messages that have not yet been retrieved, or read. If an email listener cannot process an email message because there is something wrong with it (the message is invalid in some way) the listener marks the message as "seen." 
The POP3 protocol does not support the "seen" attribute. For this reason, it is preferable to configure email servers to use the IMAP protocol over POP3, which supports the "seen" attribute, when possible.

Moreover most organizations are forbidding the use of IMAP/POP3 protocols as they are deemed not secure enough. Also Web email providers are on the rise, and organizations are slowly moving over to Web based email provider implementations such as Microsfot Graph, Outlook REST API etc.
we are currently working on adding native Office 365 integration to access Office 365 accounts using Microsoft Graph

Using IMAP/POP3 for processing emails with large attachments is not an issue though there will be some performance costs associated with processing emails with large attachments, but if you have large sizes, you want to set the fetch size so that processing is more efficient. See this article.


I hope this helps.


September 6, 2019 - 5:54am

Hi Prasad,

In order to be able to use SMTP host dynamically on different environments I am using a data page reference in SMTP host field on the Email Account tab of the Email Account rule but is somehow does not work. The test connectivity fails with message Failed Disconnecting from email server. Can you please review the attached screenshots and let me know what I am doing wrong?

Thank you.

Best regards,


September 6, 2019 - 9:06am
Response to OnkarY33

Hi Omkar,

Thanks for raising this. 

It looks like the data page reference for the SMTPHost is resolved correctly as the value corresponding to Email_Server is printed correctly. But the debugging information indicates that the data page reference is not resolved. This seems like a bug. Which version of Pega are you using? is this the first time you are trying this or did it ever worked before for you?


September 6, 2019 - 1:54pm

September 11, 2019 - 10:59am

Thank you everybody for the great discussions!

A big thank you to our expert, Prasad for agreeing to extend this session for a few more days to take on additional questions!

Please continue asking your questions on email integration by creating new posts on our community.

Lochana | Community Moderator | Pegasystems Inc.