The context:
I currently have a main MX that run spamassassin trough a direct filter:
smtp inet n - n - - smtpd -o content_filter=filter
filter unix - n n - - pipe flags=R user=spamd argv=/usr/bin/spamc -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}
I also have a backup MX that run his spam checks and forward to my main mailserver.
The issue:
When a forwarded mail arrive to the main MX spam checks are done again and previous X-Spam-Flag:
are overwritten (asd expected).
BUT, on main MX, the Received:
header point to the backup MX, that cause RBL checks are done on wrong IP, always success and spam mails (correctly detected by backup MX) are marked again as "not spam" (an this is bad).
The question:
Is there a way to skip content_filter
and keep original X-Spam-Flag:
for mails that came from a specific host (the backup MX)?
Found a very simple solution: run another SMTP instance on another port with no content and config backup MX to forward to it.
Add on Main MX master.cf:
And open port 26 on Main MX firewall: