ssh_sendmail_instead_of_login_shell
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
ssh_sendmail_instead_of_login_shell [2022/11/12 01:54] – created jquah | ssh_sendmail_instead_of_login_shell [2022/11/13 23:41] (current) – delete --- to be recreated with a more accurate name jquah | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ==== SSH session that runs sendmail instead of your login shell ==== | ||
- | === What? === | ||
- | A wrapper for your local mail transfer agent (MTA) that initiates an SSH session when your SDF email address appears in the " | ||
- | |||
- | === Why? === | ||
- | You want to send email from your SDF address without running the risk that the receiving server will reject it due to a mismatch between the " | ||
- | |||
- | === Where? === | ||
- | a *BSD, Linux, or WSL environment with a client that generates MIME-formatted mail (as expected by sendmail-compatible MTAs such as msmtp) | ||
- | |||
- | === How? === | ||
- | - Set up SSH public key authentication, | ||
- | - Save the wrapper script below somewhere in your $PATH. Change the value of $MTA to the mail transport agent that you would otherwise be using for outgoing mail, and of course change all email addresses to the ones you actually want to wrap. | ||
- | - Configure your mail user agent (MUA) to call the wrapper script, rather than calling your MTA directly. | ||
- | |||
- | ``` | ||
- | # | ||
- | # | ||
- | # msmtp.wrap - bypass local in favor of remote sendmail, | ||
- | # if certain headers are found | ||
- | |||
- | Account0=me@sdf.org | ||
- | Account1=me@other-pubnix.net | ||
- | MTA=msmtp | ||
- | draft=" | ||
- | cat /dev/stdin > " | ||
- | sender=" | ||
- | |||
- | case " | ||
- | *me@sdf.org* ) | ||
- | sendmail=" | ||
- | *me@other-pubnix.net* ) | ||
- | sendmail=" | ||
- | * ) | ||
- | sendmail=" | ||
- | esac | ||
- | |||
- | < " | ||
- | rm -f " | ||
- | ``` |
ssh_sendmail_instead_of_login_shell.1668218072.txt.gz · Last modified: 2022/11/12 01:54 by jquah