Greetings!
For years I've been checking my e-mail account directly via ssh, but I
recently found two excuses to use fetchmail. Firstly, it turned out
extremely useful for debugging during the set-up of SSL IMAP and POP-3
servers, and just today I discovered that gkrellm works beautifully in
conjunction with fetchmail -c. Which brings me to my question ...
I have multiple mbox-format inboxes, but I have mutt set up with the
save_empty option disable, so that if an inbox is empty, it gets
removed, rather than left as a zero-byte file. I like this because it
avoids cluttering up my inbox list.
Unfortunately, if I include any of these possibly non-existent inboxes
in my .fetchmailrc, e.g.
...
folder mail/inboxes/MAIN
mail/inboxes/maybe-not-there1
mail/inboxes/maybe-not-there2
as soon as fetchmail tries to EXAMINE a folder which isn't there, the
following happens:
fetchmail: IMAP< A0006 NO EXAMINE failed: Can't open mailbox
mail/inboxes/not-there: no such mailbox
fetchmail: mailbox selection failed
fetchmail: IMAP> A0007 LOGOUT
fetchmail: IMAP< * BYE <myserver> IMAP4rev1 server terminating connection
fetchmail: IMAP< A0007 OK LOGOUT completed
fetchmail: client/server synchronization error while fetching from <myserver>
fetchmail: normal termination, status 7
This is clearly due to the following chunk of code in imap.c:
ok = gen_transact(sock,
check_only ? "EXAMINE \"%s\"" : "SELECT \"%s\"",
folder ? folder : "INBOX");
if (ok != 0)
{
report(stderr, _("mailbox selection failed\n"));
return(ok);
}
Would it be possible to make fetchmail more robust in this situation,
and just treat it in the same way as it would an empty folder? This
would be a very worthwhile option IMHO.
Last but not least, thanks for all the great work; fetchmail oozes
quality :-)
--
Adam Spiers -=- musician & hacker -=- adam(_at_)spiers(_dot_)net -=-
http://tigerpig.org/
echo '$_=bless[q]]],q;_;;sub
s;{local$_=shift;push(_at_)$_,++$0,pop(@$_).$s;;$_}($,
=eval((join"\$_->[",qw)Just Another Perl Hacker)).q)$_->[1]]]])))=~s~((?<=.(?{
++$*})))?_::~$*&&$"~egx,print""=>""=>'|perl -ln0e';s;s\;;_::AUTOLOAD$1;g;eval'