Skip to content
Permalink
Browse files

uidlformat config option - allow UIDLs like Dovecot or Courier

  • Loading branch information
brong committed Oct 13, 2015
1 parent 0ec13dd commit 8a635a0c5133de621382efe1b3b5497f9f9d2daf
Showing with 31 additions and 4 deletions.
  1. +25 −4 imap/pop3d.c
  2. +6 −0 lib/imapoptions
@@ -1242,10 +1242,31 @@ int msg_exists_or_err(uint32_t msgno)
void uidl_msg(uint32_t msgno)
{
if (popd_mailbox->i.options & OPT_POP3_NEW_UIDL) {
prot_printf(popd_out, "%u %u.%u\r\n", msgno,
popd_mailbox->i.uidvalidity,
popd_map[msgno-1].uid);
} else {
switch (config_getenum(IMAPOPT_UIDL_FORMAT)) {
case IMAP_ENUM_UIDL_FORMAT_UIDONLY:
prot_printf(popd_out, "%u %u\r\n", msgno,
popd_map[msgno-1].uid);
break;
case IMAP_ENUM_UIDL_FORMAT_CYRUS:
prot_printf(popd_out, "%u %u.%u\r\n", msgno,
popd_mailbox->i.uidvalidity,
popd_map[msgno-1].uid);
break;
case IMAP_ENUM_UIDL_FORMAT_DOVECOT:
prot_printf(popd_out, "%u %08x%08x\r\n", msgno,
popd_map[msgno-1].uid,
popd_mailbox->i.uidvalidity);
break;
case IMAP_ENUM_UIDL_FORMAT_COURIER:
prot_printf(popd_out, "%u %u-%u\r\n", msgno,
popd_mailbox->i.uidvalidity,
popd_map[msgno-1].uid);
break;
default:
abort();
}
}
else {
prot_printf(popd_out, "%u %u\r\n", msgno,
popd_map[msgno-1].uid);
}
@@ -2073,6 +2073,12 @@ product version in the capabilities */
versions of SSL/TLS will need to be added here to allow them to get
disabled. */

{ "uidl_format", "cyrus", ENUM("uidonly", "cyrus", "dovecot", "courier") }
/* Choose the format for UIDLs in pop3. Possible values are "uidonly",
"cyrus", "dovecot" and "courier". "uidonly" forces the old default
of UID, "cyrus" is UIDVALIDITY.UID. Dovecot is 8 digits of leading
hex (lower case) each UID UIDVALIDITY. Courier is UIDVALIDITY-UID. */

{ "umask", "077", STRING }
/* The umask value used by various Cyrus IMAP programs. */

0 comments on commit 8a635a0

Please sign in to comment.
You can’t perform that action at this time.