diff options
| author | Sam Varshavchik | 2018-02-16 20:54:41 -0500 |
|---|---|---|
| committer | Sam Varshavchik | 2018-02-16 21:19:05 -0500 |
| commit | c6c18e6142360a30cc11bfe29ac8b762e99a2104 (patch) | |
| tree | ee18c5fcb707c5d230950dd57e4ae619e3bd38b0 /rfc2045 | |
| parent | 8b4fcc3895ca8243e200c15cd089323a482cad13 (diff) | |
| download | courier-libs-c6c18e6142360a30cc11bfe29ac8b762e99a2104.tar.bz2 | |
maildrop: Add :H pattern modifier to maildrop.
rfc2045: RFC2045_DECODEMSG_NOATTACHHEADERS flag, do not decode attachment
headers.
maildrop: The ":H" pattern modifier searches main headers only, does not
search attachments' headers.
Diffstat (limited to 'rfc2045')
| -rw-r--r-- | rfc2045/rfc2045.h | 7 | ||||
| -rw-r--r-- | rfc2045/rfc2045decodemsgtoutf8.c | 7 |
2 files changed, 13 insertions, 1 deletions
diff --git a/rfc2045/rfc2045.h b/rfc2045/rfc2045.h index c7e2a62..90c2b56 100644 --- a/rfc2045/rfc2045.h +++ b/rfc2045/rfc2045.h @@ -559,6 +559,13 @@ struct rfc2045_decodemsgtoutf8_cb { ** Do not prepend name: to converted header content. */ + +#define RFC2045_DECODEMSG_NOATTACHHEADERS 0x08 +/* +** Do not decode MIME headers of attachments. Decode only the message's +** main headers. +*/ + /* ** Convert a message into a utf8 bytestream. The output produced by this ** function is a catentation of decoded header and text content data, converted diff --git a/rfc2045/rfc2045decodemsgtoutf8.c b/rfc2045/rfc2045decodemsgtoutf8.c index fb58c3e..45ce2ea 100644 --- a/rfc2045/rfc2045decodemsgtoutf8.c +++ b/rfc2045/rfc2045decodemsgtoutf8.c @@ -79,7 +79,7 @@ static int doconvtoutf8_rfc822hdr(const char *header, doconvtoutf8_write(header, strlen(header), &info); doconvtoutf8_write(": ", 2, &info); } - rfc822_display_hdrvalue(header, value, "utf-8", + rfc822_display_hdrvalue(header, value, "utf-8", doconvtoutf8_write_noeol, doconvtoutf8_error, &info); @@ -129,6 +129,11 @@ int rfc2045_decodemsgtoutf8(struct rfc2045src *src, if (callback->flags & RFC2045_DECODEMSG_NOHEADERS) continue; + if ((callback->flags & + RFC2045_DECODEMSG_NOATTACHHEADERS) + && p->parent) + continue; + if (doconvtoutf8_rfc822hdr(header, value, callback) < 0) return -1; |
