Solved

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

Posted on 2004-09-22
2
822 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 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

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

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

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
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 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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

688 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