Mautic Community Forums

AWS SES WebHook Bounce not all being detected

Your software
My Mautic version is: 3.1
My PHP version is: 7.2.32
Bitnamic Mautic free install with over 1,000 new contacts with over 10k emails sent.

Your problem
My problem is:
Some AWS SES WebHook Bounce not all being detected. Most bounces are detected but 5 types below and perhaps more are not being detect. I get SES to get me a email bounce too so that’s.

I did not set Full Header on AWS SES notification.

These types are bounces not recognized by Webhook seen to be mainly some Invalid domains or their MTA is blocking AWS SES. Right now icloud is block some AWS SES IPs.

Perhaps I can use the IMAP bounce detection along with the webhook? Right now I’m using Zoho free plan which doesn’t include IMAP unless I pay per month.

An error occurred while trying to deliver the mail to the following recipients:
XX@udxudh.comReporting-MTA: dsn; a8-237.smtp-out.amazonses.com

Action: failed
Final-Recipient: rfc822; XX@udxudh.com
Diagnostic-Code: smtp; 554 4.4.7 Message expired: unable to deliver in 840 minutes.<421 4.4.0 Unable to lookup DNS for udxudh.com>
Status: 4.4.7

An error occurred while trying to deliver the mail to the following recipients:
XX@yaboo.comReporting-MTA: dsn; a8-60.smtp-out.amazonses.com

Action: failed
Final-Recipient: rfc822; XX@yaboo.com
Diagnostic-Code: smtp; 554 4.4.7 Message expired: unable to deliver in 840 minutes.<421 4.4.0 Unable to lookup DNS for >
Status: 4.4.7

An error occurred while trying to deliver the mail to the following recipients:
XX@gmail.comReporting-MTA: dsn; a8-13.smtp-out.amazonses.com

Action: failed
Final-Recipient: rfc822; XX@gmail.com
Diagnostic-Code: smtp; 554 4.4.7 Message expired: unable to deliver in 840 minutes.<452-4.2.2 The email account that you tried to reach is over quota. Please direct452-4.2.2 the recipient to452 4.2.2 https://support.google.com/mail/?p=OverQuotaTemp m20si2575374qtw.57 - gsmtp>
Status: 4.4.7

An error occurred while trying to deliver the mail to the following recipients:
XX@gmail.commReporting-MTA: dsn; a8-26.smtp-out.amazonses.com

Action: failed
Final-Recipient: rfc822; XX@gmail.comm
Diagnostic-Code: smtp; 550 5.4.4 Invalid domain
Status: 5.4.4

An error occurred while trying to deliver the mail to the following recipients:
XXa@yahoo.coReporting-MTA: dsn; a8-176.smtp-out.amazonses.com

Action: failed
Final-Recipient: rfc822; XX@yahoo.co
Diagnostic-Code: smtp; 550 4.4.7 Message expired: unable to deliver in 840 minutes.<421 4.4.2 Connection timed out>
Status: 4.4.7

An error occurred while trying to deliver the mail to the following recipients:
XX@icloud.comReporting-MTA: dsn; a8-52.smtp-out.amazonses.com

Action: failed
Final-Recipient: rfc822; XXl@icloud.com
Diagnostic-Code: smtp; 554 5.7.1 Remote MTA not accepting connections
Status: 5.7.1

These errors are showing in the log:
I could not exactly match up the non registered bounces to an exact SES error as logging seems limited. Perhaps the Paypal not recognized is it?

[2020-09-07 03:15:05] mautic.WARNING: Received SES webhook of type ‘Notification’ but couldn’t understand payload
[2020-09-07 03:50:45] mautic.WARNING: PHP Warning - Invalid argument supplied for foreach() - in file /opt/mautic-3.0.2-0/apps/mautic/htdocs/app/bundles/PageBundle/Model/PageModel.php - at line 1169 {“query”:“XDEBUG_SESSION_START=phpstorm”}
[2020-09-07 04:09:20] mautic.WARNING: PHP Warning - Invalid argument supplied for foreach() - in file /opt/mautic-3.0.2-0/apps/mautic/htdocs/app/bundles/PageBundle/Model/PageModel.php - at line 1169 {“query”:“a=fetch&content=%3Cphp%3Edie%28%40md5%28HelloThinkCMF%29%29%3C%2Fphp%3E”}
[2020-09-07 04:16:55] mautic.WARNING: PHP Warning - Invalid argument supplied for foreach() - in file /opt/mautic-3.0.2-0/apps/mautic/htdocs/app/bundles/PageBundle/Model/PageModel.php - at line 1169 {“query”:“function=call_user_func_array&s=%2FIndex%2F%5Cthink%5Capp%2Finvokefunction&vars%5B0%5D=md5&vars%5B1%5D%5B%5D=HelloThinkPHP”}
[2020-09-07 14:30:47] mautic.WARNING: Received SES webhook of type ‘Notification’ but couldn’t understand payload
[2020-09-07 19:13:48] mautic.WARNING: PHP Warning - Invalid argument supplied for foreach() - in file /opt/mautic-3.0.2-0/apps/mautic/htdocs/app/bundles/PageBundle/Model/PageModel.php - at line 1169 {“query”:“XDEBUG_SESSION_START=phpstorm”}
[2020-09-07 19:37:28] mautic.WARNING: PHP Warning - Invalid argument supplied for foreach() - in file /opt/mautic-3.0.2-0/apps/mautic/htdocs/app/bundles/PageBundle/Model/PageModel.php - at line 1169 {“query”:“a=fetch&content=%3Cphp%3Edie%28%40md5%28HelloThinkCMF%29%29%3C%2Fphp%3E”}
[2020-09-07 19:46:06] mautic.WARNING: PHP Warning - Invalid argument supplied for foreach() - in file /opt/mautic-3.0.2-0/apps/mautic/htdocs/app/bundles/PageBundle/Model/PageModel.php - at line 1169 {“query”:“function=call_user_func_array&s=%2FIndex%2F%5Cthink%5Capp%2Finvokefunction&vars%5B0%5D=md5&vars%5B1%5D%5B%5D=HelloThinkPHP”}
[2020-09-07 14:51:20] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\DriverException: "An exception occurred while executing ‘UPDATE ma_lead_frequencyrules SET date_added = ?, frequency_number = ?, pause_from_date = ?, pause_to_date = ? WHERE id = ?’ with params [“2020-09-07 19:51:20”, 7032259306, “1995-06-24 05:00:00”, “1995-05-24 05:00:00”, 78]: SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column ‘frequency_number’ …

Steps I have tried to fix the problem:
Had Mautic 3.0.2 the upgraded to 3.1 problem still exist.

So since AWS SES Webhook isn’t marking the emails contacts as bounce, I decided to enable the IMAP detection. Once I schedule cron mautic:email:fetch it worked for the imap event below which is like item #1 and #2 listed above. So I will monitor the imap to see if it works for the items 3-5 when I get more bounces.

For aws SES it does report it can’t unable the JSON payload. I’m trying to get AWS SNS to log the event so I can post the json event here as the type might have changed.

Reporting-MTA: dsn; a8-237.smtp-out.amazonses.com Action: failed Final-Recipient: rfc822; xx@uahoo.com Diagnostic-Code: smtp; 554 4.4.7 Message expired: unable to deliver in 840 minutes.<421 4.4.0 Unable to lookup DNS for localhost> Status: 4.4.7