Support Article

Emails not getting picked up from the emailbox by email listener

SA-33186

Summary



Email listener does not process or read new emails despite being verified as running. Listener runs every 30 seconds, but emails waiting in queue are not attempted.


Error Messages



Turning Debug on EmailListener class shows 0 new messages are found.
PegaRULES log-

23:59:46,391 EmailListener DEBUG - Service Package: EmailDefault
23:59:46,391 EmailListener DEBUG - Service Class: your_class
23:59:46,391 EmailListener DEBUG - Folder: INBOX
23:59:46,392 EmailListener DEBUG - Latency: 30
23:59:46,392 EmailListener DEBUG - Max. # of messages: 999
23:59:46,392 EmailListener DEBUG - Max. processing time (seconds): 0
23:59:46,392 EmailListener DEBUG - Host: your_host, mPort: your_port, mProtocol: imap
23:59:46,404 EmailListener DEBUG - Establishing new requestor.A9BEF9A0ECA9A28493A2F9A948E29B502
23:59:46,410 EmailListener DEBUG - attempt to lock Notify-ABCEmail.INBOX : true
23:59:46,425 EmailListener DEBUG - emailConnect
23:59:46,784 EmailListener DEBUG - emailReceive
23:59:46,788 EmailListener DEBUG - received : 0 new messages
23:59:46,788 EmailListener DEBUG - Received 0 emails.
23:59:46,788 EmailListener DEBUG - Processing email
23:59:46,788 EmailListener DEBUG - Processed[0/0] messages
23:59:46,788 EmailListener DEBUG - emailDisconnect
23:59:46,803 EmailListener DEBUG - Unlocked 1 locks.
23:59:46,803 EmailListener DEBUG - Will sleep for 30 seconds
23:59:46,803 EmailListener DEBUG - Cleanup lock requestor.
23:59:46,803 EmailListener DEBUG - delete requestor A9BEF9A0ECA9A28493A2F9A948E29B502
23:59:46,804 EmailListener DEBUG - Cleanup work requestor.
23:59:46,804 EmailListener DEBUG - Requestor id is null, no cleanup required.



Steps to Reproduce

  1. Send email from desgnated email box
  2. Email listener runs every 30 sec
  3. Case is not created in Pega


Root Cause



A defect or configuration issue in the operating environment

Pega runs the following javamail code to find UNSEEN messages:

Message[] foundMessages = folderInbox.search(new FlagTerm(new Flags(Flags.Flag.SEEN), false));

A standalone Email java client on the problematic exchange server confirmed the behavior is the same outside of Pega EmailListener. This javamail client works fine in the lower DEV environment where emails are read correctly. Execution of javamail client with mail session debug for failing scenario shows:

A3 OK [READ-ONLY] EXAMINE completed.
A4 SEARCH UNSEEN ALL
* SEARCH
A4 OK SEARCH completed.
Message Count :0
A5 CLOSE
A5 OK CLOSE completed.

for a working environment this javamail debug shows:

A4 SEARCH UNSEEN ALL
* SEARCH 1098
A4 OK SEARCH completed.
Message Count :1
A5 FETCH 1098 (ENVELOPE INTERNALDATE RFC822.SIZE)
* 1098 FETCH (ENVELOPE (your_email) INTERNALDATE "30-Jan-2017 11:51:16 -0500" RFC822.SIZE 10895)
A5 OK FETCH completed.
Found message #0: your_email_subject
A6 CLOSE
A6 OK CLOSE completed.



Resolution



Make the following change to the operating environment: Compare the exchange server settings from the working and the failing environments and make sure they are the same. Contact the exchange server vendor if needed to determine what is needed to make this work.

Published February 1, 2017 - Updated February 4, 2017

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.