]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm fetch: Added "refcount" field.
authorTimo Sirainen <tss@iki.fi>
Thu, 11 Jun 2015 16:08:13 +0000 (19:08 +0300)
committerTimo Sirainen <tss@iki.fi>
Thu, 11 Jun 2015 16:08:13 +0000 (19:08 +0300)
src/doveadm/doveadm-mail-fetch.c

index 240a9dd48520fd68a7d41ba169ee89134f2a6a6b..d15cfc9b157b3938a4f6f72b910523d3f502975a 100644 (file)
@@ -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)