How do I set up PostFix to send messages via the outgoing filter?


In this article we describe how you can set up the outgoing filter on your PostFix server in a few steps. Under PostFix you can use different types of authentication. Depending on which variant you choose, a different procedure is necessary. 


Variant 1: Authentication via the IP address (smarthost)

With this method, you route all messages from your mail server through our filter cloud.

1

Make sure that the IP address of your mail server has been created as outgoing user in EuropeanMX. For instructions on how to set up an outgoing user, please refer to our FAQ article "How do I set up an outgoing user?".

2

Make sure that the correct limits are set for the outgoing user in EuropeanMX. 

3

Change the configuration on your mail server. To do this, call the file etc/postfix/main.cf and make sure that the following line is included:

relayhost = smtp.antispamcloud.com:587
4

Starten Sie Ihren PostFix neu.


Variant 2: Authentication via a user name and password (Smarthost)

With this method, you route all messages from your mail server through our filter cloud.

1

Make sure that an authenticating user has been created as outgoing user in EuropeanMX. For instructions on how to set up an outgoing user, please refer to our FAQ article "How do I set up an outgoing user?".

2

Add the following line to the file etc/postfix/main.cf:

relayhost = smtp.antispamcloud.com:587

3

Add the following lines to the file etc/postfix/main.cf directly below:

smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options =
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
smtp_use_tls = yes
4

Create a file with the access data, e.g. /etc/postfix/sasl_passwd

smtp.antispamcloud.com USERNAME:PASSWORD

Replace USERNAME:PASSWORD with the access data that you have previously defined for the outgoing user in EuropeanMX.

5

Update the permissions of the file sasl_passwd so that it can only be read by the user root and create the hash database:

sudo chmod 600 /etc/postfix/sasl_passwd
sudo postmap /etc/postfix/sasl_passwd
6

Starten Sie den Postfix neu, um die Änderungen zu übernehmen

/etc/init.d/postfix restart


Variante 3: Authentication via the domain name

If you want to use a more fine-grained model, you can route the outbound traffic for your domains through separate users. This allows you to apply different settings per domain, but also allows end users to access their own log files.

1

Make sure that an authenticating domain has been created as outgoing user in EuropeanMX. For instructions on how to set up an outgoing user, please refer to our FAQ article "How do I set up an outgoing user?".

2

Create a file sasl_passwd for the (different) outgoing user(s).

@example.com outgoing@example.com:THEPASSWORD
3

Create a file sender_relay.

@example.com smtp.antispamcloud.com:587
@example.net smtp.antispamcloud.com:587
4

Postmap both files.

postmap /etc/postfix/sasl_passwd
postmap /etc/postfix/sender_relay
5

Add the following lines to the file etc/postfix/main.cf:

relayhost = smtp.antispamcloud.com:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options =
smtp_sender_dependent_authentication = yes
sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay


With these lines, you instruct your Postfix to send all messages from your server via our filter cloud, even if they are not entered in the file sender_relay. If you do not want this and only want certain domains to be sent via EuropeanMX, remove the first line relayhost = smtp.antispamcloud.com:587.

7

Restart your PostFix.


Was this article helpful?

No Yes