Mercurial > dovecot > core-2.2
changeset 11602:172a0c7cebbb HEAD
doveadm fetch hdr.*: Show the hdr.name prefix even if the header doestn't exist.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Mon, 21 Jun 2010 17:23:25 +0100 |
parents | 52e2f3a8054f |
children | 28cfb347296a |
files | src/doveadm/doveadm-mail-fetch.c |
diffstat | 1 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/doveadm/doveadm-mail-fetch.c Mon Jun 21 17:21:30 2010 +0100 +++ b/src/doveadm/doveadm-mail-fetch.c Mon Jun 21 17:23:25 2010 +0100 @@ -145,6 +145,13 @@ if (mail_get_headers(ctx->mail, ctx->cur_field->name, &value) < 0) return -1; + if (*value == NULL) { + /* no value */ + if (ctx->print_field_prefix) + str_printfa(ctx->hdr, "hdr.%s: ", ctx->cur_field->name); + return 0; + } + for (; *value != NULL; value++) { if (add_lf) str_append_c(ctx->hdr, '\n');