Postfix Relay
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Postfix mail relay
Installare:
apt install postfix mailutils libsasl2-modules
Inserire le credenziali nel file /etc/postfix/sasl_passwd:
[mail.provider.it]:587 username@gmail.com:password
Nota: le parentesi quadre indicano che deve essere risolto il record A e non il record MX.
Impedire la lettura del file a utenti indiscreti:
chmod 600 /etc/postfix/sasl_passwd
Trasformare il file in hash:
postmap /etc/postfix/sasl_passwd
In /etc/postfix/main.cf modificare le seguenti righe:
relayhost = [mail.provider.it]:587 smtp_use_tls = yes smtp_sasl_auth_enable = yes smtp_sasl_security_options = noanonymous smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
Riavviare postfix:
systemctl restart postfix
Provare a mandare una mail:
mail -s "Test subject" recipient@domain.com
Risolvere eventuali malfunzionamenti:
tail -f /var/log/mail.log