Solved

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

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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

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,…
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…
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…
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.

749 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