Topic: Disable Spam checks for relay server only

- iRedMail version (check /etc/iredmail-release): 2021123101
- Deployed with iRedMail Easy or the downloadable installer? Yes
- Linux/BSD distribution name and version: Ubuntu
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? Yes
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
We have a larger corporate relay server in front of our iRedMail server, and it does anti-spam/anti-virus checking and quarantines mail before it comes to us.  Thus, we'd like to turn off anti-spam checking if the mail passes through this server.  However, because we need IMAP and authenticated SMTP from outside of our organization, we cannot restrict port 25 to only accept mail from this server.  Since that means some bad actors might find our server and try to send spam directly to us, is there a way to disable spam checking if the connecting server is our relay host, but do spam checks for all other mail coming from other IP addresses?




Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Stable release is out.


Re: Disable Spam checks for relay server only

Add policy bank MYNETS in Amavisd config file like this:

$policy_bank{'MYNETS'} = {  # mail originating from @mynetworks
    # Bypass checks
    bypass_spam_checks_maps => [1],    # don't check spam
    bypass_virus_checks_maps => [1],   # don't check virus
    bypass_banned_checks_maps => [1],  # don't check banned file names and types
    bypass_header_checks_maps => [1],  # don't check bad header

Also add the IP of relay server in "@mynetworks =".