Solved

Postfix - Amavis-New - Spam Assassin - Razor - ClamAV Gateway Server - Setting up White / Black Lists

Posted on 2004-09-22
2
790 Views
Last Modified: 2008-03-04
Hello,

I have an Email Gateway Server running RedHat 9 with the latest versions of Postfix/amavis/SpamAssassin/ClamAV and Razor installed. All its being used for is to Spam and Virus check static SMTP routes before it reaches its final detination mail server.

It hosts multiple domains going to multiple detination IP addresses.

Basically what i need todo is setup White / Black Lists per domain. So for each domain we host they have there own white and black list. Ive looked everywhere for documents on how to set this up but ive been unlucky. I also need to know how to forward spam for each domain to their own Spam Box.

I know this can be done somehow as i use it in Cpanel.

Could someone please help me out.

Thanks

Dan.
0
Comment
Question by:DClayden
2 Comments
 
LVL 1

Accepted Solution

by:
LieutenantLefsa earned 500 total points
ID: 12170929
You can set up white/black listing per recipient domain in amavisd.conf. Look at the end of Section V for ENVELOPE SENDER WHITELISTING / BLACKLISTING - PER-RECIPIENT.

Set up entries like this:

$per_recip_blacklist_sender_lookup_tables = {
'.sub1.example.com' => read_hash({},'/var/amavis/sub1-blacklist.txt'),
'.sub2.example.com' => read_hash({},'/var/amavis/sub2-blacklist.txt')
};
$per_recip_whitelist_sender_lookup_tables = {
'.sub1.example.com' => read_hash({},'/var/amavis/sub1-whitelist.txt'),
'.sub2.example.com' => read_hash({},'/var/amavis/sub2-whiltelist.txt')
};

Then create /var/amavis/sub1-blacklist.txt, /var/amavis/sub2-blacklist.txt, etc. These files take one address per line, comments start with #.
For example, in /var/amavis/sub1-blacklist.txt:
spammer@spamcity.com
anotherspammer@timbuk.tu      # this is a comment

To forward spam to each domain's own spam box, look in amavisd.conf Section IV for the spam_quarantine_to directive. Use something like this:

$spam_quarantine_to = new_RE(                             # per-recip multiple quarantines
  [qr'^.*@sub1\.example\.com$'i => 'spam-box@sub1.example.com'],
  [qr'^.*@sub2\.example\.com$'i => 'spam-box@sub2.example.com'],
  [qr/.*/                                => 'all-other-spam@example.com']
);

You may also want to set up the $virus_quarantine_to directive in a similar way.

Adjust paths and filenames to suit, and don't forget to "amavisd reload" after making config changes.
0
 
LVL 1

Author Comment

by:DClayden
ID: 12225584
Thanks for your comment. Im just trying it out now. If i wanted all-other-spam to be deleted how would i do that?

Thanks for your help! I hope it all works.

Cheers

Dan.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now