Next revision | Previous revisionNext revisionBoth sides next revision |
howto:spamd [2010/02/24 23:56] – created digitalman | howto:spamd [2010/03/17 11:06] – digitalman |
---|
====== Use SpamAssassin Server with the Synchronet Mail Server ====== | ====== Use SpamAssassin with the Synchronet Mail Server ====== |
FIXME | |
| The Synchronet [[:server:mail|SMTP Server]] may use a SpamAssassin server ([[http://spamassassin.apache.org/full/3.1.x/doc/spamd.html|spamd]]) to rate received messages and tag or even reject them based on the results. |
| |
| ===== Installation ===== |
| |
| When installing SpamAssassin, make sure you enable the enabled the spamd (daemon). |
| |
| ==== Windows ==== |
| |
| Apparently, [[http://wiki.apache.org/spamassassin/SpamdOnWindows|it is possible]] to run ''spamd'' on Windows, but *nix OSes are much preferred. |
| |
| ==== Linux ==== |
| |
| On some Linux distributions, you may enable the SpamAssassin daemon (spamd) using ''chkconfig'' command: |
| |
| chkconfig --add spamassassin |
| |
| |
| On some Linux distributions, you may start/stop/query the SpamAssasin daemon (spamd) using the ''service'' command: |
| |
| service spamassasin start |
| |
| Or by directly executing the init script: |
| |
| /etc/init.d/spamassassin start |
| |
| |
| Don't forget to create a daily cron job to update your SpamAssasin database: |
| |
| <file /etc/cron.daily/sa-update> |
| sa-update && /etc/init.d/spamassassin restart |
| </file> |
| |
| ===== Configuration ===== |
| |
| Synchronet comes with a [[:module:spamc|JavaScript implementation]] of the SpamAssassin spamd client (''spamc''). |
| |
| To enable this client as a Synchronet //External Mail Processor//, edit your ''[[dir:ctrl]]/[[config:mailproc.ini]]'' file, adding the following section (if it's not already there): |
| <file mailproc.ini> |
| [SPAMC] |
| Command=spamc.js |
| AccessRequirements=user equal 0 or guest |
| ProcessSpam=false |
| ProcessDNSBL=false |
| Disabled=false |
| </file> |
| |
| The ''AccessRequirements'' key value above tells the Synchronet Mail Server not to execute this mail processor for unauthenticated clients (''user equal 0'') or for the //Guest// user account, if there is one. |
| |
| The ''ProcessSpam'' and ''ProcessDNSBL'' options tell the Synchronet Mail Server not to execute this mail processor if the message was received from a [[:config:spamblock.cfg|SPAM-blocked]] or [[:config:dns_blacklist.cfg|DNS-Blacklisted]] sender. |
| |
| ==== Command Line ==== |
| |
| The Synchronet [[:module:spamc]] module supports some of the same command line options as the SpamAssassin ''spamc'' program and these may be included in the ''Command'' key value included in the ''[SPAMC]'' section of your ''[[config:mailproc.ini]]'' file: |
| |
| ^Option ^Usage ^Description^ |
| |d |''-d //address//'' |Specify IP address of ''spamd'' host (default: ''127.0.0.1'')| |
| |p |''-p //port//'' |Specify the TCP port number of the ''spamd'' server (default: 783)| |
| |u |''-u //username//''|Specify the user-id that ''spamd'' should run as| |
| |s |''-s //bytes//'' |Specify the maximum message size (in bytes) that ''spamc'' will attempt to process (default: 500000)| |
| |
| In addition, the Synchronet [[:module:spamc]] supports the following command line options: |
| |
| ^Option ^Usage ^Description^ |
| |spamonly |''spamonly'' |Modify SPAM messages only (default: modify all messages)| |
| |reject |''reject //level//''|Reject SPAM messages over specified score threshold, modify and pass-through HAM| |
| |debug |''debug'' |Enable debug log output| |
| |
| === Examples === |
| |
| Modify and pass-through all messages: |
| Command=spamc.js |
| |
| Modify SPAM messages only, pass-through all: |
| Command=spamc.js spamonly |
| |
| Reject SPAM messages, modify and pass-through HAM: |
| Command=spamc.js reject |
| |
| Reject SPAM messages over specified score threshold (8.0 in this example), modify and pass-through HAM: |
| Command=spamc.js reject 8.0 |
| |
| Reject SPAM messages over specified score threshold (8.0 in this example), modify SPAM, and pass-through HAM and SPAM: |
| Command=spamc.js reject 8.0 spamonly |
| |
===== See Also ===== | ===== See Also ===== |
* [[:server:mail|Mail Server]] | * [[:server:mail|Mail Server]] |
* [[:config:mailproc.ini]] | * [[:config:mailproc.ini]] |
* [[:howto:|HowTo index]] | * [[:howto:|HowTo index]] |
| |
| {{tag>antispam email spam}} |
| |