From: Timo Sirainen Date: Wed, 30 Sep 2015 15:50:09 +0000 (+0300) Subject: doveadm fetch: Added "storageid" field. X-Git-Tag: 2.2.19~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d56dc75f70aaea4369f4bfcffb0cd1b5abe1ca9;p=thirdparty%2Fdovecot%2Fcore.git doveadm fetch: Added "storageid" field. --- diff --git a/src/doveadm/doveadm-mail-fetch.c b/src/doveadm/doveadm-mail-fetch.c index d15cfc9b15..d886fd647b 100644 --- a/src/doveadm/doveadm-mail-fetch.c +++ b/src/doveadm/doveadm-mail-fetch.c @@ -386,6 +386,16 @@ static int fetch_refcount(struct fetch_cmd_context *ctx) return 0; } +static int fetch_storageid(struct fetch_cmd_context *ctx) +{ + const char *value; + + if (mail_get_special(ctx->mail, MAIL_FETCH_STORAGE_ID, &value) < 0) + return -1; + doveadm_print(value); + return 0; +} + static const struct fetch_field fetch_fields[] = { { "user", 0, fetch_user }, { "mailbox", 0, fetch_mailbox }, @@ -412,7 +422,8 @@ static const struct fetch_field fetch_fields[] = { { "imap.bodystructure", MAIL_FETCH_IMAP_BODYSTRUCTURE, fetch_imap_bodystructure }, { "pop3.uidl", MAIL_FETCH_UIDL_BACKEND, fetch_pop3_uidl }, { "pop3.order", MAIL_FETCH_POP3_ORDER, fetch_pop3_order }, - { "refcount", MAIL_FETCH_REFCOUNT, fetch_refcount } + { "refcount", MAIL_FETCH_REFCOUNT, fetch_refcount }, + { "storageid", MAIL_FETCH_STORAGE_ID, fetch_storageid } }; static const struct fetch_field *fetch_field_find(const char *name)