A NOTE has been added to this issue.
======================================================================
http://www.dbmail.org/mantis/view.php?id=597
======================================================================
Reported By: LordVan
Assigned To:
======================================================================
Project: DBMail
Issue ID: 597
Category: Sieve (delivery, dbmail-sievecmd, dbmail-timsieved)
Reproducibility: random
Severity: major
Priority: normal
Status: new
target:
======================================================================
Date Submitted: 18-May-07 11:27 CEST
Last Modified: 22-Sep-07 13:19 CEST
======================================================================
Summary: invalid byte sequence / encoding errors (most likely
from timsieved)
Description:
I get rather odd error messages in my postgresql log at the moment which
are about encoding / invalid byte sequences (see additional information).
unfortunately i don't get anything in my dbmail logs, but since I recently
activated timsieved i think it is causing the problem (I get some 'emails'
in my inbox which indicate some problem with sieve):
From: [EMAIL PROTECTED]
Subject: Sieve script run error
To: lordvan
Message-Id: <1179479501l.19950l.0l@(none)>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-DBMail-PhysMessage-ID: 273777
Your Sieve script [phpscript] failed to run correctly.
Messages will be delivered to your INBOX for now.
The error message is:
syntax error, unexpected '<', expecting $end
If needed i can turn on the debugging for sieve, but please let me know
first if I'm correct as I get plenty of debug at the moment already anyway
..
======================================================================
----------------------------------------------------------------------
aaron - 19-May-07 09:12
----------------------------------------------------------------------
Looks like two unrelated problems:
1. Some messages are arriving that are not valid utf-8 and this makes
postgresql angry.
2. An error in a sieve script or possibly some bad input is resulting in a
runtime error in the sieve interpreter.
----------------------------------------------------------------------
LordVan - 21-May-07 11:09
----------------------------------------------------------------------
Hmm i see.
shall we seperate this into 2 tickets?
regarding 1: is there any (reasonably costly) way to check if the encoding
is ok before sending it to postgres ?
re 2: the message i get back is not very useful unfortunately and none of
my scripts look like they could cause that (als it seems to me that all my
scripts actually work (none are more complicate than sender matchex X or
List-Id matches Y ..apart from 2 which have where to matches Z or A or B
but that's it :( )
----------------------------------------------------------------------
decibel - 21-May-07 17:57
----------------------------------------------------------------------
Rather than checking for valid UTF8 yourself it might be better to trap the
error from PostgreSQL using a stored procedure and an exception block.
On the other hand, you probably want to allow some means of storing the
email even if it does include invalid UTF8, perhaps by replacing the
invalid characters with something else.
----------------------------------------------------------------------
paul - 21-May-07 19:36
----------------------------------------------------------------------
I'd like to see the queries *prior* to the first error. Afaik all columns
that are affected by this are already converted into clean utf8 during
message insertion (header cache). And the messageblks are in bytea type so
they don't care one way or another.
----------------------------------------------------------------------
cloos - 23-May-07 06:05
----------------------------------------------------------------------
I just attached an email (sent to debian-perl) which dbmail-smtp failed to
store, along with the error report from dbmail-smtp's STDERR.
As you can see, the From: header in the raw email contains this:
=?utf-8?Q?Vel=E1zquez?=
Ie, it claims to be providing a quoted-printable encoding of the utf-8
encoding of the UCS character U+00E1 LATIN SMALL LETTER A WITH ACUTE but
instead has the quoted-printable encoding of the equivalent Latin1
character.
It seems, then, that dbmail is trusting the header rather than validating
that what the header claims is utf-8 is valid utf-8.
The X-Sender header repeats the same issue.
The STDERR report shows that the INSERT into dbmail_headervalue failed.
To help illuminate that STDERR report at bit:
dbmail=# select * from dbmail_headername where id=4;
id | headername
----+------------
4 | from
(1 row)
Hope this helps.
----------------------------------------------------------------------
cloos - 23-May-07 06:06
----------------------------------------------------------------------
Oh, I forgot to mention:
I ran dbmail-smtp with -u and -M args, so sieve was not a factor.
----------------------------------------------------------------------
cloos - 23-May-07 11:54
----------------------------------------------------------------------
Sorry for the spam;
I also forgot to note that I was running the 2_2_branch as of commit 2589
when I saw and replicated that failure.
----------------------------------------------------------------------
paul - 03-Jul-07 23:07
----------------------------------------------------------------------
Ok, I've included a cleanup of the iconv infrastructure since 2.2.5, but
we'll need to check if that actually solves this issue.
----------------------------------------------------------------------
LordVan - 22-Sep-07 13:19
----------------------------------------------------------------------
just FYI.. i haven't seen this message in my logs recently so i hope it is
fixed :)
Issue History
Date Modified Username Field Change
======================================================================
18-May-07 11:27 LordVan New Issue
19-May-07 09:12 aaron Note Added: 0002189
21-May-07 11:09 LordVan Note Added: 0002199
21-May-07 17:57 decibel Note Added: 0002200
21-May-07 19:36 paul Note Added: 0002201
23-May-07 05:55 cloos File Added: dbmail-cannot-store.822
23-May-07 05:56 cloos File Added: dbmail-cannot-store.err
23-May-07 06:05 cloos Note Added: 0002207
23-May-07 06:06 cloos Note Added: 0002208
23-May-07 11:54 cloos Note Added: 0002209
03-Jul-07 23:07 paul Note Added: 0002279
22-Sep-07 13:19 LordVan Note Added: 0002373
======================================================================
_______________________________________________
Dbmail-dev mailing list
[email protected]
http://twister.fastxs.net/mailman/listinfo/dbmail-dev