> I`ve Umlauts in my body of templates (ok, only one template ;)).
> No problems here. In the Subject of course without Umlauts.

The following config variables control the character encoding
in notifications, both in the body and in headers
(shown are default values):

  $hdr_encoding = 'iso-8859-1';  # header field bodies charset
  $bdy_encoding = 'iso-8859-1';  # notification body text charset
  $hdr_encoding_qb = 'Q';        # quoted-printable (Q or B)

Encoding is done properly if Perl recognizes the specified character set,
including RFC 2047 encoding in headers such as Subject. Just write
latin-1 characters in the template text, and they will end up encoded
and mime-labelled properly. Works with any encoding supported by
your installation of Perl, including utf-8 with more recent versions of Perl.

This is a two phase process: read_text reads your template file and
decodes character set as specified in its (optional) second argument.
The text is stored as an internal Perl utf-8 character string.
When notifications is to be prepared, it is encoded from internal Perl
representation to character set as specified in $hdr_encoding
and $bdy_encoding. It is not necessary that template text on a file
uses the same character set as the final encoding, one could be
for example utf-8 and the other latin-1. Conversion works fine
as long as your Perl installation recognizes both character sets.


From amavisd.conf-sample:

# Select notifications text encoding when Unicode-aware Perl is converting
# text from internal character representation to external encoding (charset
# in MIME terminology). Used as argument to Perl Encode::encode subroutine.
#
#   to be used in RFC 2047-encoded header field bodies, e.g. in Subject:
#$hdr_encoding = 'iso-8859-1';  # MIME charset (default: 'iso-8859-1')
#$hdr_encoding_qb = 'Q';        # MIME encoding: quoted-printable (default)
#$hdr_encoding_qb = 'B';        # MIME encoding: base64
#
#   to be used in notification body text: its encoding and Content-type.charset
#$bdy_encoding = 'iso-8859-1';  # (default: 'iso-8859-1')

# Default template texts for notifications may be overruled by directly
# assigning new text to template variables, or by reading template text
# from files. A second argument may be specified in a call to read_text(),
# specifying character encoding layer to be used when reading from the
# external file, e.g. 'utf8', 'iso-8859-1', or often just $bdy_encoding.
# Text will be converted to internal character representation by Perl 5.8.0
# or later; second argument is ignored otherwise. See PerlIO::encoding,
# Encode::PerlIO and perluniintro man pages.
#
# $notify_sender_templ      = read_text("$MYHOME/notify_sender.txt");
# $notify_virus_sender_templ= read_text("$MYHOME/notify_virus_sender.txt");
# $notify_virus_admin_templ = read_text("$MYHOME/notify_virus_admin.txt");
# $notify_virus_recips_templ= read_text("$MYHOME/notify_virus_recips.txt");
# $notify_spam_sender_templ = read_text("$MYHOME/notify_spam_sender.txt");
# $notify_spam_admin_templ  = read_text("$MYHOME/notify_spam_admin.txt");
...


-------------------------------------------------------
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_idv37&alloc_id865&op=click
_______________________________________________
AMaViS-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/

Reply via email to