Mautic Community Forums

SES Bounces not working

I have SES and SNS configured. Bounce cron job is running and mailbox is setup.



If I send and email from Mautic to the SES test email account (bounce@simulator.amazonses.com) the bounce notification hits my mailbox and the cron job processes the bounce and marks the lead with the “Email bounced” tag.



If I send an email from Mautic to a non-existing email account the bounce notification from SNS hits my mailbox and the cron job processes the bounce email but the lead does not get marked with the “Email bounced” tag.



There are no error messages in the log.



I do see a small difference in the bounce notifications sent from SNS (see below).

Is Mautic not parsing the email correctly or am I doing something wrong?



SNS Bounce email that works:

Code:
{"notificationType":"Bounce","bounce":{"bounceSubType":"General","bounceType":"Permanent","reportingMTA":"dsn; a8-90.smtp-out.amazonses.com","bouncedRecipients":[{"emailAddress":"bounce@simulator.amazonses.com","status":"5.1.1","diagnosticCode":"smtp; 550 5.1.1 user unknown","action":"failed"}],"timestamp":"2016-04-11T17:57:10.056Z","feedbackId":"01000154067854c0-7ef80379-7467-42a0-8ecb-f9c21fdce54b-000000"},"mail":{"timestamp":"2016-04-11T17:57:09.000Z","source":"XXX@mautic.XXX.com","sendingAccountId":"392188122432","messageId":"01000154067851d9-e60318ad-008a-43f3-93ac-5e6973c20639-000000","destination":["bounce@simulator.amazonses.com"],"sourceArn":"arn:aws:ses:us-east-1:392188122432:identity/XXX@mautic.XXX.com"}}


If you wish to stop receiving notifications from this topic, please click or visit the link below to unsubscribe:
https://sns.us-east-1.amazonaws.com/unsubscribe.html?SubscriptionArn=arn:aws:sns:us-east-1:392188122432:m_bounces:36104cdf-aa1b-45de-8f5f-bd522df22eae&Endpoint=XXX@mautic.XXX.com

Please do not reply directly to this email. If you have any questions or comments regarding this email, please contact us at https://aws.amazon.com/support


SNS Bounce email that does not work:
Code:
{"notificationType":"Bounce","bounce":{"bounceSubType":"General","bounceType":"Permanent","reportingMTA":"dsn; a8-241.smtp-out.amazonses.com","bouncedRecipients":[{"action":"failed","emailAddress":"jimmyd0u812@gmail.com","status":"5.1.1","diagnosticCode":"smtp; 550-5.1.1 The email account that you tried to reach does not exist. Please tryn550-5.1.1 double-checking the recipient's email address for typos orn550-5.1.1 unnecessary spaces. Learn more atn550 5.1.1 https://support.google.com/mail/answer/6596 q141si21180496qha.77 - gsmtp"}],"timestamp":"2016-04-11T18:15:03.031Z","feedbackId":"010001540688b3f2-36ab9783-3941-431c-ad4b-9916390db8f9-000000"},"mail":{"timestamp":"2016-04-11T18:15:02.000Z","sourceArn":"arn:aws:ses:us-east-1:392188122432:identity/XXX@mautic.XXX.com","source":"XXX+bounce_570be98377160@mautic.XXX.com","messageId":"010001540688b0ee-4a49750b-2838-4b5d-9de4-7ef3082c58a8-000000","destination":["jimmyd0u812@gmail.com"],"sendingAccountId":"392188122432"}}


If you wish to stop receiving notifications from this topic, please click or visit the link below to unsubscribe:
https://sns.us-east-1.amazonaws.com/unsubscribe.html?SubscriptionArn=arn:aws:sns:us-east-1:392188122432:m_bounces:36104cdf-aa1b-45de-8f5f-bd522df22eae&Endpoint=XXX@mautic.XXX.com

Please do not reply directly to this email. If you have any questions or comments regarding this email, please contact us at https://aws.amazon.com/support

I have SES and SNS configured. Bounce cron job is running and mailbox is setup.

If I send and email from Mautic to the SES test email account (bounce@simulator.amazonses.com) the bounce notification hits my mailbox and the cron job processes the bounce and marks the lead with the “Email bounced” tag.

If I send an email from Mautic to a non-existing email account the bounce notification from SNS hits my mailbox and the cron job processes the bounce email but the lead does not get marked with the “Email bounced” tag.

There are no error messages in the log.

I do see a small difference in the bounce notifications sent from SNS (see below).
Is Mautic not parsing the email correctly or am I doing something wrong?

SNS Bounce email that works:

