Leon, > Is there a way to use function function encode($in_str, $charset) on > Subject header when amavis see the "BAD HEADER" in Subject?
> I don't really care if Subjects BAD HEADER for "Latin" or another > encoding would be scrambled (if it is already "BAD"). > I really want only this $charset = "ISO-8859-8"; - Hebrew > particular charset to be "GOOD" in case it's not encoded. > So, I prefer to encode all Subjects "BAD HEADERS" with the encode function. > Where should I enter the encode code? Perhaps in sub write_header in both the 'if' and 'else' paths of the following code, just before the $out_fh->print : if (!exists($self->{edit}{$field_name_lc})) { # unchanged # unfold illegal all-whitespace continuation lines $curr_head =~ s{\n [ \t]* (?= \n )}{}gsx and $illcnt++; $out_fh->print($curr_head) or die "sending mail header5: $!"; } else { my($edit) = $self->{edit}{$field_name_lc}; if (defined($edit)) { # edit, not delete chomp($field_body); ### $field_body =~ s/\n([ \t])/$1/g; # unfold my($subst) = hdr($field_name, &$edit($field_name,$field_body)); $subst =~ s{\n [ \t]* (?= \n )}{}gsx and $illcnt++; $out_fh->print($subst) or die "sending mail header6: $!"; } } (the 'else' path takes care of cases like Subject header field when it get edited, like inserting a ***SPAM*** string) Mark ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click _______________________________________________ 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/