Replies: 5 comments
-
Swift mailer is deprecated. It will replaced by Symfony Mailer component. |
Beta Was this translation helpful? Give feedback.
-
Ah yeah good point, didn't realise Laravel was already working on replacing that for Version 9. |
Beta Was this translation helpful? Give feedback.
-
Now that we've added Symfony Mailer component. How do we add DKIM signature?
The symfony documentation makes it easy to use, see https://symfony.com/doc/current/mailer.html#dkim-signer. but with L9 how do we implement this? |
Beta Was this translation helpful? Give feedback.
-
Here https://github.com/laravel/framework/blob/9.x/src/Illuminate/Mail/Mailer.php#L285 |
Beta Was this translation helpful? Give feedback.
-
Thanks @woodspire I had a look at that too. I hoped that the Laravel team would add the support so I don't have to create a pull request. However, after making a couple of changes I realised that the DKIM signature is invalid, my public and private keys are fine tho because it was fine with L8. After digging into this, the issue is caused by the "bh" tag, something not quite right with the hash...not sure why this is happening, I followed the instructions and it's still happening :( . Now I need to dig into this. what a nightmare! |
Beta Was this translation helpful? Give feedback.
-
Currently other than sending a raw message and manually attaching a Swift Mailer message signer, there appears to be no framework supported way for signing emails using DKIM.
In the current world of mail sending and receiving its getting harder and harder to ensure mail deliverability without SPF, DKIM and DMARC alignment all being correct, to that end it would be beneficial if Laravel could add support for DKIM signing.
It would be convenient to be able to configure a global DKIM key and selector that would be default get attacked to a message, and as well to be able to specify a DKIM key and selector on a per message basis, overwriting the global config per message (this could be useful in a multi-tenant situation or in a multi-brand application)
As mentioned, the underlying Swift Mailer library Laravel makes use of already has support for this in the way of the "Swift_Signers_DKIMSigner" and a few packages already exist to add very limited DKIM support to Laravel, but all require directly modifying the already existing Mailer singleton in the IoC DI Container.
While I am aware that mail alternatives such as SendGrid, Mailgun and Postmark all exist, it would still be good for the smaller sites to be able to setup DKIM sending to improve mail deliverablity for small self-hosted sites or even existing companies that have their own mail infrastructure they'd like to leverage.
Beta Was this translation helpful? Give feedback.
All reactions