diff options
-rw-r--r-- | NEWS | 5 | ||||
-rw-r--r-- | driver.c | 37 | ||||
-rw-r--r-- | etrn.c | 1 | ||||
-rw-r--r-- | fetchmail-FAQ.html | 12 | ||||
-rw-r--r-- | fetchmail.h | 2 | ||||
-rwxr-xr-x | fetchmailconf | 7 | ||||
-rw-r--r-- | imap.c | 46 | ||||
-rwxr-xr-x | indexgen.sh | 4 | ||||
-rw-r--r-- | odmr.c | 1 | ||||
-rw-r--r-- | pop2.c | 1 | ||||
-rw-r--r-- | pop3.c | 32 |
11 files changed, 72 insertions, 76 deletions
@@ -2,6 +2,11 @@ (The `lines' figures total .c, .h, .l, and .y files under version control.) +* Updated German, Turkish, Spanish, and Danish translation files. +* Integrated Sunil Shetye's patch to make mark_seen an explicit method. +* Removed FAQ warning about GMX and associated fetchmailconf check, + we have a report that its servers are conformant now. + fetchmail-6.2.0 (Fri Dec 13 00:10:07 EST 2002), 22235 lines: * Applied Steffen Esser's fix for a buffer-overflow bug in rfc822.c @@ -655,25 +655,6 @@ static int fetch_messages(int mailserver_socket, struct query *ctl, * now. */ - /* - * Tell the UID code we've seen this. - * Matthias Andree: only register the UID if we could actually - * forward this mail. If we omit this !suppress_delete check, - * fetchmail will never retry mail that the local listener - * refused temporarily. - */ - if (ctl->newsaved && !suppress_delete) - { - struct idlist *sdp; - - for (sdp = ctl->newsaved; sdp; sdp = sdp->next) - if ((sdp->val.status.num == num) && (msgcodes[num-1] >= 0)) - { - sdp->val.status.mark = UID_SEEN; - save_str(&ctl->oldsaved, sdp->id,UID_SEEN); - } - } - /* maybe we delete this message now? */ if (retained) { @@ -690,11 +671,10 @@ static int fetch_messages(int mailserver_socket, struct query *ctl, err = (ctl->server.base_protocol->delete)(mailserver_socket, ctl, num); if (err != 0) return(err); -#ifdef POP3_ENABLE - delete_str(&ctl->newsaved, num); -#endif /* POP3_ENABLE */ } - else if ( (outlevel >= O_VERBOSE) || + else + { + if ( (outlevel >= O_VERBOSE) || /* To avoid flooding the syslog when using --keep, * report "Skipped message" only when: * 1) --verbose is on, or @@ -706,6 +686,17 @@ static int fetch_messages(int mailserver_socket, struct query *ctl, ) report_complete(stdout, GT_(" not flushed\n")); + /* maybe we mark this message as seen now? */ + if (ctl->server.base_protocol->mark_seen + && !suppress_delete + && (msgcodes[num-1] >= 0 && ctl->keep)) + { + err = (ctl->server.base_protocol->mark_seen)(mailserver_socket, ctl, num); + if (err != 0) + return(err); + } + } + /* perhaps this as many as we're ready to handle */ if (maxfetch && maxfetch <= *fetches && *fetches < count) { @@ -140,6 +140,7 @@ const static struct method etrn = NULL, /* no way to fetch body */ NULL, /* no message trailer */ NULL, /* how to delete a message */ + NULL, /* how to mark a message as seen */ etrn_logout, /* log out, we're done */ FALSE, /* no, we can't re-poll */ }; diff --git a/fetchmail-FAQ.html b/fetchmail-FAQ.html index d1e86088..3fc90472 100644 --- a/fetchmail-FAQ.html +++ b/fetchmail-FAQ.html @@ -16,7 +16,7 @@ content="Frequently asked questions about fetchmail."/> Page</a></td> <td width="30%" align="center">To <a href="/~esr/sitemap.html">Site Map</a></td> -<td width="30%" align="right">$Date: 2002/11/12 17:40:07 $</td> +<td width="30%" align="right">$Date: 2002/12/26 22:06:03 $</td> </tr> </table> @@ -110,7 +110,6 @@ host?.</a><br/> <a href="#S12">S12. How can I use fetchmail with MailMax?</a><br/> <a href="#S13">S13. How can I use fetchmail with Novell GroupWise?</a><br/> <a href="#S14">S14. How can I use fetchmail with InterChange?</a><br/> -<a href="#S15">S15. How can I use fetchmail with www.gmx.de?</a><br/> <h1>How to set up well-known security and authentication methods:</h1> @@ -2000,13 +1999,6 @@ them on TOP or RETR.</p> me that their new 3.61.08 release of InterChange fixes this problem. I don't have any reports one way or the other yet.</p> -<h2><a id="S15" name="S15">S15. How can I use fetchmail with www.gmx.de?</a></h2> - -<p>You can't, not reliably anyway. The GMX StreamProxy server behaves -badly on authentication failures, sending back a non-conformant error -message (missing an <code>-ERR</code> tag) that confuses -fetchmail.</p> - <hr/> <h2><a id="K1" name="K1">K1. How can I use fetchmail with SOCKS?</a></h2> @@ -3470,7 +3462,7 @@ dns errors.</p> Page</a></td> <td width="30%" align="center">To <a href="/~esr/sitemap.html">Site Map</a></td> -<td width="30%" align="right">$Date: 2002/11/12 17:40:07 $</td> +<td width="30%" align="right">$Date: 2002/12/26 22:06:03 $</td> </tr> </table> diff --git a/fetchmail.h b/fetchmail.h index 4367d845..309e611c 100644 --- a/fetchmail.h +++ b/fetchmail.h @@ -191,6 +191,8 @@ struct method /* describe methods for protocol state machine */ /* eat trailer of a message */ int (*delete)(int, struct query *, int); /* delete method */ + int (*mark_seen)(int, struct query *, int); + /* mark as seen method */ int (*logout_cmd)(int, struct query *); /* logout command */ flag retry; /* can getrange poll for new messages? */ diff --git a/fetchmailconf b/fetchmailconf index 4ce4a319..a6c3d172 100755 --- a/fetchmailconf +++ b/fetchmailconf @@ -1286,13 +1286,6 @@ You appear to be using geonet. As of late 2002, the TOP command on geonet's POP3 is broken. Use the fetchall option. """ - if string.find(greetline, "GMX POP3 StreamProxy") > 0: - warnings = warnings + """ -The GMX POP3 server behaves badly on authentication failures, sending -back a non-conformant error message (missing an <code>-ERR</code> tag) -that confuses fetchmail. Use IMAP. - -""" if string.find(greetline, "OpenMail") > 0: warnings = warnings + """ You appear to be using some version of HP OpenMail. Many versions of @@ -876,11 +876,6 @@ static int imap_fetch_body(int sock, struct query *ctl, int number, int *lenp) * craps out during the message, it will still be marked `unseen' on * the server. * - * However...*don't* do this if we're using keep to suppress deletion! - * In that case, marking the seen flag is the only way to prevent the - * message from being re-fetched on subsequent runs (and according - * to RFC2060 p.43 this fetch should set Seen as a side effect). - * * According to RFC2060, and Mark Crispin the IMAP maintainer, * FETCH %d BODY[TEXT] and RFC822.TEXT are "functionally * equivalent". However, we know of at least one server that @@ -898,17 +893,11 @@ static int imap_fetch_body(int sock, struct query *ctl, int number, int *lenp) switch (imap_version) { case IMAP4rev1: /* RFC 2060 */ - if (!ctl->keep) - gen_send(sock, "FETCH %d BODY.PEEK[TEXT]", number); - else - gen_send(sock, "FETCH %d BODY[TEXT]", number); + gen_send(sock, "FETCH %d BODY.PEEK[TEXT]", number); break; case IMAP4: /* RFC 1730 */ - if (!ctl->keep) - gen_send(sock, "FETCH %d RFC822.TEXT.PEEK", number); - else - gen_send(sock, "FETCH %d RFC822.TEXT", number); + gen_send(sock, "FETCH %d RFC822.TEXT.PEEK", number); break; default: /* RFC 1176 */ @@ -958,26 +947,6 @@ static int imap_trail(int sock, struct query *ctl, int number) /* UW IMAP returns "OK FETCH", Cyrus returns "OK Completed" */ if (strstr(buf, "OK")) break; - -#ifdef __UNUSED__ - /* - * Any IMAP server that fails to set Seen on a BODY[TEXT] - * fetch violates RFC2060 p.43 (top). This becomes an issue - * when keep is on, because seen messages aren't deleted and - * get refetched on each poll. As a workaround, if keep is on - * we can set the Seen flag explicitly. - * - * This code isn't used yet because we don't know of any IMAP - * servers broken in this way. - */ - if (ctl->keep) - if ((ok = gen_transact(sock, - imap_version == IMAP4 - ? "STORE %d +FLAGS.SILENT (\\Seen)" - : "STORE %d +FLAGS (\\Seen)", - number))) - return(ok); -#endif /* __UNUSED__ */ } return(PS_SUCCESS); @@ -1022,6 +991,16 @@ static int imap_delete(int sock, struct query *ctl, int number) return(PS_SUCCESS); } +static int imap_mark_seen(int sock, struct query *ctl, int number) +/* mark the given message as seen */ +{ + return(gen_transact(sock, + imap_version == IMAP4 + ? "STORE %d +FLAGS.SILENT (\\Seen)" + : "STORE %d +FLAGS (\\Seen)", + number)); +} + static int imap_logout(int sock, struct query *ctl) /* send logout command */ { @@ -1059,6 +1038,7 @@ const static struct method imap = imap_fetch_body, /* request given message body */ imap_trail, /* eat message trailer */ imap_delete, /* delete the message */ + imap_mark_seen, /* how to mark a message as seen */ imap_logout, /* expunge and exit */ TRUE, /* yes, we can re-poll */ }; diff --git a/indexgen.sh b/indexgen.sh index 37e3fb06..7917b501 100755 --- a/indexgen.sh +++ b/indexgen.sh @@ -2,8 +2,8 @@ # # indexgen.sh -- generate current version of fetchmail home page. # -goldvers="6.1.0" -goldname="6.1.0" +goldvers="6.2.0" +goldname="6.2.0" version=`sed -n <Makefile.in "/VERSION *= */s/VERSION *= *\([^ ]*\)/\1/p"` date=`date "+%d %b %Y"` @@ -229,6 +229,7 @@ const static struct method odmr = NULL, /* no way to fetch body */ NULL, /* no message trailer */ NULL, /* how to delete a message */ + NULL, /* how to mark a message as seen */ odmr_logout, /* log out, we're done */ FALSE, /* no, we can't re-poll */ }; @@ -146,6 +146,7 @@ const static struct method pop2 = NULL, /* no way to fetch body alone */ pop2_trail, /* eat message trailer */ NULL, /* no POP2 delete method */ + NULL, /* how to mark a message as seen */ pop2_logout, /* log out, we're done */ FALSE, /* no, we can't re-poll */ }; @@ -792,11 +792,40 @@ static int pop3_fetch(int sock, struct query *ctl, int number, int *lenp) return(PS_SUCCESS); } +static void mark_uid_seen(struct query *ctl, int number) +/* Tell the UID code we've seen this. */ +{ + if (ctl->newsaved) + { + struct idlist *sdp; + + for (sdp = ctl->newsaved; sdp; sdp = sdp->next) + if (sdp->val.status.num == number) + { + sdp->val.status.mark = UID_SEEN; + save_str(&ctl->oldsaved, sdp->id,UID_SEEN); + } + } +} + static int pop3_delete(int sock, struct query *ctl, int number) /* delete a given message */ { + int ok; + mark_uid_seen(ctl, number); /* actually, mark for deletion -- doesn't happen until QUIT time */ - return(gen_transact(sock, "DELE %d", number)); + ok = gen_transact(sock, "DELE %d", number); + if (ok != PS_SUCCESS) + return(ok); + delete_str(&ctl->newsaved, number); + return(PS_SUCCESS); +} + +static int pop3_mark_seen(int sock, struct query *ctl, int number) +/* mark a given message as seen */ +{ + mark_uid_seen(ctl, number); + return(PS_SUCCESS); } static int pop3_logout(int sock, struct query *ctl) @@ -856,6 +885,7 @@ const static struct method pop3 = NULL, /* no way to fetch body alone */ NULL, /* no message trailer */ pop3_delete, /* how to delete a message */ + pop3_mark_seen, /* how to mark a message as seen */ pop3_logout, /* log out, we're done */ FALSE, /* no, we can't re-poll */ }; |