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

set_from_header not working #31

Closed
msafadieh opened this issue Sep 26, 2020 · 2 comments
Closed

set_from_header not working #31

msafadieh opened this issue Sep 26, 2020 · 2 comments

Comments

@msafadieh
Copy link

I've been trying to setup msmtp to automatically rewrite the from headers for my cron emails. I put set_from_header on in my config file per the documentation but it seems like sendmail is ignoring that.

This the log output. As you can see the from header is different than the one in the config file.

Sep 26 09:51:02 host=smtp.purelymail.com tls=on auth=on user=log@mhmd.sh from=mhmd recipients=[REDACTED] smtpstatus=530 smtpmsg='530 5.7.1 You (log@mhmd.sh) are not authorized to send mail as mhmd@purelymail.com' errormsg='envelope from address mhmd not accepted by the server' exitcode=EX_DATAERR

This is my config:

account status
host    smtp.purelymail.com
port    587
from    log@mhmd.sh
user    log@mhmd.sh
password password
tls on
auth on
set_from_header on
logfile ~/.cache/msmtp.log
tls_trust_file /etc/ssl/certs/ca-certificates.crt

aliases /etc/aliases
account default : status
@marlam
Copy link
Owner

marlam commented Oct 4, 2020

I cannot reproduce this error, it works for me.
Can you provide a --debug output for a small example mail?
(Be sure to remove authentication lines).

Something like
echo -e "From: wrong@address\nSubject: Test Header\n\nTest Body" | msmtp --debug recipient@example.com

@msafadieh
Copy link
Author

That seems to work fine. I was able to fix the issue by telling cron to use msmtp -t instead of sendmail as instructed on the ArchWiki.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants