Opened 8 years ago

Last modified 8 years ago

#566 accepted defect

Invalid encoding in raw subject may cause inclomplete save

Reported by: mortonda@… Owned by: mortonda@…
Priority: normal Milestone: 1.0.3
Component: amavisd-maia Version: 1.0.2
Severity: normal Keywords:
Cc:

Description

Arnaud reported a case some time back about a message that displayed a truncated subject line. Looking in the database showed it was truncated there.

The perl DBD driver appears to truncate strings that have invalid characters, and the message (incorrectly) had a non utf8 character in it. While this is not supposed to be allowed in smtp transactions, it apparently works enough for a bank to get away with it.

To solve this, we will store the original mail in binary format which will keep it from truncating, and since the subject column is only for searching and display, re-encode the subject into utf8. This process will make sure that the data goes safely into the database. Any incorrect characters should be dropped by the conversion, a better result than just truncating at the invalid character.

Finally, unknown character sets in the mime encoding could be decoded into the best effort utf-8 (assumption of source encoding to be...), or change the subject to (Undecipherable subject)

Change History (1)

comment:1 Changed 8 years ago by mortonda@…

  • Owner changed from rjl to mortonda@…
  • Status changed from new to accepted

[1572] [1575] [1576] If the encoding is not known, we had changed the subject, although the original subject was mostly readable.

We could look for a content type header for the whole message to use as a suggestion for the source charset.... Both here in making the subject column, and in the php viewer...

Note: See TracTickets for help on using tickets.