-
Edit
/etc/postfix/main.cf
-
Add these lines:
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/saslpasswd
smtp_always_send_ehlo = yes
relayhost = smtp.domain.tld
Change the smtp.domain.tld
with your providers SMTP and add port if the port SMTP is different. Eg. relayhost = smtp.your_domain.tld:port
-
Create a file saslpasswd in /etc/postix. Eg. /etc/postfix/saslpasswd
-
Add your username and password in saslpasswd in following format.
smtp.domain.tld yourlogin:yourpassword
-
Hash saslpasswd with following command.
$ postmap /etc/postfix/saslpasswd
-
Restart postfix.
$ service postfix restart
That’s it
Test it and see the postfix logs for the relay traces.
Note: When the Yunohost gets updated you will have to configure /etc/postfix/main.cf again as Yunohost update will overwrite this file.
You can even relay from your friends Yunohost server too.