Bug fix: During initialization safe_encode_utf8_inplace is called not only for log_templ or log_recip_templ

Serge Braichuk braichuk at tut.by
Fri Nov 17 23:41:34 CET 2017


sub init_tokenize_templates(): safe_encode_utf8_inplace is called for ALL templates. After that non-ansi templates can be unreadable (e.g. Russian language templates).

This can be fixed via the following patch:

diff -du amavisd.orig amavisd
--- amavisd.orig Tue Apr 26 22:24:33 2016
+++ amavisd Sat Nov 18 00:40:49 2017
@@ -12826,7 +12826,7 @@
       $s = $$s if ref($s) eq 'SCALAR';
       if (defined $s) {
         # encode log templates to UTF-8, leave the rest as character strings
- safe_encode_utf8_inplace($s) if $n eq 'log_templ' || 'log_recip_templ';
+ safe_encode_utf8_inplace($s) if $n eq 'log_templ' || $n eq 'log_recip_templ';
         $policy_bank{$bank_name}{$n} = tokenize(\$s);
       }
     }


More information about the amavis-users mailing list