marlam / msmtp

SMTP client with sendmail compatible interface
https://marlam.de/msmtp
GNU General Public License v3.0
176 stars 36 forks source link

[FEAT] Add dry-run option #179

Closed avidseeker closed 1 month ago

avidseeker commented 1 month ago

It might be preferable to preview the message sent to the server verbatim. E.g: check for headers, X-Mailer, look for IP leaks, etc. Having a --dry option to do that would also solve the commonly requested feature which is saving sent mail to a directory. (Just websearch the keywords "msmtp save to sent". Here's a SE question.)

E.g:

msmtp --dry test@example.com < mail.txt > ~/Sent/mail.eml
marlam commented 1 month ago

For debugging purposes, you can use the following:

msmtpd --interface=::1 --port=12345 --command='cat; echo'

That will dump the mail (cat) and the command line (echo) to stdout whenusing msmtp like this:

msmtp --host=::1 --port=12345 --from test@example.com recipient@example.com < mail.txt

Saving a copy of a mail to a sent-mail folder is the responsibility of the mail user agent, not msmtp.

avidseeker commented 2 weeks ago

Saving a copy of a mail to a sent-mail folder is the responsibility of the mail user agent, not msmtp.

Using MUA works when I'm sending email through the MUA TUI, but not when sending email through CLI. Not all MUA support CLI usage (e.g: aerc).

$ weekly_mail_cronjob | msmtp mailing@list.org    # I want a copy of that in my +Sent