Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2004-09-22
2
Medium Priority
?
836 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

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
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 how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses

597 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