Bounce / Complaint via Amazon API not working, what I may have missed?

Your software
My PHP version is : 7.4
My MySQL/MariaDB version is (delete as applicable): MySQL8

Updating/Installing Errors
I am (delete as applicable): setting up bounce / complaint pipeline via Amazon API
Upgrading/installing via (delete as applicable) : Web

These errors are showing in the installer : Mautic installed fine and test (send email) fine but the bounce is not being registered to contact’s email. I added Amazon test bounce email in contact and send test email

These errors are showing in the Mautic log : Only thing that being logged is one same statement repeating - [2021-10-29 14:34:04] mautic.WARNING: Received SES webhook of type ‘’ but couldn’t understand payload

Your problem
My problem is : Bounce is not registered to contact email that bounces (using Amazon bounce test email and I have another mailer system software “Sendy” which works fine every time. I am trying to switch from Sendy over to Mautic.)

Steps I have tried to fix the problem : Reviewed all log and only find one same repeating statement. I am using Amazon API but I have tried both with and without the “_api” https://.org/mailer/amazon_api/callback and https://.org/mailer/amazon/callback.

I already had Amazon SES for almost a year using Sendy API to manage the bounce and complaint and I wanted to set up Mautic to try out the GrapeJS editor and have SMS support both.

Mautic 4.0.1 installed where it send test email out with no issues at all.

Mautic email setting set to Amazon SES - API (Test Success!)

Monitored email inbox settings all blank (I assume it will be monitored via API hook correct?)

On Amazon SES - I already had Topic set up for my exiting mailer “Sendy” so I created a new subscription with this callback https://**********.org/mailer/amazon_api/callback and append it to the Sendy topic which now have two subscriptions under it one for Sendy and one for Mautic.

Set up a segment with filter Bounced - Email equal to Yes

Add Amazon bounce email test to contact

Sent out test bounce email -
Sendy detected it immediately and marked Amazon Bounce email address as Bounced taking it off the subscription list

Mautic does not mark Amazon Bounce email contact or gave it any indication that it detected as bounce email from Amazon API.

Do the monitored inbox need to be set up or that is handle via API?

What steps I may have missed?

How do we know via contact that this contact email is marked as bounced?

I am sure I must have missed something.

I have Googled and I did lot of searches on this but I could not find anything related to “API”. Most all results are guides on using “SMTP” and monitored inbox setup.

I got it sorted I think …

The contact now show a red box and “Do not Contact” label on it so it working however the Email - Bounce segment filter I set up is not adding this contact to the filter list.

I do have segment update in the cron job and I know it’s being executed every 5 minutes

Something I may have missed?

Hi,
Do not contact emails can be in segments as well, so you can target them with on-site communication.
But they won’t receive emails, even if you send them.
Joey

Hi!

I face the same problem. No DNC badge if the email should be bounced and marked DNC. Process of sending emails from Mautic works as it should.

I have to mention that I tried with “Raw message delivery” Disable and Enable as well as with “Include original headers” On and Off. None of this worked out.
I also send an email to bounce@simulator.amazonses.com and - surprisingly - Mautic marked this email address almost instantly as DNC. Nevertheless, other bounce email addresses were not marked as DNC. What can be wrong?

My endpoint in SNS is https://phpstack-555677-2695774.cloudwaysapps.com/mailer/amazon/callback and when I run it via browser I get this error in the Mautic log:

mautic.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\HttpException: “AmazonCallback: Invalid JSON Payload” at /home/555677.cloudwaysapps.com/hjgfecmjsc/public_html/app/bundles/EmailBundle/Swiftmailer/Amazon/AmazonCallback.php line 53 {“exception”:“[object] (Symfony\Component\HttpKernel\Exception\HttpException(code: 0): AmazonCallback: Invalid JSON Payload at /home/555677.cloudwaysapps.com/hjgfecmjsc/public_html/app/bundles/EmailBundle/Swiftmailer/Amazon/AmazonCallback.php:53)”} {“hostname”:“555677.cloudwaysapps.com”,“pid”:10324}

Can you help me cope with this problem?

Hello!

Is there anybody who can help?

My Mautic is 4.4.1
MariaDB is 10.3

I have reviewed my SES-SNS setting and got this (good news:) in my Mautic log:

