aboutsummaryrefslogtreecommitdiffstats
path: root/imap.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 /imap.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 'imap.c')
-rw-r--r--imap.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/imap.c b/imap.c
index 3234b3b5..f1d5a225 100644
--- a/imap.c
+++ b/imap.c
@@ -620,6 +620,19 @@ static int imap_delete(int sock, struct query *ctl, int number)
return(PS_SUCCESS);
}
+static flag imap_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 imap =
{
"IMAP", /* Internet Message Access Protocol */
@@ -636,6 +649,7 @@ const static struct method imap =
imap_fetch_body, /* request given message body */
imap_trail, /* eat message trailer */
imap_delete, /* delete the message */
+ imap_retain_check, /* leave this message alone? */
"LOGOUT", /* the IMAP exit command */
};