Mautic 5 New callback process results in 404

Your software
My Mautic version is: 5.0.1
My PHP version is: 8.1.27
My Database type and version is:

Your problem
Hi everyone, I upgraded to 5.0.1 :clap: but I saw that the callback process is now unified under https://mautic.example.com/mailer/callback however my postmark webhook calls will get a 404

These errors are showing in the log:

"POST /mailer/callback HTTP/1.1" 404 5592 "-" "Postmark"
 "POST /mailer/callback HTTP/1.1" 404 5592 "-" "Postmark"

Thanks for posting over here!

Copying from Slack:

https://docs.mautic.org/en/5.x/configuration/settings.html#email-transport-settings

We don’t currently have a plugin for Postmark, so it won’t work with callbacks yet, I don’t expect - even the Symfony plugins don’t support callbacks, a Mautic plugin is required as we communicated in the release upgrade notes and blog post. SMTP mode should work as an interim measure.

To use Postmark fully, you’ll need to write a plugin for that (or have someone write one for you and submit it to the marketplace ideally) - docs are here: Emails — Mautic Developer Documentation 3.0.0 documentation for the transports and here for the marketplace: Listing a Plugin in the Marketplace — Mautic Developer Documentation 3.0.0 documentation.

I’m using SMTP to send, my challenge is to get bounce and subscription changes via webhook it was working fine in 4.4.1 with 'mautic.transport.postmark' in /mautic/app/bundles/EmailBundle/Config/config.php but Mautic 5 has completely re-written the entire email sending system.

The callback was simplified in M5. And as Ruth suggested, there will have to be a plugin to listen for the webhooks (callbacks).

The callback route was changed to /mailer/callback for all email providers. Any plugin can listen for the request and do the actions it needs to do.

Here is an example of the subscriber that does this exact thing for the Sparkpost email provider:

So the new plugin will need this subscriber, modify it for Postmark payload and that’s it.

I have a question about this.
This is a spakpost plugin, that seem to include sending AND callback all together.

But the clear advantage of symfonymailer was, that we can use an transport by using installing it from symfony, like:

I did install this, and email sending works like a charm.

So when a new amazon plugin will be created, then it will just add a callback, or have to re-install this new plugin, that also handles email sending + callback?

The SES plugin should use batch API to send emails so it will be sending thousands of times faster than SMTP. It will also handle the callbacks. It won’t hurt to have the Symfony transport installed together with the SES plugin, but I don’t see a reason why.

I ran composer require symfony/postmark-mailer and tested sending emails through postmark+api, success. However the callbacks still get 404 No email transport that could process this callback was found I guess that doesn’t come out of the box ?

Callback is not included in the Symfony mailer transports, as documented here:

https://docs.mautic.org/en/5.x/configuration/settings.html#example-api-transport-installation

It’s a nice perk that Mautic can use any transport provided by Symfony Mailer. However, be aware that such transports (from Symfony) don’t support batch sending, even via API. They only send one email per request, as opposed to a thousand emails per request as is the case with some Mautic transports, which can make them slow at scale. They also don’t support transport callback handling used for bounce management. If you plan to send larger volumes of Emails or need to use features which require callback handling, please consider using Email transports built specifically for such use. These plugins are available in the Mautic Marketplace.

So you’d need a Mautic plugin created to manage the callback.

Hi - are you referring to a specific plugin for SES which is about to be released?
Yes - Amazon SES API should send batch and callbacks to be processed would also be appreciated.

There was a discussion about the SES plugin last week on Slack:

The repo is GitHub - mabumusa1/ses-plugin and the ask was to get more contributors to get it finished.

The Sparkpost plugin can work as an inspiration for whatever is missing in the SES plugin:

1 Like