List Info

Thread: Re: Charset problems on quarantine




Re: Charset problems on quarantine
country flaguser name
Slovenia
2007-08-29 05:04:37
Renato,

> I'm using amavisd-new 2.5.2 quarantining messages on
postgresql, users
> can manage their own quarantine using a web application
developed
> here.
>
> We are having problems with charset. Postgres database
is using Latin1
> encoding and machine is set (LANG) to ISO8859-1.
>
> Is there a way to tell to amavisd-new to use this
encoding? Or a way
> to fix this problem.

Which fields do you have in mind?

The quarantine.mail_text field is of type bytea, which is
just a
sequence of bytes with no associated character set. A mail
message
prior to MIME decoding has no associated character set (but
MIME parts
and encoded header content do have a character set, and
there may be
several different character sets in use simultaneously in a
single
message).

Most of the other fields are plain 7-bit ASCII. The only
exceptions
are subject and from_addr in table msgs. The
safe_encode('utf8',...) call
near line 16306 in amavisd (2.5.2) encodes a Unicode string
into UTF-8,
after it has first been decoded according to character
set(s)
specified in a header field.

You could replace safe_encode('utf8',...) with
safe_encode('iso-8859-1',...)
which may do what you are asking for. Note there will be
'?'-marks
for characters which can not be encoded into Latin-1.

  Mark

------------------------------------------------------------
-------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and
a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
AMaViS-user mailing list
AMaViS-userlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user

AMaViS-FAQ:http://www.amav
is.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/ho
wto/

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )