Mercurial > dovecot > core-2.2
changeset 13545:e932f81eba48
fts: Support also RFC 2231 style parsing when finding the attachment filename.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Fri, 23 Sep 2011 00:04:11 +0300 |
parents | 2b219b549007 |
children | 46e90b44d378 |
files | src/plugins/fts/fts-parser-script.c |
diffstat | 1 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/plugins/fts/fts-parser-script.c Thu Sep 22 23:59:48 2011 +0300 +++ b/src/plugins/fts/fts-parser-script.c Fri Sep 23 00:04:11 2011 +0300 @@ -152,7 +152,7 @@ const char **filename_r) { struct rfc822_parser_context parser; - const char *const *results; + const char *const *results, *filename2; string_t *str; *filename_r = NULL; @@ -170,11 +170,19 @@ return; (void)rfc2231_parse(&parser, &results); + filename2 = NULL; for (; *results != NULL; results += 2) { if (strcasecmp(results[0], "filename") == 0) { *filename_r = results[1]; break; } + if (strcasecmp(results[0], "filename*") == 0) + filename2 = results[1]; + } + if (*filename_r == NULL) { + /* RFC 2231 style non-ascii filename. we don't really care + much about the filename actually, just about its extension */ + *filename_r = filename2; } }