If you have multiple IP addresses available on your iRedMail server, and would like to send from different IP Addresses for different domains, follow the steps below.
Create new transport in /etc/postfix/master.cf like below:
172.16.244.159 by your real IP address.smtp_bind_address6 instead of smtp_bind_address.smtp_helo_name and syslog_name are optional.sample-smtp unix - - n - - smtp
-o smtp_bind_address=172.16.244.159
# -o smtp_helo_name=example.com
# -o syslog_name=postfix/sample-smtp
You have email domain name example.com hosted on iRedMail server, and you
want to force all emails sent by users under example.com to be sent from
specified IP address.
sender_dependent_default_transport_maps to the end of
/etc/postfix/main.cf like below:sender_dependent_default_transport_maps = hash:/etc/postfix/sdd_transport
/etc/postfix/sdd_transport with content below (Replace
example.com by your real local domain name):@example.com sample-smtp:
postmap and reload Posfix service to load changed settings:postmap /etc/postfix/sdd_transport
postfix reload
You want to force all emails sent from iRedMail server to Gmail (gmail.com)
to be sent from specified IP address.
gmail.com) and transport name in
/etc/postfix/transport like below:gmail.com sample-smtp:
You may want to force for all sub-domain names (e.g. x.gmail.com, y.gmail.com) too:
.gmail.com sample-smtp:
postmap and reload Posfix service to load changed settings:postmap /etc/postfix/transport
postfix reload