]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
pop3: Added %g = GUID to pop3_uidl_format.
authorTimo Sirainen <tss@iki.fi>
Tue, 29 Dec 2009 23:32:13 +0000 (18:32 -0500)
committerTimo Sirainen <tss@iki.fi>
Tue, 29 Dec 2009 23:32:13 +0000 (18:32 -0500)
--HG--
branch : HEAD

doc/example-config/conf.d/pop3.conf
src/lib-storage/mail-storage-settings.c
src/pop3/pop3-client.c
src/pop3/pop3-commands.c
src/pop3/pop3-common.h

index f422db20a970718e6f8cb9e9744b34e3dedc1c30..a3d6816f0f171dc465c66412bfe8df755718a502 100644 (file)
@@ -27,6 +27,7 @@ protocol pop3 {
   #  %u - Mail's IMAP UID
   #  %m - MD5 sum of the mailbox headers in hex (mbox only)
   #  %f - filename (maildir only)
+  #  %g - Mail's GUID
   #
   # If you want UIDL compatibility with other POP3 servers, use:
   #  UW's ipop3d         : %08Xv%08Xu
index 145af84a51629ead020154716c118da698eb572f..3f5b50066e00c423539d5b7f68c0d356b95aa898 100644 (file)
@@ -311,6 +311,7 @@ static bool mail_storage_settings_check(void *_set, pool_t pool ATTR_UNUSED,
                case 'u':
                case 'm':
                case 'f':
+               case 'g':
                        uidl_format_ok = TRUE;
                        break;
                case '%':
index ecbc3eaa21f052e73fb4b4ebd2569e6ca04025f6..067d7cda1903ebd033d64a39745eb890ec114bcd 100644 (file)
@@ -178,6 +178,9 @@ static enum uidl_keys parse_uidl_keymask(const char *format)
                        case 'f':
                                mask |= UIDL_FILE_NAME;
                                break;
+                       case 'g':
+                               mask |= UIDL_GUID;
+                               break;
                        }
                }
        }
index 056af71cb6e887c219d0b2ac17f0ea7ca6232f95..617baf006af35cd885185043d88e3635501fded3 100644 (file)
@@ -560,6 +560,14 @@ static bool pop3_get_uid(struct client *client, struct cmd_uidl_context *ctx,
                        i_fatal("UIDL: File name not found");
                }
        }
+       if ((client->uidl_keymask & UIDL_GUID) != 0) {
+               if (mail_get_special(ctx->mail, MAIL_FETCH_GUID,
+                                    &tab[4].value) < 0 ||
+                   *tab[4].value == '\0') {
+                       /* broken */
+                       i_fatal("UIDL: Message GUID not found");
+               }
+       }
        var_expand(str, client->mail_set->pop3_uidl_format, tab);
        return FALSE;
 }
@@ -571,6 +579,7 @@ static bool list_uids_iter(struct client *client, struct cmd_uidl_context *ctx)
                { 'u', NULL, "uid" },
                { 'm', NULL, "md5" },
                { 'f', NULL, "filename" },
+               { 'g', NULL, "guid" },
                { '\0', NULL, NULL }
        };
        struct var_expand_table *tab;
index ea16b5eb5983c233b73909c9a1ee286fb37731f6..c201b83e2ae7aa1b37623924d974934234de0ad0 100644 (file)
@@ -5,7 +5,8 @@ enum uidl_keys {
        UIDL_UIDVALIDITY        = 0x01,
        UIDL_UID                = 0x02,
        UIDL_MD5                = 0x04,
-       UIDL_FILE_NAME          = 0x08
+       UIDL_FILE_NAME          = 0x08,
+       UIDL_GUID               = 0x10
 };
 
 #include "lib.h"