dovecot-2.0: doveadm fetch: Added support for imap.envelope, ima...

dovecot at dovecot.org dovecot at dovecot.org
Wed May 19 18:45:00 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/4ec22f3bfd9f
changeset: 11337:4ec22f3bfd9f
user:      Timo Sirainen <tss at iki.fi>
date:      Wed May 19 17:44:56 2010 +0200
description:
doveadm fetch: Added support for imap.envelope, imap.body and imap.bodystructure fields.

diffstat:

 src/doveadm/doveadm-mail-fetch.c |  35 ++++++++++++++++++++++++++++++++++-
 1 files changed, 34 insertions(+), 1 deletions(-)

diffs (52 lines):

diff -r 2587eb79a83d -r 4ec22f3bfd9f src/doveadm/doveadm-mail-fetch.c
--- a/src/doveadm/doveadm-mail-fetch.c	Wed May 19 17:35:27 2010 +0200
+++ b/src/doveadm/doveadm-mail-fetch.c	Wed May 19 17:44:56 2010 +0200
@@ -218,6 +218,36 @@
 	return 0;
 }
 
+static int fetch_imap_envelope(struct fetch_cmd_context *ctx)
+{
+	const char *value;
+
+	if (mail_get_special(ctx->mail, MAIL_FETCH_IMAP_ENVELOPE, &value) < 0)
+		return -1;
+	str_append(ctx->hdr, value);
+	return 0;
+}
+
+static int fetch_imap_body(struct fetch_cmd_context *ctx)
+{
+	const char *value;
+
+	if (mail_get_special(ctx->mail, MAIL_FETCH_IMAP_BODY, &value) < 0)
+		return -1;
+	str_append(ctx->hdr, value);
+	return 0;
+}
+
+static int fetch_imap_bodystructure(struct fetch_cmd_context *ctx)
+{
+	const char *value;
+
+	if (mail_get_special(ctx->mail, MAIL_FETCH_IMAP_BODYSTRUCTURE, &value) < 0)
+		return -1;
+	str_append(ctx->hdr, value);
+	return 0;
+}
+
 struct fetch_field {
 	const char *name;
 	enum mail_fetch_field wanted_fields;
@@ -239,7 +269,10 @@
 	{ "size.virtual",  MAIL_FETCH_VIRTUAL_SIZE,  fetch_size_virtual },
 	{ "date.received", MAIL_FETCH_RECEIVED_DATE, fetch_date_received },
 	{ "date.sent",     MAIL_FETCH_DATE,          fetch_date_sent },
-	{ "date.saved",    MAIL_FETCH_SAVE_DATE,     fetch_date_saved }
+	{ "date.saved",    MAIL_FETCH_SAVE_DATE,     fetch_date_saved },
+	{ "imap.envelope", MAIL_FETCH_IMAP_ENVELOPE, fetch_imap_envelope },
+	{ "imap.body",     MAIL_FETCH_IMAP_BODY,     fetch_imap_body },
+	{ "imap.bodystructure", MAIL_FETCH_IMAP_BODYSTRUCTURE, fetch_imap_bodystructure }
 };
 
 static const struct fetch_field *fetch_field_find(const char *name)


More information about the dovecot-cvs mailing list