Let's take below for example:
*) spam gateway on 192.168.1.100
*) normal iredmail server on 192.168.1.200
1) Set a iRedMail server as usual, it will act as spam gateway server and has IP address 192.168.1.100. Tuning Amavisd settings on this gateway server as below:
*) Make Amavisd-new listen on 192.168.1.100 instead of 127.0.0.1, accept service request from internal network.
# Listen on interface
$inet_socket_bind = '192.168.1.100';
# we only allow this IP address to connect
@inet_acl = qw(192.168.1.200);
# where we send mail after processing (the Postfix box)
$forward_method = 'smtp:192.168.1.200:10025';
$notify_method = $forward_method; # notifications go to the same place
Restarting Amavisd service to make it work.
2) Setup a mail box server as usual. Tune Postfix settings as below:
*) In master.cf, instead of:
content_filter=smtp-amavis:[127.0.0.1]:10024
it would be:
content_filter=smtp-amavis:[192.168.1.100]:10024 # where we send mail for processing
instead of this in master.cf:
127.0.0.1:10025 inet n - n - - smtpd
-o content_filter=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o mynetworks=127.0.0.0/8
<other stuff>
it would be more like this:
192.168.1.200:10025 inet n - n - - smtpd
-o content_filter=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o mynetworks=127.0.0.0/8,192.168.1.100
<other stuff>
Make sure there is not a firewall of some type blocking communication between the two machines.
Restart Postfix service to make it work.