]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm fetch: Added "storageid" field.
authorTimo Sirainen <tss@iki.fi>
Wed, 30 Sep 2015 15:50:09 +0000 (18:50 +0300)
committerTimo Sirainen <tss@iki.fi>
Wed, 30 Sep 2015 15:50:09 +0000 (18:50 +0300)
src/doveadm/doveadm-mail-fetch.c

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