[2022-08-05 16:44:17] mautic.NOTICE: PHP Notice - Undefined index: Type - in file /home/555677.cloudwaysapps.com/hjgfecmjsc/public_html/app/bundles/EmailBundle/Swiftmailer/Amazon/AmazonCallback.php - at line 147 {“payload”:{“notificationType”:“AmazonSnsSubscriptionSucceeded”,“message”:“You have successfully subscribed your Amazon SNS topic ‘arn:aws:sns:eu-central-1:989643182205:Leasingovo-Bounces_and_Complaints’ to receive ‘Bounce’ notifications from Amazon SES for identity ‘leasing.sos.pl’.”},“type”:“AmazonSnsSubscriptionSucceeded”} {“hostname”:“555677.cloudwaysapps.com”,“pid”:16289}
[2022-08-05 16:44:17] mautic.WARNING: Received SES webhook of type ‘’ but couldn’t understand payload {“hostname”:“555677.cloudwaysapps.com”,“pid”:16289}
[2022-08-05 16:44:17] mautic.NOTICE: PHP Notice - Undefined index: Type - in file /home/555677.cloudwaysapps.com/hjgfecmjsc/public_html/app/bundles/EmailBundle/Swiftmailer/Amazon/AmazonCallback.php - at line 147 {“payload”:{“notificationType”:“AmazonSnsSubscriptionSucceeded”,“message”:“You have successfully subscribed your Amazon SNS topic ‘arn:aws:sns:eu-central-1:989643182205:Leasingovo-Bounces_and_Complaints’ to receive ‘Complaint’ notifications from Amazon SES for identity ‘leasing.sos.pl’.”},“type”:“AmazonSnsSubscriptionSucceeded”} {“hostname”:“555677.cloudwaysapps.com”,“pid”:16291}
[2022-08-05 16:44:17] mautic.WARNING: Received SES webhook of type ‘’ but couldn’t understand payload {“hostname”:“555677.cloudwaysapps.com”,“pid”:16291}

It is very strange that when I am submitting my Mautic form with the email address: bounce@simulator.amazonses.com I get this contact marked DO NOT CONTACT in my Mautic instance right away.
But when I submitt the same form with e.g. faousybwevbwyv8472fr@fnUCBVCdbc.com, which is a bounce email my Mautic DO NOT mark this fake email as DNC.

When I enter the endpoint https://phpstack-555677-2695774.cloudwaysapps.com/mailer/amazon/callback to browser and hit it I receive this in the Mautic log:

mautic.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\HttpException: “AmazonCallback: Invalid JSON Payload” at /home/555677.cloudwaysapps.com/hjgfecmjsc/public_html/app/bundles/EmailBundle/Swiftmailer/Amazon/AmazonCallback.php line 53 {“exception”:“[object] (Symfony\Component\HttpKernel\Exception\HttpException(code: 0): AmazonCallback: Invalid JSON Payload at /home/555677.cloudwaysapps.com/hjgfecmjsc/public_html/app/bundles/EmailBundle/Swiftmailer/Amazon/AmazonCallback.php:53)”} {“hostname”:“555677.cloudwaysapps.com”,“pid”:19742}

…and in the server log I get:

[Fri Aug 05 16:44:17.966972 2022] [proxy_fcgi:error] [pid 11877:tid 139986699265792] [client 54.239.6.1:36314] AH01071: Got error ‘PHP message: PHP Notice: Undefined index: Type in /home/555677.cloudwaysapps.com/hjgfecmjsc/public_html/app/bundles/EmailBundle/Swiftmailer/Amazon/AmazonCallback.php on line 147’

Does anyone know what to do about it and how to try to solve the problem?

Greg

Did you apply to get out of Amazon sandbox?

Sure, I am out of the Amazon sandbox for almost a year.

I asked because I recently helped someone who experience similar symptoms like your and it turned out that their AWS account was still in sandbox.

You said a year. Was it working for a year then error showed up? If so, upgraded recently? Setup new email address which may not been verified by AWS yet?

Oh I remembered something about AWS!

If you used that email address in the past trying to test to see if it will mark DNC on bounce, AWS will mark it permanently bounce on their global list.

If you use that email address again, it’ll ignore it and doesn’t send bounce notice over to Mautic.

