From: Matthias A. <mat...@gm...> - 2012-05-26 02:44:18
|
Am 25.05.2012 01:47, schrieb Travis Osterman: > On 05/24/12 17:59, Rob MacGregor wrote: >> On Thu, May 24, 2012 at 7:03 PM, Travis Osterman <tr...@ws...> wrote: >>> Hello, I am trying to use fectchmail to fetch the contents of a folder >>> (.spam.missed/) from my courier-imap server so that I can send the >>> messages to spamassassin's learning program. Using this as a guide: >>> http://wiki.apache.org/spamassassin/SingleUserUnixInstall#Enable_IMAP_LearnAsSpam_folder >>> >>> When I invoke >>> $ /usr/bin/fetchmail -a -v -n --folder /home/USER/.maildir/.spam.missed/ >>> -m '/usr/bin/sa-learn -D --spam' --fetchmailrc /home/USER/.spamtrainingpoprc >> That's not a mailbox path - that's a file system path. Try passing the >> mailbox as the argument (presumably .spam.missed). >> > > I tried that (.spam.missed/) and .spam/.missed/ both with no luck. I > did however spend some more time reading through the man page on > 'sa-learn' which does take the directory as an argument and I can then > delete them. With this solution, I don't need procmail or a saved a > cleartext password (but is dependent on access to cron). > > #!/bin/bash > # spam training > FALSE_NEGS=/home/tosterma/.maildir/.spam.missed/ > sa-learn --spam $FALSE_NEGS > /dev/null 2>&1 > rm -f $FALSE_NEGS/new/* > rm -f $FALSE_NEGS/cur/* > > Still not sure why it didn't like that directory. IMAP folder naming depends on how the IMAP server maps the IMAP folder names to directory names in the file system, and possibly how the "namespace" and/or separator is configured. _If_ your .maildir is actually a Maildir format, with cur/tmp/new sub directories, and .spam.missed is one, too, then the name will likely be either of: spam.missed INBOX.spam.missed spam/missed Because a subfolder "foo" in Maildir structures is named Maildir/.foo according to a convention understood by IMAP servers such as Courier-IMAP and Dovecot. <http://www.inter7.com/courierimap/README.maildirquota.html> |