This is a discussion on RE: [courier-users] Spamassasin within the Courier-Imap forums, part of the Mail Servers and Related category; From: Malcolm Weir [mailto:malc@gelt.org] > > From: Pupeno > > > What I'd like to achieve ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
From: Malcolm Weir [mailto:malc@gelt.org]
> > From: Pupeno > > > What I'd like to achieve is to be able to decide on a > > per-account basis to either > > *) mark spam with a header and leave it on inbox (for those > > using pop3). > > *) mark spam with a header and move it to Spam (for those > > using imap), and in this case, I'd set up a cron job to train > > the filter. > > Is that possible ? > > Not really, as written, because one of the neat things of the Courier > system is that (from the system standpoint) at delivery there is no > knowledge of the user agent. > > BUT... You could easily use logic along the lines of > "if-and-only-if there > is a subdirectory called '.Spam' move the offending item to > it", and just > ensure that your IMAP users (and NOT the POP3 ones) get a ".Spam" > subdirectory. > > This could then be used in a global (/etc/courier/maildroprc) > recipe like: > > INBOX="Maildir/" > DEFAULT="$INBOX" > SPAMFLD="$INBOX.Spam/" > > # filter message > xfilter "/usr/bin/spamc" > if ( /^X-Spam-Status: Yes,/) > { > # Check for .Spam folder... > `test -d "$SPAMFLD"` > if( $RETURNCODE == 1 ) > { > DEFAULT="$SPAMFLD" > } > } Or do with .mailfilter files for the imap users. in maildroprc: xfilter "/usr/bin/spamc" ..mailfilter for the imap users: if (/^X-Spam-Status: Yes,/) { to "./Maildir/.Spam/" } Everything will be scanned for spam and marked. If there is a .mailfilter file, it will be run and spam will be delivered to the Spam box. All other mail (regardless of the user) will be delivered to the inbox. This avoids having to spawn a directory existence check for every email. Bowie ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 _______________________________________________ courier-users mailing list courier-users@lists.sourceforge.net Unsubscribe: https://lists.sourceforge.net/lists/.../courier-users |