aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2002-12-26 22:06:03 +0000
committerEric S. Raymond <esr@thyrsus.com>2002-12-26 22:06:03 +0000
commit366eb7b3a91d53282f0b1007913a55be236a322e (patch)
treeeaf93bd4f0af17a32223f3a85ed027e365544acc
parentdf9d522301cbc3e73e9816485f7deb744ae6f373 (diff)
downloadfetchmail-366eb7b3a91d53282f0b1007913a55be236a322e.tar.gz
fetchmail-366eb7b3a91d53282f0b1007913a55be236a322e.tar.bz2
fetchmail-366eb7b3a91d53282f0b1007913a55be236a322e.zip
Routine updates, including the latest Shetye patch.
svn path=/trunk/; revision=3778
-rw-r--r--NEWS5
-rw-r--r--driver.c37
-rw-r--r--etrn.c1
-rw-r--r--fetchmail-FAQ.html12
-rw-r--r--fetchmail.h2
-rwxr-xr-xfetchmailconf7
-rw-r--r--imap.c46
-rwxr-xr-xindexgen.sh4
-rw-r--r--odmr.c1
-rw-r--r--pop2.c1
-rw-r--r--pop3.c32
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</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
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 <Makefile.in "/VERSION *= */s/VERSION *= *\([^ ]*\)/\1/p"`
date=`date "+%d %b %Y"`
diff --git a/odmr.c b/odmr.c
index 6b89ef9c..c007b185 100644
--- a/odmr.c
+++ b/odmr.c
@@ -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 */
};
diff --git a/pop2.c b/pop2.c
index c3f490e6..5b4c2e2c 100644
--- a/pop2.c
+++ b/pop2.c
@@ -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 */
};
diff --git a/pop3.c b/pop3.c
index 7082d94f..a2f7d5f0 100644
--- a/pop3.c
+++ b/pop3.c
@@ -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 */
};