# Mautic 5 and Amazon SES

**URL:** <https://forum.mautic.org/t/mautic-5-and-amazon-ses/32112>\
**Category:** Product Support\
**Created:** [May 19, 2024, 4:57pm UTC](https://forum.mautic.org/t/mautic-5-and-amazon-ses/32112 "2024-05-19T16:57:30Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![aibanez](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/aibanez/32/3875_2.png) [@aibanez](https://forum.mautic.org/u/aibanez)\
**Post date:** [May 19, 2024, 4:57pm UTC](https://forum.mautic.org/t/mautic-5-and-amazon-ses/32112/1 "2024-05-19T16:57:30Z")

</div>

**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](http://email.global.amazonaws.com) for "[https://em](https://em)  
[ail.global.amazonaws.com/v2/email/outbound-emails\](http://ail.global.amazonaws.com/v2/email/outbound-emails%5C)

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

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [May 20, 2024, 6:34am UTC](https://forum.mautic.org/t/mautic-5-and-amazon-ses/32112/2 "2024-05-20T06:34:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![aibanez](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/aibanez/32/3875_2.png) [@aibanez](https://forum.mautic.org/u/aibanez)\
**Post date:** [May 20, 2024, 1:26pm UTC](https://forum.mautic.org/t/mautic-5-and-amazon-ses/32112/3 "2024-05-20T13:26:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [May 23, 2024, 9:50am UTC](https://forum.mautic.org/t/mautic-5-and-amazon-ses/32112/4 "2024-05-23T09:50:10Z")

</div>

This is not a valid amazon ses address:  
[email.global.amazonaws.com](http://email.global.amazonaws.com/)

Where did you find it?

---

<div class="post-metadata">

**Author:** ![aibanez](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/aibanez/32/3875_2.png) [@aibanez](https://forum.mautic.org/u/aibanez)\
**Post date:** [May 23, 2024, 1:44pm UTC](https://forum.mautic.org/t/mautic-5-and-amazon-ses/32112/5 "2024-05-23T13:44:01Z")

</div>

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,

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [May 24, 2024, 5:33am UTC](https://forum.mautic.org/t/mautic-5-and-amazon-ses/32112/6 "2024-05-24T05:33:02Z")

</div>

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](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/1/187ad211585d20d5f668d26614b38f500d2d277a.png)

---

<div class="post-metadata">

**Author:** ![aibanez](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/aibanez/32/3875_2.png) [@aibanez](https://forum.mautic.org/u/aibanez)\
**Post date:** [May 24, 2024, 8:17pm UTC](https://forum.mautic.org/t/mautic-5-and-amazon-ses/32112/7 "2024-05-24T20:17:59Z")

</div>

> [@joeyk](#):
>
> [bounce+label1@simulator.amazonses.com](mailto:bounce+label1@simulator.amazonses.com)

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](mailto:bounce@simulator.amazonses.com) and [bounce+label1@simulator.amazonses.com](mailto: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](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](mailto: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!

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [May 27, 2024, 6:02am UTC](https://forum.mautic.org/t/mautic-5-and-amazon-ses/32112/8 "2024-05-27T06:02:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![aibanez](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/aibanez/32/3875_2.png) [@aibanez](https://forum.mautic.org/u/aibanez)\
**Post date:** [May 27, 2024, 1:17pm UTC](https://forum.mautic.org/t/mautic-5-and-amazon-ses/32112/9 "2024-05-27T13:17:08Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/3/34663f5dc3a2ebd6a0356ba57d2bcce0fda350b9.png)

---

<div class="post-metadata">

**Author:** ![aibanez](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/aibanez/32/3875_2.png) [@aibanez](https://forum.mautic.org/u/aibanez)\
**Post date:** [May 27, 2024, 1:27pm UTC](https://forum.mautic.org/t/mautic-5-and-amazon-ses/32112/10 "2024-05-27T13:27:43Z")

</div>

@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](mailto:emailAddress%22:%22recipient1@example.com)”  
},  
{  
“status”:“4.0.0”,  
“action”:“delayed”,  
“[emailAddress":"recipient2@example.com](mailto:emailAddress%22:%22recipient2@example.com)”  
}  
],  
“reportingMTA”: “[example.com](http://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](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!!

---

<div class="post-metadata">

**Author:** ![aibanez](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/aibanez/32/3875_2.png) [@aibanez](https://forum.mautic.org/u/aibanez)\
**Post date:** [May 27, 2024, 2:21pm UTC](https://forum.mautic.org/t/mautic-5-and-amazon-ses/32112/11 "2024-05-27T14:21:07Z")

</div>

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](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/f/f09ffdd42459a6757a28b91181b119449e778edd.png)

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!

---

<div class="post-metadata">

**Author:** ![aibanez](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/aibanez/32/3875_2.png) [@aibanez](https://forum.mautic.org/u/aibanez)\
**Post date:** [May 29, 2024, 3:33pm UTC](https://forum.mautic.org/t/mautic-5-and-amazon-ses/32112/12 "2024-05-29T15:33:26Z")

</div>

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](mailto:jhon@dough.com) if the email address came like ‘Jhon Dough [jhon@dough.com](mailto:jhon@dough.com)’ the plugin does not clasify the email as Don’t Contact.  
Problem solved.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/1X/43c63600fe51440378769136903f1fa2a9a34102.png) [@system](https://forum.mautic.org/u/system)\
**Post date:** [May 31, 2024, 3:33am UTC](https://forum.mautic.org/t/mautic-5-and-amazon-ses/32112/13 "2024-05-31T03:33:38Z")

</div>

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