meta data for this page
Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
linux:mail:postfix [2018/08/01 13:48] niziak |
linux:mail:postfix [2023/02/13 12:49] (current) niziak ↷ Page moved from linux:postfix to linux:mail:postfix |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== relay only for one user ====== | + | ====== Postfix ====== |
- | <file |/etc/postfix/relay_by_sender> | ||
- | # Specify zero or more "type:name" lookup tables. Type is a service defined in master.cf | ||
- | cloudservice@example.org [smtp.gmail.com]:587 | ||
- | </file> | ||
- | cd /etc/postfix && postmap relay_by_sender | ||
- | <file | /etc/postfix/sasl_passwd> | ||
- | [smtp.gmail.com]:587 myrealsender@gmail.com:secret_password | ||
- | </file> | ||
- | |||
- | <code bash> | ||
- | cd /etc/postfix && postmap sasl_passwd | ||
- | sudo chown root:root /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.db | ||
- | sudo chmod 0600 /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.db | ||
- | </code> | ||
- | |||
- | <file | main.cf> | ||
- | ... | ||
- | # A sender-dependent override for the global relayhost parameter setting | ||
- | sender_dependent_relayhost_maps = hash:/etc/postfix/relay_by_sender | ||
- | smtp_sender_dependent_authentication = yes | ||
- | smtp_sasl_auth_enable = yes | ||
- | smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd | ||
- | smtp_sasl_security_options = noanonymous | ||
- | </file> | ||
- | |||
- | |||
- | <code bash>service postfix restart</code> | ||
- | |||
- | Test email: | ||
- | <code bash>cat /etc/issue | mailx -r "cloudservice@example.org" -s "test relaya" "destination@email.org"</code> | ||
- | |||
- | ====== Issues ====== | ||
- | |||
- | (SASL authentication failed; cannot authenticate to server smtp.server.org[11.22.33.44]: no mechanism available) | ||
- | solution: smtp_sasl_security_options = noanonymous | ||