You will need to use a different email address or Amazon bounce test email address but if you keep using your own fake email address and keep bouncing a bunch, it’ll reflect against your AWS account and you’ll get a nice warning email from Amazon that your account is being reviewed.

You’ll need to get on your AWS account and review your bounce global list on there to remove it.

Also, bounces will not be reported back by AWS if your return email is not verified by AWS as I recalled.

To be honest bounces worked before but when I set up a fresh new installation of Mautic bounces and complaints stopped to work as it should.

I’ve rewied my settings according to Configuring Amazon SNS notifications for Amazon SES - Amazon Simple Email Service

In SNS Topic editor in the Access policy I edited the JSON and I entered this piece of code:

{
“Version”: “2012-10-17”,
“Id”: “notification-policy”,
“Statement”: [
{
“Effect”: “Allow”,
“Principal”: {
“Service”: “ses.amazonaws.com
},
“Action”: “sns:Publish”,
“Resource”: “arn:aws:sns:eu-central-1:989643182205:Leasingovo-Bounces_and_Complaints”,
“Condition”: {
“StringEquals”: {
“AWS:SourceAccount”: “989643182205”,
“AWS:SourceArn”: “arn:aws:ses:eu-central-1:989643182205:identity/leasing.sos.pl”
}
}
}
]
}

According to this Notice from Configuring Amazon SNS notifications for Amazon SES - Amazon Simple Email Service

Important

Verified domain notification settings apply to all mail sent from email addresses in that domain except for email addresses that are also verified.

… I ereased all emails from verified Identities and left only leasing.sos.pl as the only verified domain (no other identiies such as additional emails). I have only one:

and

and

In SNS I have:

What’s more. Every time I send a fake email it is always different. No possible that it is already on “Supression List”.

As I said before it is odd that when I am submitting my Mautic form with the email address: bounce@simulator.amazonses.com I get this contact marked DO NOT CONTACT in my Mautic instance right away.


But when I submitt with the other fake email my Mautic DO NOT mark this fake email as DNC.

Do log errors say anything that can halp find where is the problem?

Today once again I review my settings and got this in my Mautic 4.4.1 log:

[2022-08-07 13:20:15] mautic.NOTICE: PHP Notice - Undefined index: Type - in file /home/555677.cloudwaysapps.com/hjgfecmjsc/public_html/app/bundles/EmailBundle/Swiftmailer/Amazon/AmazonCallback.php - at line 147 {“payload”:{“notificationType”:“AmazonSnsSubscriptionSucceeded”,“message”:“You have successfully subscribed your Amazon SNS topic ‘arn:aws:sns:eu-central-1:989643182205:Leasingovo-Bounces_and_Complaints’ to receive ‘Bounce’ notifications from Amazon SES for identity ‘leasing.sos.pl’.”},“type”:“AmazonSnsSubscriptionSucceeded”} {“hostname”:“555677.cloudwaysapps.com”,“pid”:18775}
[2022-08-07 13:20:15] mautic.WARNING: Received SES webhook of type ‘’ but couldn’t understand payload {“hostname”:“555677.cloudwaysapps.com”,“pid”:18775}
[2022-08-07 13:20:15] mautic.NOTICE: PHP Notice - Undefined index: Type - in file /home/555677.cloudwaysapps.com/hjgfecmjsc/public_html/app/bundles/EmailBundle/Swiftmailer/Amazon/AmazonCallback.php - at line 147 {“payload”:{“notificationType”:“AmazonSnsSubscriptionSucceeded”,“message”:“You have successfully subscribed your Amazon SNS topic ‘arn:aws:sns:eu-central-1:989643182205:Leasingovo-Bounces_and_Complaints’ to receive ‘Complaint’ notifications from Amazon SES for identity ‘leasing.sos.pl’.”},“type”:“AmazonSnsSubscriptionSucceeded”} {“hostname”:“555677.cloudwaysapps.com”,“pid”:18777}
[2022-08-07 13:20:15] mautic.WARNING: Received SES webhook of type ‘’ but couldn’t understand payload {“hostname”:“555677.cloudwaysapps.com”,“pid”:18777}

Isn’t the problem with Mautic rather than AWS?

Oh! Here are my reputation metrics:

:slight_smile: