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

Dmitry Donskih dmitry.donskih at gmail.com
Tue Feb 26 11:52:54 CET 2019


Thank you soo much for this bugfix, Serge!

I confirm, all non-ANSI templates are double-encoded and are unreadable
without this patch. It remains broken in amavisd-new-2.11.1, latest version.

> 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