Setting up Global spam filtering using 'plus addressing'
There are two ways to setup Global spam filtering.
One approach is to setup server side filters on each user account telling the server to move the email marked as "spam" into a "Spam" folder. This would require individually touching each user account and could result in a lot of intial work and long-term maintenance.
Another approach is to have a single global policy in place to do the filtering. Plus Addressing can be used to accomplish this task.
Plus addressing is the practice of adding an extension to the username of an email address for the purpose of filing incoming messages automatically. It can be used when subscribing to a mailing list, for example, when you want all mail from that list to arrive directly in a folder set aside for those messages.
In the following example, the user's real email address is 'jerry@example.net'. The user subscribes to a mailing list and wants all mail from that list filed into a folder called 'listmail'. The user uses this email address instead of the real one:
jerry+listmail@example.net
The user's server will recognize the user's name and where to put this message. It will be filed in the user's subfolder called 'listmail' if it exists. If there is no such folder, it will simply be delivered to the user's INBOX.
Leveraging that feature for spam control is easy with the Insight Server.
Edit: /opt/insight/etc/amavisd.conf
locate the following line: @addr_extension_spam_maps = ('spam');
Change 'spam' to whatever you want to name the target spam folder. Note: 'spam' is not the same as 'Spam'. Avoid spaces and characters that are not valid in an email address.
Add this line to the file: $recipient_delimiter = +
Save the file and restart amavisd: # /opt/insight/etc/rc/amavisd restart
Configure postfix for plus addressing as described here: http://www.bynari.net/esupport/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=200070
Ensure that each user has a 'spam' folder under their INBOX, and adjust the ACL on that folder to allow 'anyone' to post to it:
# su cyrus $ export PATH=/opt/insight/bin:/opt/insight/sbin:$PATH $ export LD_LIBRARY_PATH=/opt/insight/lib:$LD_LIBRARY_PATH $ cyradm -u manager localhost <enter manager password>
Any spam addressed to 'jerry@example.net' will be flagged as spam. The address will be rewritten to 'jerry+spam@example.net' and delivered directly to the user's spam folder without user-level involvement.