Skip to content
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

Sending mail locally is broken (bad msmtprc config) #155

Open
ptmkenny opened this issue Mar 19, 2022 · 0 comments
Open

Sending mail locally is broken (bad msmtprc config) #155

ptmkenny opened this issue Mar 19, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@ptmkenny
Copy link
Contributor

lando v3.6.2
Drupal 9

Whenever I try to send email with Drupal, I get a "Cannot send email" error.

So with help from platform.sh Slack, I tried a test email:

php -r 'mail("[[email protected]](mailto:[email protected])", "test message", "just testing", "From: [[email protected]](mailto:[email protected])");',

This gave the error: sendmail: /etc/msmtprc: line 6: command host needs an argument.

A Stack Overflow search led me to this answer, which suggests a problem with msmtprc.

So I did lando ssh; vi /etc/msmtprc:

defaults
syslog on
timeout off

account platform
host
from

account default : platform

I think this is incorrect because when I check vi /etc/msmtprc.psh-tmpl, I see:

defaults
syslog on
timeout off

account platform
host ${info.get("mail_relay_host_tmpl", "")}
from ${info.get("mail_smtp_from", "")}

account default : platform

So it seems that the values for host and from are not getting filled in for some reason.

I don't really know anything about msmtprc so this is as far as I got with debugging.

@ptmkenny ptmkenny added the bug Something isn't working label Mar 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant