dovecot-2.1: fts: Support also RFC 2231 style parsing when findi...
dovecot at dovecot.org
dovecot at dovecot.org
Fri Sep 23 00:04:26 EEST 2011
details: http://hg.dovecot.org/dovecot-2.1/rev/e932f81eba48
changeset: 13545:e932f81eba48
user: Timo Sirainen <tss at iki.fi>
date: Fri Sep 23 00:04:11 2011 +0300
description:
fts: Support also RFC 2231 style parsing when finding the attachment filename.
diffstat:
src/plugins/fts/fts-parser-script.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diffs (32 lines):
diff -r 2b219b549007 -r e932f81eba48 src/plugins/fts/fts-parser-script.c
--- 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;
}
}
More information about the dovecot-cvs
mailing list