From: Travis O. <tr...@ws...> - 2012-05-24 20:04:31
|
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 I get this: [snip] fetchmail: IMAP> A0004 LOGIN "USER" * fetchmail: IMAP< A0004 OK LOGIN Ok. fetchmail: IMAP> A0005 SELECT "/home/USER/.maildir/.spam.missed/" fetchmail: IMAP< A0005 NO Mailbox does not exist, or must be subscribed to. fetchmail: mailbox selection failed fetchmail: IMAP> A0006 LOGOUT fetchmail: IMAP< * BYE Courier-IMAP server shutting down fetchmail: IMAP< A0006 OK LOGOUT completed fetchmail: client/server synchronization error while fetching from US...@do...d fetchmail: 6.3.21 querying domain.tld (protocol IMAP) at Thu May 24 13:21:13 2012: poll completed fetchmail: Query status=7 (ERROR) fetchmail: normal termination, status 7 This is the fetchmailrc file I set up (to not conflict with my main fetchmail file which works fine) == ~/.spamtrainingpoprc == # used by spamassassin to train Bayes poll domain.tld protocol IMAP: user USER with password PASSWORD ================= == system info == OS: gentoo gcc version 4.4.5 (Gentoo 4.4.5 p1.3, pie-0.4.5) fetchmail 6.3.21+RPA+NTLM+SDPS+SSL+NLS courier-imap-4.5.0 ================= Any thoughts? Thank you in advance. -- Travis |
From: Rob M. <rob...@gm...> - 2012-05-24 23:59:27
|
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). -- Please keep list traffic on the list. Rob MacGregor Whoever fights monsters should see to it that in the process he doesn't become a monster. Friedrich Nietzsche |
From: Travis O. <tr...@ws...> - 2012-05-25 01:49:05
|
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. -- T |
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> |