From 366eb7b3a91d53282f0b1007913a55be236a322e Mon Sep 17 00:00:00 2001
From: "Eric S. Raymond"
Date: Thu, 26 Dec 2002 22:06:03 +0000
Subject: Routine updates, including the latest Shetye patch.
svn path=/trunk/; revision=3778
---
NEWS | 5 +++++
driver.c | 37 ++++++++++++++-----------------------
etrn.c | 1 +
fetchmail-FAQ.html | 12 ++----------
fetchmail.h | 2 ++
fetchmailconf | 7 -------
imap.c | 46 +++++++++++++---------------------------------
indexgen.sh | 4 ++--
odmr.c | 1 +
pop2.c | 1 +
pop3.c | 32 +++++++++++++++++++++++++++++++-
11 files changed, 72 insertions(+), 76 deletions(-)
diff --git a/NEWS b/NEWS
index 79eb4878..6f57b4b1 100644
--- a/NEWS
+++ b/NEWS
@@ -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
diff --git a/driver.c b/driver.c
index 794d04c8..4a4f4d3f 100644
--- a/driver.c
+++ b/driver.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)
{
diff --git a/etrn.c b/etrn.c
index 7f5e882d..2a25f942 100644
--- a/etrn.c
+++ b/etrn.c
@@ -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
To Site
Map |
-$Date: 2002/11/12 17:40:07 $ |
+$Date: 2002/12/26 22:06:03 $ |
@@ -110,7 +110,6 @@ host?.
S12. How can I use fetchmail with MailMax?
S13. How can I use fetchmail with Novell GroupWise?
S14. How can I use fetchmail with InterChange?
-S15. How can I use fetchmail with www.gmx.de?
How to set up well-known security and authentication
methods:
@@ -2000,13 +1999,6 @@ them on TOP or RETR.
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.
-
-
-You can't, not reliably anyway. The GMX StreamProxy server behaves
-badly on authentication failures, sending back a non-conformant error
-message (missing an -ERR
tag) that confuses
-fetchmail.
-
@@ -3470,7 +3462,7 @@ dns errors.
Page
To Site
Map |
-$Date: 2002/11/12 17:40:07 $ |
+$Date: 2002/12/26 22:06:03 $ |
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
@@ -1285,13 +1285,6 @@ Its response to RETR is normal, so use the `fetchall' option.
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 -ERR
tag)
-that confuses fetchmail. Use IMAP.
-
"""
if string.find(greetline, "OpenMail") > 0:
warnings = warnings + """
diff --git a/imap.c b/imap.c
index 732141d8..3ea5c27d 100644
--- a/imap.c
+++ b/imap.c
@@ -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 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 */
};
--
cgit v1.2.3