From: Timo Sirainen Date: Thu, 11 Jun 2015 16:08:13 +0000 (+0300) Subject: doveadm fetch: Added "refcount" field. X-Git-Tag: 2.2.19.rc1~352 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e1ba963457988db73650fbf972398e1d0e2318b6;p=thirdparty%2Fdovecot%2Fcore.git doveadm fetch: Added "refcount" field. --- diff --git a/src/doveadm/doveadm-mail-fetch.c b/src/doveadm/doveadm-mail-fetch.c index 240a9dd485..d15cfc9b15 100644 --- a/src/doveadm/doveadm-mail-fetch.c +++ b/src/doveadm/doveadm-mail-fetch.c @@ -376,6 +376,16 @@ static int fetch_pop3_order(struct fetch_cmd_context *ctx) return 0; } +static int fetch_refcount(struct fetch_cmd_context *ctx) +{ + const char *value; + + if (mail_get_special(ctx->mail, MAIL_FETCH_REFCOUNT, &value) < 0) + return -1; + doveadm_print(value); + return 0; +} + static const struct fetch_field fetch_fields[] = { { "user", 0, fetch_user }, { "mailbox", 0, fetch_mailbox }, @@ -401,7 +411,8 @@ static const struct fetch_field fetch_fields[] = { { "imap.body", MAIL_FETCH_IMAP_BODY, fetch_imap_body }, { "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 } + { "pop3.order", MAIL_FETCH_POP3_ORDER, fetch_pop3_order }, + { "refcount", MAIL_FETCH_REFCOUNT, fetch_refcount } }; static const struct fetch_field *fetch_field_find(const char *name)