Configuring Postfix
How to configure Postfix.
Before you begin
- Postfix in version 3.x or higher is installed on your target system.
About this task
Procedure
- Connect to the target server using your preferred SSH tool (e.g. Putty) and log in.
-
Edit the main configuration file /etc/postfix/main.cf and
adjust (or add, if not present) the following parameters:
Parameter Explanation recipient_canonical_maps=regexp:/etc/postfix/recipient_canonical To change the recipient address. Especially for Salesforce Email2Case it is necessary to map a known support address to a known Salesforce Email2Case service address so the email is relayed correctly to Salesforce.
The file recipient_canonical has to be created & converted manually.
For details, see Configuring Email-to-Case.
smtpd_recipient_restrictions=check_recipient_access hash:/etc/postfix/user_map To define whether a given email is intended to be inbound (from an external sender to Salesforce) or outbound (from Salesforce to an external recipient). (See the parameters in the next table row for how to configure Postfix to behave differently in these two cases.)
The file user_map has to be created & converted manually.
smtpd_restriction_classes = inbound, outbound inbound=reject_unknown_sender_domain
outbound=permit_mynetworks
To configure the behaviour of Postfix in different cases: For inbound emails (to Salesforce) it only rejects unknown sender domains, while for outbound emails (from Salesforce) we only accept sender IPs that are in the range of mynetworks (see the parameter mynetworks below). mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 3.225.151.145 13.108.0.0/14 13.127.212.138/32 13.210.4.0/22 13.210.8.0/22 15.207.181.18/32 15.207.182.186/32 15.207.201.97/32 15.207.241.19/32 18.211.105.61/32 18.214.12.209/32 34.197.58.108/32 34.202.86.120/32 52.3.16.30/32 52.22.251.194/32 52.44.156.44/32 52.60.248.0/22 52.60.252.0/22 52.70.135.185/32 66.231.80.0/20 68.232.192.0/20 85.222.128.0/19 96.43.144.0/20 101.53.160.0/19 104.161.128.0/17 128.17.0.0/16 128.245.0.0/16 136.146.0.0/15 159.92.128.0/17 160.8.0.0/16 161.32.64.0/18 161.32.128.0/17 161.71.0.0/17 161.71.128.0/17 163.76.128.0/17 163.79.128.0/17 182.50.76.0/22 185.79.140.0/22 198.245.80.0/20 199.122.120.0/21 202.129.242.0/23 204.14.232.0/21 The allowed sender addresses (These are the known Salesforce addresses from which Salesforce sends out its emails.) smtpd_milters = inet:localhost:8280 Where the Milter app is running. 8280 is the default port. (A different port could theoretically be configured.) milter_default_action = reject How to react if Milter encounters a problem: Reject all further commands in this session with a permanent status code. -
Restart Postfix, for example:
sudo systemctl restart postfix
