diff -urdpNX /usr/share/dontdiff -x debian -x lib-otp dovecot-1.0-test58.vanilla/dovecot-example.conf dovecot-1.0-test58/dovecot-example.conf --- dovecot-1.0-test58.vanilla/dovecot-example.conf 2004-12-15 23:04:08.000000000 +0300 +++ dovecot-1.0-test58/dovecot-example.conf 2004-12-17 13:53:48.000000000 +0300 @@ -450,10 +450,11 @@ protocol pop3 { # %v - Mailbox UIDVALIDITY # %u - Mail UID # %m - MD5 sum of the mailbox headers in hex (mbox only) + # %f - filename (maildir only) # # If you want UIDL compatibility with other POP3 servers, use: # UW's ipop3d : %08Xv%08Xu - # Courier version 0 : (maildir filename, not supported) + # Courier version 0 : %f # Courier version 1 : %u # Courier version 2 : %v-%u # Cyrus (old) : %u diff -urdpNX /usr/share/dontdiff -x debian -x lib-otp dovecot-1.0-test58.vanilla/src/lib-storage/index/index-mail.c dovecot-1.0-test58/src/lib-storage/index/index-mail.c --- dovecot-1.0-test58.vanilla/src/lib-storage/index/index-mail.c 2004-12-15 22:57:00.000000000 +0300 +++ dovecot-1.0-test58/src/lib-storage/index/index-mail.c 2004-12-18 13:27:32.000000000 +0300 @@ -580,6 +580,8 @@ const char *index_mail_get_special(struc index_mail_headers_get_envelope(mail); return data->envelope; case MAIL_FETCH_FROM_ENVELOPE: + case MAIL_FETCH_FILE_NAME: + case MAIL_FETCH_SPECIAL_UIDL: return NULL; case MAIL_FETCH_HEADER_MD5: if (mail_index_lookup_ext(mail->trans->trans_view, data->seq, diff -urdpNX /usr/share/dontdiff -x debian -x lib-otp dovecot-1.0-test58.vanilla/src/lib-storage/index/maildir/maildir-mail.c dovecot-1.0-test58/src/lib-storage/index/maildir/maildir-mail.c --- dovecot-1.0-test58.vanilla/src/lib-storage/index/maildir/maildir-mail.c 2004-08-28 14:23:35.000000000 +0400 +++ dovecot-1.0-test58/src/lib-storage/index/maildir/maildir-mail.c 2004-12-18 13:26:00.000000000 +0300 @@ -145,6 +145,29 @@ static uoff_t maildir_mail_get_virtual_s return index_mail_get_virtual_size(_mail); } +static const char * +maildir_mail_get_special(struct mail *_mail, enum mail_fetch_field field) +{ + struct index_mail *mail = (struct index_mail *)_mail; + enum maildir_uidlist_rec_flag flags; + + if (field == MAIL_FETCH_FILE_NAME || + field == MAIL_FETCH_SPECIAL_UIDL) { + const char *fname = maildir_uidlist_lookup(mail->ibox->uidlist, + mail->mail.uid, &flags); + if (field == MAIL_FETCH_SPECIAL_UIDL) { + char *end = strstr(fname, ":2,"); + + if (end != NULL) + return t_strdup_until(fname, end); + } + + return fname; + } + + return index_mail_get_special(_mail, field); +} + static uoff_t maildir_mail_get_physical_size(struct mail *_mail) { struct index_mail *mail = (struct index_mail *)_mail; @@ -223,7 +246,7 @@ struct mail maildir_mail = { index_mail_get_header, index_mail_get_headers, maildir_mail_get_stream, - index_mail_get_special, + maildir_mail_get_special, index_mail_update_flags, index_mail_expunge }; diff -urdpNX /usr/share/dontdiff -x debian -x lib-otp dovecot-1.0-test58.vanilla/src/lib-storage/mail-storage.h dovecot-1.0-test58/src/lib-storage/mail-storage.h --- dovecot-1.0-test58.vanilla/src/lib-storage/mail-storage.h 2004-12-15 22:54:45.000000000 +0300 +++ dovecot-1.0-test58/src/lib-storage/mail-storage.h 2004-12-18 13:25:01.000000000 +0300 @@ -83,7 +83,9 @@ enum mail_fetch_field { MAIL_FETCH_IMAP_BODYSTRUCTURE = 0x00002000, MAIL_FETCH_IMAP_ENVELOPE = 0x00004000, MAIL_FETCH_FROM_ENVELOPE = 0x00008000, - MAIL_FETCH_HEADER_MD5 = 0x00010000 + MAIL_FETCH_HEADER_MD5 = 0x00010000, + MAIL_FETCH_FILE_NAME = 0x00020000, + MAIL_FETCH_SPECIAL_UIDL = 0x00040000 }; enum mailbox_sync_flags { diff -urdpNX /usr/share/dontdiff -x debian -x lib-otp dovecot-1.0-test58.vanilla/src/pop3/commands.c dovecot-1.0-test58/src/pop3/commands.c --- dovecot-1.0-test58.vanilla/src/pop3/commands.c 2004-12-15 22:50:26.000000000 +0300 +++ dovecot-1.0-test58/src/pop3/commands.c 2004-12-18 13:48:16.000000000 +0300 @@ -483,6 +483,7 @@ static int list_uids_iter(struct client { 'v', NULL }, { 'u', NULL }, { 'm', NULL }, + { 'f', NULL }, { '\0', NULL } }; struct var_expand_table *tab; @@ -512,6 +513,10 @@ static int list_uids_iter(struct client tab[2].value = mail->get_special(mail, MAIL_FETCH_HEADER_MD5); } + if ((uidl_keymask & UIDL_FILE_NAME) != 0) { + tab[3].value = + mail->get_special(mail, MAIL_FETCH_SPECIAL_UIDL); + } str_truncate(str, 0); str_printfa(str, ctx->message == 0 ? "%u " : "+OK %u ", diff -urdpNX /usr/share/dontdiff -x debian -x lib-otp dovecot-1.0-test58.vanilla/src/pop3/common.h dovecot-1.0-test58/src/pop3/common.h --- dovecot-1.0-test58.vanilla/src/pop3/common.h 2004-12-15 22:37:45.000000000 +0300 +++ dovecot-1.0-test58/src/pop3/common.h 2004-12-17 13:35:59.000000000 +0300 @@ -12,7 +12,8 @@ enum client_workarounds { enum uidl_keys { UIDL_UIDVALIDITY = 0x01, UIDL_UID = 0x02, - UIDL_MD5 = 0x04 + UIDL_MD5 = 0x04, + UIDL_FILE_NAME = 0x08 }; extern struct ioloop *ioloop; diff -urdpNX /usr/share/dontdiff -x debian -x lib-otp dovecot-1.0-test58.vanilla/src/pop3/main.c dovecot-1.0-test58/src/pop3/main.c --- dovecot-1.0-test58.vanilla/src/pop3/main.c 2004-12-15 22:52:30.000000000 +0300 +++ dovecot-1.0-test58/src/pop3/main.c 2004-12-17 13:35:38.000000000 +0300 @@ -87,6 +87,9 @@ static enum uidl_keys parse_uidl_keymask case 'm': mask |= UIDL_MD5; break; + case 'f': + mask |= UIDL_FILE_NAME; + break; } } }