{"notificationType":"Bounce","bounce":{"bounceSubType":"General","bounceType":"Permanent","reportingMTA":"dsn; a8-90.smtp-out.amazonses.com","bouncedRecipients":[{"emailAddress":"bounce@simulator.amazonses.com","status":"5.1.1","diagnosticCode":"smtp; 550 5.1.1 user unknown","action":"failed"}],"timestamp":"2016-04-11T17:57:10.056Z","feedbackId":"01000154067854c0-7ef80379-7467-42a0-8ecb-f9c21fdce54b-000000"},"mail":{"timestamp":"2016-04-11T17:57:09.000Z","source":"XXX@mautic.XXX.com","sendingAccountId":"392188122432","messageId":"01000154067851d9-e60318ad-008a-43f3-93ac-5e6973c20639-000000","destination":["bounce@simulator.amazonses.com"],"sourceArn":"arn:aws:ses:us-east-1:392188122432:identity/XXX@mautic.XXX.com"}}

--
If you wish to stop receiving notifications from this topic, please click or visit the link below to unsubscribe:
https://sns.us-east-1.amazonaws.com/unsubscribe.html?SubscriptionArn=arn:aws:sns:us-east-1:392188122432:m_bounces:36104cdf-aa1b-45de-8f5f-bd522df22eae&Endpoint=XXX@mautic.XXX.com

Please do not reply directly to this email. If you have any questions or comments regarding this email, please contact us at https://aws.amazon.com/support

SNS Bounce email that does not work:

{"notificationType":"Bounce","bounce":{"bounceSubType":"General","bounceType":"Permanent","reportingMTA":"dsn; a8-241.smtp-out.amazonses.com","bouncedRecipients":[{"action":"failed","emailAddress":"jimmyd0u812@gmail.com","status":"5.1.1","diagnosticCode":"smtp; 550-5.1.1 The email account that you tried to reach does not exist. Please tryn550-5.1.1 double-checking the recipient's email address for typos orn550-5.1.1 unnecessary spaces. Learn more atn550 5.1.1  https://support.google.com/mail/answer/6596 q141si21180496qha.77 - gsmtp"}],"timestamp":"2016-04-11T18:15:03.031Z","feedbackId":"010001540688b3f2-36ab9783-3941-431c-ad4b-9916390db8f9-000000"},"mail":{"timestamp":"2016-04-11T18:15:02.000Z","sourceArn":"arn:aws:ses:us-east-1:392188122432:identity/XXX@mautic.XXX.com","source":"XXX+bounce_570be98377160@mautic.XXX.com","messageId":"010001540688b0ee-4a49750b-2838-4b5d-9de4-7ef3082c58a8-000000","destination":["jimmyd0u812@gmail.com"],"sendingAccountId":"392188122432"}}

--
If you wish to stop receiving notifications from this topic, please click or visit the link below to unsubscribe:
https://sns.us-east-1.amazonaws.com/unsubscribe.html?SubscriptionArn=arn:aws:sns:us-east-1:392188122432:m_bounces:36104cdf-aa1b-45de-8f5f-bd522df22eae&Endpoint=XXX@mautic.XXX.com

Please do not reply directly to this email. If you have any questions or comments regarding this email, please contact us at https://aws.amazon.com/support

I will fix it myself if someone could tell me what piece of code is being used for SES bounce emails. So far I love Mautic and don’t want to give up now.

Hi Michael,

I have the exact same issue. So far I have not had any responses to my enquiries either.

Ill keep an eye on my thread and if i get a response - essentially the exact same question - then ill let you know.

PS: I posted my query on March 25th…

Thanks. I fear a response will never come.
I have started looking into implementing the AWS SES SDK. But trying to figure out where to do it in the code is a pain. I know there have been others who have said the same but nobody has done it as far as I know.

I have fixed this in my environment. This fix is for Amazon SES only. Instructions follow…

  1. Disable the Mautic cronjob for handling bounces (no longer needed).
  2. I have created 2 php scripts. One for bounces and one for complaints. I put them in DOCUMENT_ROOT.
  3. If you followed the instructions to create 2 Amazon SNS subscriptions with the Protocol = Email, delete them.
  4. Create a new Amazon SNS subscription for your bounces topic with the Protocol = HTTP or HTTPS and set the end point = to the URL of the bounces script.
  5. Create a new Amazon SNS subscription for your complaints topic with the Protocol = HTTP or HTTPS and set the end point = to the URL of the complaints script.

That’s it. Done and working perfectly. I will provide the 2 scripts for anyone who wants them. Not sure if I should post them here or not. Or where to put them for others.

Thank you michaelbdana,
I did exactly as you describe.
But, the arn http subscription is as “PendingConfirmation”.
Exists some code to confirm? Whats the way?

How can I share them? I cannot attach any files to this post.

You can find a zip file here: https://www.dropbox.com/s/ehalrvkhmowm2rn/Archive.zip?dl=0

Unzip the file and put the certs directory and the 2 scripts in your
document root.

Then set up your Amazon sns subscriptions:

point your complaints topic to https://your.domain/complaints.php
point your bounces topic to https://yourdomain/bounces.php