aboutsummaryrefslogtreecommitdiffstats
path: root/pop3.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1997-08-07 19:24:53 +0000
committerEric S. Raymond <esr@thyrsus.com>1997-08-07 19:24:53 +0000
commit192bcbb0ddce0d8737923c7bb41c5b836a357458 (patch)
treed6903f1067294f2bb8d6e954daea46730e0ffb9e /pop3.c
parent590d575e53ec9818122c124d5765b6343765776a (diff)
downloadfetchmail-192bcbb0ddce0d8737923c7bb41c5b836a357458.tar.gz
fetchmail-192bcbb0ddce0d8737923c7bb41c5b836a357458.tar.bz2
fetchmail-192bcbb0ddce0d8737923c7bb41c5b836a357458.zip
Deal with X-IMAP header properly.
svn path=/trunk/; revision=1244
Diffstat (limited to 'pop3.c')
-rw-r--r--pop3.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/pop3.c b/pop3.c
index 59f1da7e..e5e26299 100644
--- a/pop3.c
+++ b/pop3.c
@@ -342,6 +342,19 @@ static int pop3_delete(int sock, struct query *ctl, int number)
return(gen_transact(sock, "DELE %d", number));
}
+static flag pop3_retain_check(int num, char *buf)
+/* is this a special message that should be retained? */
+{
+ /*
+ * The University of Washington IMAP server (the reference
+ * implementation of IMAP4 written by Mark Crispin) relies
+ * on being able to keep base-UID information in a special
+ * message at the head of the mailbox. This message should
+ * neither be deleted nor forwarded.
+ */
+ return (num == 1 && !strncasecmp(buf, "X-IMAP:", 7));
+}
+
const static struct method pop3 =
{
"POP3", /* Post Office Protocol v3 */
@@ -358,6 +371,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_retain_check, /* try not to nuke an IMAP4rev header message */
"QUIT", /* the POP3 exit command */
};