dovecot-2.0: pop3: Added %g = GUID to pop3_uidl_format.

dovecot at dovecot.org dovecot at dovecot.org
Wed Dec 30 01:32:19 EET 2009


details:   http://hg.dovecot.org/dovecot-2.0/rev/0462fcfb809a
changeset: 10539:0462fcfb809a
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Dec 29 18:32:13 2009 -0500
description:
pop3: Added %g = GUID to pop3_uidl_format.

diffstat:

5 files changed, 16 insertions(+), 1 deletion(-)
doc/example-config/conf.d/pop3.conf     |    1 +
src/lib-storage/mail-storage-settings.c |    1 +
src/pop3/pop3-client.c                  |    3 +++
src/pop3/pop3-commands.c                |    9 +++++++++
src/pop3/pop3-common.h                  |    3 ++-

diffs (74 lines):

diff -r 6f67d3ce4ac4 -r 0462fcfb809a doc/example-config/conf.d/pop3.conf
--- a/doc/example-config/conf.d/pop3.conf	Wed Dec 23 17:35:20 2009 -0500
+++ b/doc/example-config/conf.d/pop3.conf	Tue Dec 29 18:32:13 2009 -0500
@@ -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
diff -r 6f67d3ce4ac4 -r 0462fcfb809a src/lib-storage/mail-storage-settings.c
--- a/src/lib-storage/mail-storage-settings.c	Wed Dec 23 17:35:20 2009 -0500
+++ b/src/lib-storage/mail-storage-settings.c	Tue Dec 29 18:32:13 2009 -0500
@@ -311,6 +311,7 @@ static bool mail_storage_settings_check(
 		case 'u':
 		case 'm':
 		case 'f':
+		case 'g':
 			uidl_format_ok = TRUE;
 			break;
 		case '%':
diff -r 6f67d3ce4ac4 -r 0462fcfb809a src/pop3/pop3-client.c
--- a/src/pop3/pop3-client.c	Wed Dec 23 17:35:20 2009 -0500
+++ b/src/pop3/pop3-client.c	Tue Dec 29 18:32:13 2009 -0500
@@ -178,6 +178,9 @@ static enum uidl_keys parse_uidl_keymask
 			case 'f':
 				mask |= UIDL_FILE_NAME;
 				break;
+			case 'g':
+				mask |= UIDL_GUID;
+				break;
 			}
 		}
 	}
diff -r 6f67d3ce4ac4 -r 0462fcfb809a src/pop3/pop3-commands.c
--- a/src/pop3/pop3-commands.c	Wed Dec 23 17:35:20 2009 -0500
+++ b/src/pop3/pop3-commands.c	Tue Dec 29 18:32:13 2009 -0500
@@ -560,6 +560,14 @@ static bool pop3_get_uid(struct client *
 			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
 		{ 'u', NULL, "uid" },
 		{ 'm', NULL, "md5" },
 		{ 'f', NULL, "filename" },
+		{ 'g', NULL, "guid" },
 		{ '\0', NULL, NULL }
 	};
 	struct var_expand_table *tab;
diff -r 6f67d3ce4ac4 -r 0462fcfb809a src/pop3/pop3-common.h
--- a/src/pop3/pop3-common.h	Wed Dec 23 17:35:20 2009 -0500
+++ b/src/pop3/pop3-common.h	Tue Dec 29 18:32:13 2009 -0500
@@ -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"


More information about the dovecot-cvs mailing list