Postfix Relaying

Postfix is capable of relaying to other SMTP mail servers, either unconditionally or conditional on the destination.


Example

The relay instruction in a transport(5) file causes mail to be relayed to another SMTP server. For example:

localhost            local
.localdomain         local
*                    relay:[smtp.gmail.com]:587


Configuration

Use of a relay server often requires authentication and encryption.

As an example, for GMail, try:

smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = lmdb:/etc/postfix/sasl/sasl_passwd
smtp_tls_security_level = encrypt
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt

/etc/postfix/sasl/sasl_passwd should look like:

[smtp.gmail.com]:587 [email protected]:wwwwxxxxyyyyzzzz

Run postmap /etc/postfix/sasl/sasl_passwd and a hashed file will be produced. If your postmap(1) does not use LMDB, replace the lmdb: with whatever algorithm was used.


CategoryRicottone

Postfix/Relaying (last edited 2023-06-24 03:43:21 by DominicRicottone)