Justin,

> Thanks for the idea on how to fix the problem, unfortunately it doesn't
> seem to totally fix it, I have a feeling that it's not just the mail_text
> field that is being affected but other fields like subject etc, it seems to
> only happen with poorly built email and viruses

Fields From:, Subject: and Message-Id: are converted to UTF-8 bytes
by Perl module Encode, called from amavisd, subroutine save_info_final,
so the resulting string of bytes should be a valid UTF-8 bytes string.
Logging at level 4 or 5 would show it (search for
"save_info_final.*Message-ID:"). A potential remaining problem there
could be when these fields are longer than 255 and are chopped to 255,
which could chop a multibyte sequence.

Are you seeing problems with these three fields in table msgs,
or somewhere else? Most other values for CHAR and VARCHAR fields
are either internally-generated and known to be plain ascii.
A possible problem could be if an 8-bit character appears in
SMTP envelope addresses (not in mail header). These would be
apparent from top-level log entries which list sender and
recipients, protecting nonprintable and non-ascii characters.

> I have found that by changing the client_encoding for the user used for
> connecting to the database to LATIN1 has stopped most of the errors

This shouldn't be necessary (just sweeps the problem under a carpet),
and invalidates interpretation of msgs.from_addr, msgs.subject
(and msgs.message_id), which are to be interpreted as UTF-8 strings.

> but still getting errors like
>
> check_header: 2, Non-encoded 8-bit data (char A3 hex): Subject: MS Office
> 2003 Basic oem ONLY \\24395.00\\n
>
> DBD::Pg::st execute failed: ERROR:  invalid input syntax for type bytea at
> (eval 46) line 176, <GEN8> line 102.

Looks like you have a version of DBD::Pg older than 1.48:
  http://rt.cpan.org/Public/Bug/Display.html?id=18264

Upgrade DBD::Pg to 1.49 (or 1.48).

  Mark

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
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/

Reply via email to