dovecot-1.1: Maildir: If POP3 UIDL field is empty in dovecot-uid...

dovecot at dovecot.org dovecot at dovecot.org
Thu Dec 18 19:34:55 EET 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/4152cda041de
changeset: 8055:4152cda041de
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Dec 18 19:34:35 2008 +0200
description:
Maildir: If POP3 UIDL field is empty in dovecot-uidlist, use base filename as UIDL.

diffstat:

1 file changed, 10 insertions(+), 1 deletion(-)
src/lib-storage/index/maildir/maildir-mail.c |   11 ++++++++++-

diffs (21 lines):

diff -r 7e8a0ab1e0bc -r 4152cda041de src/lib-storage/index/maildir/maildir-mail.c
--- a/src/lib-storage/index/maildir/maildir-mail.c	Thu Dec 18 18:11:00 2008 +0200
+++ b/src/lib-storage/index/maildir/maildir-mail.c	Thu Dec 18 19:34:35 2008 +0200
@@ -431,7 +431,16 @@ maildir_mail_get_special(struct mail *_m
 	} else if (field == MAIL_FETCH_UIDL_BACKEND) {
 		uidl = maildir_uidlist_lookup_ext(mbox->uidlist, _mail->uid,
 					MAILDIR_UIDLIST_REC_EXT_POP3_UIDL);
-		*value_r = uidl != NULL ? uidl : "";
+		if (uidl == NULL) {
+			/* use the default */
+			*value_r = "";
+		} else if (*uidl == '\0') {
+			/* special optimization case: use the base file name */
+			return maildir_mail_get_special(_mail,
+					MAIL_FETCH_UIDL_FILE_NAME, value_r);
+		} else {
+			*value_r = uidl;
+		}
 		return 0;
 	}
 


More information about the dovecot-cvs mailing list