This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
networking:linux:ssmtp [2015/12/25 19:20] gcooper |
networking:linux:ssmtp [2020/02/14 09:43] (current) gcooper |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== SSMTP ====== | ====== SSMTP ====== | ||
- | See also [[networking: | + | See also **[[networking: |
http:// | http:// | ||
Line 18: | Line 18: | ||
===== Installation ===== | ===== Installation ===== | ||
+ | |||
+ | ==== Ubuntu ==== | ||
+ | |||
+ | < | ||
+ | apt install ssmtp bsd-mailx | ||
+ | </ | ||
+ | |||
+ | ==== CentOS ==== | ||
See also **[[computing: | See also **[[computing: | ||
Line 31: | Line 39: | ||
< | < | ||
rpm -e --nodeps sendmail | rpm -e --nodeps sendmail | ||
+ | </ | ||
+ | |||
+ | ===== From Address ===== | ||
+ | |||
+ | <note important> | ||
+ | |||
+ | < | ||
+ | |||
+ | For sending **system or ' | ||
+ | |||
+ | < | ||
+ | vi / | ||
+ | |||
+ | root: | ||
</ | </ | ||
===== Configuration ===== | ===== Configuration ===== | ||
+ | |||
+ | For **SSL** connections on **SMTPS port 465**: | ||
< | < | ||
- | vim / | + | vi / |
- | root=adminuser@yourdomain.com | + | root=validsender@domain.tld # will be the 'from address' |
- | mailhub=mail.yourdomain.com:465 | + | mailhub=mail.domain.tld:465 # to use SSL on port 465 |
- | RewriteDomain=yourdomain.com | + | RewriteDomain=domain.tld # instead of the host name |
# | # | ||
- | FromLineOverride=YES | + | #FromLineOverride=YES |
- | UseTLS=YES | + | UseTLS=YES |
AuthUser=smtpuser | AuthUser=smtpuser | ||
AuthPass=smtppass | AuthPass=smtppass | ||
+ | # | ||
</ | </ | ||
- | :!: If you need to use **port 587**, you will probably | + | :!: If you want to use **TLS** connections on **Submission |
+ | |||
+ | < | ||
+ | mailhub=mail.domain.tld: | ||
+ | # | ||
+ | UseSTARTTLS=YES | ||
+ | # | ||
+ | </ | ||
:!: If you don't specify a '' | :!: If you don't specify a '' | ||
===== Test ===== | ===== Test ===== | ||
+ | |||
+ | :!: If desired, enable (un-comment) the **debug** line, then look in ''/ | ||
If desired, install the '' | If desired, install the '' | ||
Line 71: | Line 105: | ||
< | < | ||
- | echo test | ssmtp -v tester@yourdomain.com | + | echo test | ssmtp -v -f " |
</ | </ | ||
Line 86: | Line 120: | ||
< | < | ||
cat << EOF >> / | cat << EOF >> / | ||
- | From: MyPBX <smtp@MyPBX> | + | From: Full Name <validsender@domain.tld> |
- | To: Test <tester@yourdomain.com> | + | To: Test User <tester@somedomain.tld> |
Subject: For test only! | Subject: For test only! | ||
Line 94: | Line 128: | ||
ssmtp -t < / | ssmtp -t < / | ||
+ | </ | ||
+ | |||
+ | ===== Troubleshooting ===== | ||
+ | |||
+ | < | ||
+ | Debug=YES | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | tail -30 / | ||
</ | </ | ||