?
Solved

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

Posted on 2004-09-22
2
Medium Priority
?
828 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Accepted Solution

by:
LieutenantLefsa earned 2000 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

Quick Start: DOCKER

Sometimes you just need a Quick Start on a topic in order to begin using it.. this is just what you need to know to get up and running with Docker!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month15 days, 1 hour left to enroll

770 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