1

Hi to the Linux community. I'm coming from a Windows Server background so have mercy.

I'm attempting to whitelist some domains and although I know this isn't the best way of doing so its just a one off for a couple of domains so I thought it would be the quickest way of doing so. Current setup:

Amavis is used to pass emails off the ClamAV and SpamAssasin, currently I make changes in /etc/amavis/conf.d/50-user, as this will overide other settings.

Have created a whitelist file that looks like this:

.domaintowhitelist.com
.domain2towhitelist.com

In the 50-user config file:

Have tried variants like this:

read_hash(\%whitelist_sender, '/etc/amavis/whitelist');
read_hash(\%virus_lovers, '/etc/amavis/whitelist');

And restarting amavis after making those changes. Am I going about this the wrong way? Any help is appreciated.

1
  • I know this is four years later, but can you explain the syntax \%whitelist_sender? I can't find that anywhere in the amavis docs. It's always just read_hash(<file>). Aug 11, 2014 at 17:11

2 Answers 2

7

I do whitelisting at the MTA level (in my case postfix) rather than at the amavisd level. In my postfix/main.cf file, I have:

header_checks=pcre:/etc/postfix/whitelist.pcre

Inside whitelist.pcre, I have the following syntax:

[email protected] FILTER  SMTP:[127.0.0.1]:10025

where SMTP:[127.0.0.1]:10025 is the transport in master.cf that filtered mail is reinjected into the postfix system. My reasoning to do that is if certain messages are not to be checked for anything, I don't want amavisd to touch it.

4
  • 1
    That's an odd looking pcre statement. Use /user@example\.com/ FILTER smtp:[127.0.0.1]:10025
    – B. Shea
    May 17, 2017 at 17:12
  • Haven't you ended up with a transport error ? I had Jan 29 12:12:00 messagerie postfix/error[27477]: 9A1783A80088:to=<[email protected]>, relay=none,relay=none, delay=1.6, delays=1.5/0.01/0/0.01, dsn=4.3.0, status=deferred (mail transport unavailable)
    – ychaouche
    Jan 29, 2018 at 11:20
  • it should be "smtp" in minor case, otherwise you'd get a mail transport unavailable error. The logs may contain a line that looks like this : warning: connect to transport private/SMTP: No such file or directory `
    – ychaouche
    Jan 29, 2018 at 11:31
  • worked for me, the only thing I changed was instead of smtp:[127.0.0.1]:10025, I used lmtp:inet:localhost:24
    – oware
    Aug 24, 2021 at 15:45
1

I never used a setup an external file. When I had to implement a whitelist, i simply used one of the form listed here:

http://www.akadia.com/services/postfix_amavisd.html#Globally%20Sender%20Whitelists%20and%20Blacklists

and especially this one:
@whitelist_sender_maps = (['.example.org', '.example.net']);

2
  • Thanks for the suggestion. I have applied that line to my 50-user config file and restarted amavis but tried to send my mailbox anotehr 'virus' and exe in a zip file and get the BANNED bounce back message. Is there any way to check if my sending domain is being whitelisted? Thanks
    – pigeon
    Jun 16, 2010 at 8:52
  • As stated here ijs.si/software/amavisd/amavisd-new-docs.html#wblist : "It should be emphasized that whitelisting (and blacklisting) only affects spam checks. It has no influence on other checks such as virus, banned or header checks. Infected mail from whitelisted sender would still be blocked if our policy is to block viruses." If you want to bypass everything, go and check policy banks: ijs.si/software/amavisd/amavisd-new-docs.html#pbanks
    – PiL
    Jun 16, 2010 at 9:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .