Voytek, > I see some email tagged as 'bad header' where the user has say Polish > ogonki charcters or Thai characters > > both of these are valid emails,
No they are not valid according to RFC 5322 (ex RFC 2822). Mail client should have encoded these characters according to RFC 2047. WHAT IS AN INVALID CHARACTER IN A MAIL HEADER SECTION? The RFC 5322 document specifies rules for forming internet messages. It does not allow the use of characters with codes above 127 to be used directly (non-encoded) in a mail header section. If such characters (e.g. with diacritics) from ISO Latin or other alphabets need to be included in a header section, these characters need to be properly encoded according to RFC 2047. Such encoding is often done transparently by mail reader (MUA), but if automatic encoding is not available (e.g. by some older MUA) it is a user's responsibility to avoid using such characters in a header section, or to encode them manually. Typically the offending header fields in this category are 'Subject', 'Organization', and comment fields or display names in e-mail addresses of 'From', 'To' or 'Cc'. > what's the best way to avoid such characters triggering bad header ? > (or should I simply not test for bad headers?) Noel Jones writes: > If you frequently receive legit mail with bad headers, turn > off header checking. True. Or more selectively: $allowed_header_tests{'8bit'} = 0; amavisd-new-2.4.4 release notes: - new configuration variable %allowed_header_tests, also member of policy banks, allows for selectively disabling some of the header checks, e.g. checks for non-encoded 8-bit characters. The %allowed_header_tests hash contains all available header tests as its keys by default (with a value of true); removing a key, or setting its value to false, disables a test, e.g.: $allowed_header_tests{'8bit'} = 0; $allowed_header_tests{'missing'} = 0; Currently available keys (i.e. tests) are: other mime 8bit control empty long syntax missing multiple each corresponding to its own minor contents category of CC_BADH; ccat test min name description --- ------- ----------- 0 other (catchall for everything else, normally not used) 1 mime Bad MIME (sub)headers or bad MIME structure 2 8bit Invalid non-encoded 8-bit characters in header 3 control Invalid control characters in header (CR or NUL) 4 empty Folded header field made up entirely of whitespace 5 long Header line longer than RFC 2822 limit of 998 characters 6 syntax Header field syntax error 7 missing Missing required header field 8 multiple Duplicate or multiple occurrence of a header field legend: ccat min: minor contents category under a major category CC_BADH, available in templates as a macro ccat_min; test name: corresponding test name - a key in %allowed_header_tests; descr.: description of a header test or MIME subheaders/structure test; Mark ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ AMaViS-user mailing list AMaViS-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/amavis-user AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3 AMaViS-HowTos:http://www.amavis.org/howto/