Mautic 5 and Amazon SES

Your software
My Mautic version is: 5.0.4
My PHP version is: 8.1
My Database type and version is: MySQL 8
Ubuntu 22.04 and nginx

Your problem
My problem is: When I try to use ses+api transport plugin and trying to send Test email, after a few seconds (test button with the circle is working) mautic crashes and end in a 500 Internal Server Error

These errors are showing in the log:
Could not resolve host: email.global.amazonaws.com for "https://em
ail.global.amazonaws.com/v2/email/outbound-emails\

Steps I have tried to fix the problem:
When I use SMTP and amazon SMTP server, user and pwd creted in ASES everything works fine

1 Like

Just to be clear:
You installed a symfony ses transport + a ses plugin already, right?

Hi J,
Yes I installed both, I’m thinking that maybe is something with Cloudflare? I’m using free cloudflasre protection and Proxied DNS. I’m not an expert.

This is not a valid amazon ses address:
email.global.amazonaws.com

Where did you find it?

Thank you @joeyk , finally I decided to reinstall everything from scratch and now everything is working, I installed your plugin and now the Subscriptions (SES and SNS) are confirmed, but, I can’t test if the bounce management is really working, I created a segment with a filter for (email-bounce), I created a contact with an inexistent email. I sent the email to that contact, all the cron jobs are up and running but the contacts never gets assigned to the segment (bounced). I really don’t know how to test the callback.
Thanks again for your kindness,

Hello, you can always test the callback by

  1. create a contact with the email

bounce@simulator.amazonses.com

If you do more tests, try:

bounce+label1@simulator.amazonses.com

  1. send an email to this contact

And Mautic will mark it as bounce within 5 minutes.
Bounced contacts will have a red colored label under the points:

image

Thank you @joeyk, I followed your recommendations but nothing happen, I sent an email campaign for three contacts one of them with correct email, the other two contacts are both bounce@simulator.amazonses.com and bounce+label1@simulator.amazonses.com. The contact with correct email received correctly the email campaign, but nothing happened with the bounces.
In Amazon SES I have configured the notificacions for the Identity:
-Email feedback forwarding (enabled)
-Feedback notifications (pointing for bounces and complaints) both to the topics with their respectives subscriptions confirmed and pointing to https://mydomain.com/mailer/amazon/callback.
The thing is that the Feedback Email that is supposed to be sent by Amazon when a bounce occurs never arrives but when I test an email sent from Amazon SES platform simulating a bounce with the bounce@simulator.amazonses.com, at least the email comming from Amazon arrives me, but nothing happen with Mautic.
Maybe I’m missing something in Amazon SES or SNS configuratons?
I’m little lost here.
Thanks again!

Is the SNS channel pending or confirmed? (You can see it Inside SNS)

@joeyk there are confirmed, both subscriptions (Bounced, complaints)

@joeyk I simulated a POST with a Postman to my endpoint using the following Payload:
The payload used to test via POSTMAN was:
{
“bounceType”:“Permanent”,
“bounceSubType”: “General”,
“bouncedRecipients”:[
{
“status”:“5.0.0”,
“action”:“failed”,
“diagnosticCode”:“smtp; 550 user unknown”,
emailAddress":"recipient1@example.com
},
{
“status”:“4.0.0”,
“action”:“delayed”,
emailAddress":"recipient2@example.com
}
],
“reportingMTA”: “example.com”,
“timestamp”:“2012-05-25T14:59:38.605Z”,
“feedbackId”:“000001378603176d-5a4b5ad9-6f30-4198-a8c3-b1eb0c270a1d-000000”,
“remoteMtaIp”:“127.0.2.0”
}
With headers : Content-Type, application/json

I received a 400 error Bad Request page of Mautic, nothing in the logs of Nginx, Mautic or other logs.
Also I receive a 400 Bad Request Mautic page when I use: curl -X POST https://tu-dominio.com/mailer/amazon/callback
I thing using this CURL I must receive a Success message from the plugin Right?
I’m using Cloudflare DNS (proxied)
Thx!!

UPDATE
@joeyk Finally, I managed to get the callback working through Postman with the following message:
{
“Type”: “Notification”,
“Message”: “{"notificationType":"Bounce","bounce":{"bounceType":"Permanent","bounceSubType":"General","bouncedRecipients":[{"emailAddress":"bounced@bounced.xyz","diagnosticCode":"smtp; 550 5.1.1 user unknown"}],"timestamp":"2024-05-25T00:00:00.000Z"},"mail":{"timestamp":"2024-05-25T00:00:00.000Z","source":"sender@bounced.xyz","messageId":"00000123456789012345","destination":["bounced@bounced.xyz"]}}”
}
The contact bounced@bounced.xyz was added to segement bounce and appear like this in Mautic:
image

But I tested again sending emails Thru Mautic but nothing happened with amazon SNS, I think the message coming form Amazon SNS is not correct and it’s causing 400 error, but I don’t understant why? There are some other things that I need to configure in the Topics or Subscription?
Thx!

I finally get all working, I needed to also configure notifications on Amazon SES to my verified email (the email address on which my mails are sent).
Also I needed to modify the Amazon SES plugin, it was only Don’t Contact to emails that came on Amazon SNS as a simple email address jhon@dough.com if the email address came like ‘Jhon Dough jhon@dough.com’ the plugin does not clasify the email as Don’t Contact.
Problem solved.

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.