spamassassin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [SpamAssassin Wiki] Updated: RemoteImapFolder
Date Thu, 26 Aug 2004 19:18:04 GMT
   Date: 2004-08-26T12:18:04
   Editor: CraigHughes <>
   Wiki: SpamAssassin Wiki
   Page: RemoteImapFolder

   no comment

Change Log:

@@ -21,7 +21,9 @@
 I use SpamAssassin to filter mail as it comes through my MTA, before it hands the mail off
to my Cyrus IMAP server.  I wanted to provide my users a way to drag false-positives and false-negatives
from their Junk Mail or Inbox to another folder or folders.  The mail should be picked up
from that folder, learned, and then re-deposited in the "corrrect" folder, either inbox for
learned-ham or junk-mail for learned-spam.  For false-positives which had previously been
marked up as spam, the SpamAssassin markup should be removed so the "clean" message winds
up in the inbox.  In the end, this turns out to be a single-line fetchmail script for each
-{{{/usr/bin/fetchmail -a -s -n -p IMAP --folder 'INBOX.Learn Spam' -m 'bash -c "/usr/bin/tee
>(/usr/bin/sa-learn --spam --single > /dev/null)|/usr/bin/spamc|/usr/lib/cyrus-imapd/deliver
-/usr/bin/fetchmail -a -s -n -p IMAP --folder 'INBOX.Learn Ham' -m 'bash -c "/usr/bin/tee
>(/usr/bin/sa-learn --ham --single > /dev/null)|/usr/bin/spamassassin -d|/usr/lib/cyrus-imapd/deliver
+{{{/usr/bin/fetchmail -a -s -n -p IMAP --folder 'INBOX.Learn Spam' -m 'bash -c "/usr/bin/tee
>(/usr/bin/sa-learn --spam --single \
+                 > /dev/null)|/usr/bin/spamc|/usr/lib/cyrus-imapd/deliver $LOGNAME"'
+/usr/bin/fetchmail -a -s -n -p IMAP --folder 'INBOX.Learn Ham' -m 'bash -c "/usr/bin/tee
>(/usr/bin/sa-learn --ham --single \
+                 > /dev/null)|/usr/bin/spamassassin -d|/usr/lib/cyrus-imapd/deliver $LOGNAME"'}}}
 If you're using something other than Cyrus, adjust the delivery step accordingly.  Also,
beware of message delivery deduplication on the server -- you might lose mail if you have
de-duping turned on, and because of learning the same message ends up delivered twice.  I
have those 2 lines in a cronjob which runs every 5 minutes.  Now if spam arrives in my inbox,
I just drag it to "Learn Junk" folder.  It'll end up in my Junk Mail folder after fetchmail
picks it up, passes it to sa-learn, then re-delivers it to cyrus tagged as spam (where a sieve
script in cyrus will then file it into the right folder).  For ham in my Junk Mail folder,
I drag to "Learn Ham" and it'll be learned, cleaned, then deposited to my Inbox.

View raw message