dovecot-2.0: doveadm fetch: Added "user" field.

dovecot at dovecot.org dovecot at dovecot.org
Wed Jun 9 20:53:45 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/9f9f9d9e4a79
changeset: 11511:9f9f9d9e4a79
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Jun 09 18:52:42 2010 +0100
description:
doveadm fetch: Added "user" field.

diffstat:

 src/doveadm/doveadm-mail-fetch.c |  8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diffs (32 lines):

diff -r c147a2653f9c -r 9f9f9d9e4a79 src/doveadm/doveadm-mail-fetch.c
--- a/src/doveadm/doveadm-mail-fetch.c	Wed Jun 09 18:32:47 2010 +0100
+++ b/src/doveadm/doveadm-mail-fetch.c	Wed Jun 09 18:52:42 2010 +0100
@@ -10,6 +10,7 @@
 #include "message-size.h"
 #include "imap-utf7.h"
 #include "imap-util.h"
+#include "mail-user.h"
 #include "mail-storage.h"
 #include "mail-search.h"
 #include "doveadm-mail.h"
@@ -41,6 +42,12 @@
 	int (*print)(struct fetch_cmd_context *ctx);
 };
 
+static int fetch_user(struct fetch_cmd_context *ctx)
+{
+	str_append(ctx->hdr, ctx->ctx.cur_mail_user->username);
+	return 0;
+}
+
 static int fetch_mailbox(struct fetch_cmd_context *ctx)
 {
 	const char *value;
@@ -283,6 +290,7 @@
 }
 
 static const struct fetch_field fetch_fields[] = {
+	{ "user",          0,                        fetch_user },
 	{ "mailbox",       0,                        fetch_mailbox },
 	{ "mailbox-guid",  0,                        fetch_mailbox_guid },
 	{ "seq",           0,                        fetch_seq },


More information about the dovecot-cvs mailing list