-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
swiftmailer uses starttls with strict certificate checking #752
Comments
UI not a suitable option here as emails can be async and via artisan. Catching the exception and providing help in the test tool plus docs should cover it. |
Not sure how relevant this is, but seems Swift Mailer will stop being maintained at the end of November 2021: https://swiftmailer.symfony.com/docs/introduction.html But I guess Laravel will switch in due course. I had a little trouble with this when testing out a new install for 6.2.0, for example when enabling
Eventually tracked it down to it not being able to send mail via SMTP, but in my debugging I noticed that the comment in
However, sendmail is not the default, according to config/mail.php:
Further down it has this:
This implies that none of the other settings are actually going to be used if you uncomment the suggested conf MAIL_MAILER="sendmail" in the .env example file. For debugging, I also added a new setting into config/mail.php so that I can change the path:
msmtp seems unhappy with the default options hardcoded into config/mail.php:
There is also an issue with tls which we need to fix. So now to override this I can put in .env:
Ubuntu 20.04.3 LTS has an older version of msmtp than latest debian at the moment. The options for --from have changed and don't work on the old version of msmtp. When sending mail for local users that don't exist, msmtpd just doesn't get the envelope sender right so we have to force the issue. (If you change the msmtp default behaviour for Tested configs:
|
Already sorted in the next version: laravel/framework#38481 |
Thanks on the note re I have also updated the docs: https://docs.ixpmanager.org/usage/email/ (note there is some information there on testing) If you read the docs, you'll note that I'm very much trying to push people down the route of using a local (or internal) SMTP daemon:
also:
As well as trying to reduce the support burden, I actually think this is the better production set-up (and allows for, e.g., a pair of highly resilient mail servers using keepalived). Hopefully the changed defaults (i.e. localhost smtp without tls) solve most issues. |
Closing now as:
|
If STARTTLS fails, it throws up something like the following error:
There's no clear indication here that the root cause is starttls, or that the documented workaround is to use
MAIL_ENCRYPTION=false
to prevent the error.Can this exception be caught, parsed and replaced with a UI warning message that SMTP TLS has failed and to check the mail config in .env with a reference to https://docs.ixpmanager.org/usage/email/ ?
The text was updated successfully, but these errors were encountered: