dovecot-2.0: imap: Added FETCH X-REAL-UID for getting physical m...

dovecot at dovecot.org dovecot at dovecot.org
Wed May 12 20:47:52 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/ed1a37587471
changeset: 11289:ed1a37587471
user:      Timo Sirainen <tss at iki.fi>
date:      Wed May 12 19:47:49 2010 +0200
description:
imap: Added FETCH X-REAL-UID for getting physical mail's UID in a virtual mailbox.

diffstat:

 src/imap/imap-fetch.c |  19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diffs (36 lines):

diff -r a6150ca30304 -r ed1a37587471 src/imap/imap-fetch.c
--- a/src/imap/imap-fetch.c	Wed May 12 19:47:26 2010 +0200
+++ b/src/imap/imap-fetch.c	Wed May 12 19:47:49 2010 +0200
@@ -814,6 +814,24 @@
 	return TRUE;
 }
 
+static int fetch_x_real_uid(struct imap_fetch_context *ctx, struct mail *mail,
+			    void *context ATTR_UNUSED)
+{
+	str_printfa(ctx->cur_str, "X-REAL-UID %u ",
+		    mail_get_real_mail(mail)->uid);
+	return 1;
+}
+
+static bool
+fetch_x_real_uid_init(struct imap_fetch_context *ctx ATTR_UNUSED,
+		      const char *name,
+		      const struct imap_arg **args ATTR_UNUSED)
+{
+	imap_fetch_add_handler(ctx, TRUE, FALSE, name, NULL,
+			       fetch_x_real_uid, NULL);
+	return TRUE;
+}
+
 static int fetch_x_savedate(struct imap_fetch_context *ctx, struct mail *mail,
 			    void *context ATTR_UNUSED)
 {
@@ -850,6 +868,7 @@
 	{ "UID", fetch_uid_init },
 	{ "X-GUID", fetch_guid_init },
 	{ "X-MAILBOX", fetch_x_mailbox_init },
+	{ "X-REAL-UID", fetch_x_real_uid_init },
 	{ "X-SAVEDATE", fetch_x_savedate_init }
 };
 


More information about the dovecot-cvs mailing list