Mercurial > dovecot > core-2.2
diff src/doveadm/doveadm-mail-fetch.c @ 11511:9f9f9d9e4a79 HEAD
doveadm fetch: Added "user" field.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Wed, 09 Jun 2010 18:52:42 +0100 |
parents | 93eaae8617c8 |
children | 9a852084bbeb |
line wrap: on
line diff
--- 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 },