Configuring rules of routing mail traffic from an Exim server
The instructions apply to the mail transfer agent Exim 4 with separate configuration files. If all Exim settings are stored in a single configuration file in your organization, you must add the specified strings to this file. For more information about configuring Exim, see exim.org.
Before you configure mail traffic routing rules, add a source for filtering mail traffic.
remote_smtp_check
transport to send mail traffic from an Exim server to PT MS to check. To do so, create the file /etc/exim4/conf.d/transport/45_exim4-config_remote_smtp_check
and add the following strings to it:remote_smtp_check: driver = smtp port = <port for receiving mail on PT MS SMTP server> delay_after_cutoff = false
remote_smtp_check
section: command_timeout = 25m final_timeout = 30m
45_exim4-config_remote_smtp_check
file./etc/exim4/conf.d/router/050_exim4-config_ptms
and add the following strings to it:send_to_check: driver = manualroute condition = ${if eq {$interface_port}{<port for receiving checked messages>}{no}{yes}} transport = remote_smtp_check route_list = * <PT MS IP address> address_test = false
The added
send_to_check
routing rule must have the highest possible priority. To verify this, make sure that in the directory /etc/exim4/conf.d/router
the 050_exim4-config_scanner
file comes immediately after the 00_exim4-config_header
file alphabetically.050_exim4-config_ptms
file./etc/exim4/conf.d/acl/25_exim4-config_check_host
and add the following strings to it:acl_check_host: deny message = Untrusted sender host condition = ${if eq {$interface_port}{<port for receiving checked messages>}{yes}{no}} condition = ${if match_ip{$sender_host_address}{<PT MS IP address>}{no}{yes}} accept
25_exim4-config_check_host
file./etc/exim4/conf.d/main/02_exim4-config_acl_pre_options
and add the following string to it:acl_smtp_connect = acl_check_host
MESSAGE_SIZE_LIMIT = "<maximum message size in MB>M"
02_exim4-config_acl_pre_options
file./etc/exim4/update-exim4.conf.conf
:sudo nano /etc/exim4/update-exim4.conf.conf
dc_local_interfaces='0.0.0.0 ; <IP address of server for receiving checked mail>.<port for receiving checked mail>'
dc_relay_nets='<PT MS IP address>'
update-exim4.conf.conf
file.sudo update-exim4.conf
sudo service exim4 restart