Outbound email from instance are repeatedly set out in a loop for every minute


Description

When an email is sent from instance to recipients, the mail is observed to be delivered repeatedly in a loop for every minute.


This happens for specific notifications when custom SMTP account is used, not with all emails, thereby do not cause performance issues to SMTP sender jobs.

Release or Environment

All versions

Instructions

When this issue is observed, we see below exception/error in the app node logs :


2021-06-15 23:39:03 (047) worker.0 worker.0 txid=5cfaa8d91bf8 *** Start Background transaction - system, user: system
2021-06-15 23:39:03 (051) worker.0 worker.0 txid=5cfaa8d91bf8 Starting: SMTP Sender.d8e56792c0a80064007e86b882a6acc7, Trigger Type: Interval, Priority: 25, Upgrade Safe: true, Repeat: 1 Minute
2021-06-15 23:39:03 (051) worker.0 worker.0 txid=5cfaa8d91bf8 Name: SMTP Sender
2021-06-15 23:39:03 (407) worker.0 worker.0 txid=5cfaa8d91bf8 Claiming chunk took: 8ms
2021-06-15 23:39:03 (414) worker.0 worker.0 txid=5cfaa8d91bf8 Adding address: [xxxx@xxxx.xxx] name: [] type: to
2021-06-15 23:39:03 (414) worker.0 worker.0 txid=5cfaa8d91bf8 Adding address: [xxxx@xxxx.xxx] name: [] type: to
2021-06-15 23:39:03 (583) worker.0 worker.0 txid=5cfaa8d91bf8 Adding address: [xxxx@xxxx.xxx] name: [] type: to
2021-06-15 23:39:03 (717) worker.0 worker.0 txid=5cfaa8d91bf8 Adding address: [xxxx@xxxx.xxx] name: [] type: to
2021-06-15 23:40:04 (880) worker.0 worker.0 txid=5cfaa8d91bf8 WARNING *** WARNING *** handling smtp exception: javax.mail.MessagingException: Exception reading response;
2021-06-15 23:40:04 (888) worker.0 worker.0 txid=5cfaa8d91bf8 WARNING *** WARNING *** EMAIL.73ea28151b78fc904c2920202d4bcba0: send-retry
2021-06-15 23:40:05 (021) worker.0 worker.0 txid=5cfaa8d91bf8 Connected to: xxxxxxxxxxxx, as: xxxxx@xxxxxxxxxxx
2021-06-15 23:40:06 (330) worker.0 worker.0 txid=5cfaa8d91bf8 Sending took: 62922ms
2021-06-15 23:40:06 (330) worker.0 worker.0 txid=5cfaa8d91bf8 Releasing chunk took: 0ms
2021-06-15 23:40:06 (419) worker.0 worker.0 txid=5cfaa8d91bf8 Claiming chunk took: 4ms

The detailed exception would be below :

2021-06-15 23:40:04 (880) worker.0 worker.0 txid=5cfaa8d91bf8 WARNING *** WARNING *** handling smtp exception: javax.mail.MessagingException: Exception reading response;
nested exception is:
java.net.SocketTimeoutException: Read timed out : Exception reading response
2021-06-15 23:40:04 (888) worker.0 worker.0 txid=5cfaa8d91bf8 WARNING *** WARNING *** EMAIL.73ea28151b78fc904c2920202d4bcba0: send-retry
2021-06-15 23:40:05 (021) worker.0 worker.0 txid=5cfaa8d91bf8 Connected to: xxxxxxxxxxxx, as: xxxxx@xxxxxxxxxxx


This indicates that there is an issue with the custom SMTP server in identifying the email recipient as a valid user. 

The SMTP server did not respond to servicenow for the request to validate. Hence, the email is marked as send-retry.


Customer should reach out to the SMTP admin to identify the reason behind this behavior.