Both sides previous revision
Previous revision
Next revision
|
Previous revision
|
networking:linux:ssmtp [2019/05/11 08:55] gcooper |
networking:linux:ssmtp [2020/02/14 09:43] (current) gcooper |
<note important>In modern times, secure mail servers are very strict about who is authorized to send mail. You generally must use a **valid sender e-mail 'from address'** that **matches the authentication credentials** used.</note> | <note important>In modern times, secure mail servers are very strict about who is authorized to send mail. You generally must use a **valid sender e-mail 'from address'** that **matches the authentication credentials** used.</note> |
| |
Using ''FromLineOverride=YES'' will allow the sender to specify the 'from address' at the time of sending. ''FromLineOverride=NO'' will force the 'from address' to the ''root=validsender@domain.tld'' line in ''ssmtp.conf''. | <note>Using ''FromLineOverride=YES'' will allow the sender to specify the 'from address' at the time of sending. ''FromLineOverride=NO'' will force the 'from address' to the ''root=validsender@domain.tld'' line in ''ssmtp.conf''.</note> |
| |
For sending 'root' mail, you will probably have to manipulate the 'from address' to get SSMTP to send mail through a secure mail server. | For sending **system or 'root' mail**, you will probably have to manipulate the 'from address' to get SSMTP to send mail through a secure mail server. |
| |
<file> | <file> |
| |
<file> | <file> |
vim /etc/ssmtp/ssmtp.conf | vi /etc/ssmtp/ssmtp.conf |
| |
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 |
#hostname=_HOSTNAME_ | #hostname=_HOSTNAME_ |
FromLineOverride=YES # allows setting from address at runtime | #FromLineOverride=YES # allows setting 'from address' at runtime |
UseTLS=YES | UseTLS=YES # for SSL |
AuthUser=smtpuser | AuthUser=smtpuser |
AuthPass=smtppass | AuthPass=smtppass |
#Debug=YES | #Debug=YES # useful for troubleshooting |
</file> | </file> |
| |
| |
<file> | <file> |
mailhub=mail.yourdomain.com:587 | mailhub=mail.domain.tld:587 |
#UseTLS=YES | #UseTLS=YES |
UseSTARTTLS=YES | UseSTARTTLS=YES |
#TLS_CA_File=/etc/pki/tls/certs/ca-bundle.crt # Not needed on Ubuntu? | #TLS_CA_File=/etc/pki/tls/certs/ca-bundle.crt # Depends on configuration - Not needed on Ubuntu 18.04 |
</file> | </file> |
| |