Alexander Zangerl <[EMAIL PROTECTED]> writes: > if you have public imap folders which the server marks > READ-ONLY, then fetchmail will always abort after the SELECT > stage with the message "mailbox selection failed".
[...] > this behaviour is broken, as not being able to delete emails from the > server is fine if the user tells fetchmail to keep messages. > there is no technical reason for fetchmail to assume server failure on > a read-only select result if -k is given. [...] Not quite. The imap_ok() code has too little context to decide that at the moment, and I'm not fixing this for 6.3.X. I'm putting this bug on the 6.4.0 TODO list. The wider context of this problem is: fetchmail needs to set the \Seen flag to avoid redownloading messages, so the requirement is not only -k but "-ka" ("--fetchall --keep") - this seems a rather tight constraint, but we can fix this case nonetheless since it's just two lines of code for 6.2.X and 6.3.X. Given that I as upstream maintainer am no longer able to support 6.2.X, you'll need to live with the 6.3.2-rc4 patch (attached). It fails for NEWS and warns of an offset for imap.c, but should work. My longer-term goal is to have fetchmail 6.4 track the UIDs at the client side, which will remove the "--fetchall" requirement and make "--keep" sufficient. We'll then see the fix of this bug, too. (tagging this bug "upstream confirmed patch" and cloning it as a wishlist item for 6.4) -- Matthias Andree
Index: NEWS =================================================================== --- NEWS (revision 4664) +++ NEWS (working copy) @@ -69,6 +69,8 @@ * Add missing --help text for "--sslcertck" option. * fetchmailconf.py: Accept --help and --version. * fetchmail --version now prints the copyright notice. +* don't complain about READ-ONLY IMAP folders in --fetchall --keep mode. + Reported Alexander Zangerl, Debian Bug#348964. fetchmail 6.3.1 (released 2005-12-19): Index: imap.c =================================================================== --- imap.c (revision 4630) +++ imap.c (working copy) @@ -697,6 +697,11 @@ ok = gen_transact(sock, check_only ? "EXAMINE \"%s\"" : "SELECT \"%s\"", folder ? folder : "INBOX"); + /* imap_ok returns PS_LOCKBUSY for READ-ONLY folders, + * which we can safely use in fetchall keep only */ + if (ok == PS_LOCKBUSY && ctl->fetchall && ctl-> keep) + ok = 0; + if (ok != 0) { report(stderr, GT_("mailbox selection failed\n"));