|
From: Andrew D. <and...@gm...> - 2006-12-18 20:15:02
|
Hello SQLgrey, I've run into quite a few instances over the last month or so where SQLgrey gets a "SQLgrey database error" and then recovers. I think it has to do with unicode domain names. I started running SQLgrey with more logging, and here's a snippet for when things go badly: Dec 18 12:32:41 tango postfix/smtpd[10133]: connect from unknown[81.215.189= .168] Dec 18 12:32:42 tango sqlgrey: 2006/12/18-12:32:42 CONNECT TCP Peer: "127.0= .0.1:54494" Local: "127.0.0.1:2501" Dec 18 12:32:42 tango sqlgrey: optin: greylisting active for jb...@ex... Dec 18 12:32:42 tango sqlgrey: grey: unknown RDNS: 81.215.189.168 Dec 18 12:32:42 tango sqlgrey: warning: Use of uninitialized value in conca= tenation (.) or string at /usr/sbin/sqlgrey line 1062. Dec 18 12:32:42 tango sqlgrey: dbaccess: error: couldn't access from_awl ta= ble:=20 Dec 18 12:32:43 tango sqlgrey: grey: from awl match: updating 81.215.189.16= 8(81.215.189.168), man...@ab...(man=C3=A8gednervy@a= byss.wesn.sun.com) Dec 18 12:32:43 tango sqlgrey: dbaccess: warning: couldn't do query: UPDATE= from_awl SET last_seen =3D NOW(), first_seen =3D first_seen WHERE sender_n= ame =3D 'man=C3=A8genervy' AND sender_domain =3D 'abyss.wesn.sun.com' AND s= rc =3D '81.215.189.168': ERROR: invalid byte sequence for encoding "UNICOD= E": 0xe86765 , reconnecting to DB Dec 18 12:32:43 tango postfix/pickup[9793]: 04D7E1A6BD: uid=3D1004 from=3D<= sqlgrey> That line in SQLgrey is a log error: $self->mylog('dbaccess', 0, "error: couldn't access $from_awl table: $DBI:= :errstr"); and the whole function is: ## Match connections to AWLs ## sub is_in_from_awl { my ($self, $sender_name, $sender_domain, $host) =3D @_; # last_seen less than $self->{sqlgrey}{awl_age} days ago my $sth =3D $self->prepare("SELECT 1 FROM $from_awl " . 'WHERE sender_name =3D ? ' . 'AND sender_domain =3D ? ' . 'AND src =3D ? ' . 'AND last_seen > ' . $self->past_tstamp($self->{sqlgrey}{awl_age}, 'DAY') ); if (!defined $sth or !$sth->execute($sender_name, $sender_domain, $host= )) { $self->db_unavailable(); $self->mylog('dbaccess', 0, "error: couldn't access $from_awl table: $D= BI::errstr"); return 1; # in doubt, accept } else { $self->db_available(); } my $result =3D $sth->fetchall_arrayref(); if ($#$result !=3D 0) { return 0; # not a single entry } else { return 1; # one single entry (no multiple entries by design) } } Is there anything I can do in either SQLgrey or postfix to stop this from happening? As far as I can tell it always reconnects right away, but it is a little concerning. --=20 Best regards, Andrew |
|
From: Lionel B. <lio...@bo...> - 2006-12-18 20:32:48
|
Andrew Diederich wrote the following on 18.12.2006 21:14 : > Dec 18 12:32:43 tango sqlgrey: dbaccess: warning: couldn't do query: UP= DATE from_awl SET last_seen =3D NOW(), first_seen =3D first_seen WHERE se= nder_name =3D 'man=C3=83=C5=A1genervy' AND sender_domain =3D 'abyss.wesn.= sun.com' AND src =3D '81.215.189.168': ERROR: invalid byte sequence for = encoding "UNICODE": 0xe86765 , reconnecting to DB > =20 Hum, did you try to use a database with ASCII instead of UNICODE?=20 SQLgrey doesn't try to speak utf-8 with the database but only pure=20 ASCII. If you receive adresses with characters outside the utf-8 space,=20 this behavior is expected with a UNICODE database. Nothing to do with unicode domain names (these ones are encoded in ASCII=20 anyway, so Postfix and SQLgrey don't need to be aware of them). You=20 can't configure Postfix easily to solve this and to solve it in SQLgrey,=20 we would have to make it aware of the database encoding and call iconv=20 to make sure everything fits, assuming the original encoding is always=20 ISO-8859-1 for the Return-Path. ASCII at the database level is your best bet, you should dump your DB,=20 create another one with ASCII encoding, restore the original DB in the=20 new one, change SQLgrey's database in sqlgrey.conf and restart SQLgrey. Lionel |
|
From: Andrew D. <and...@gm...> - 2006-12-18 23:14:34
|
Hello Lionel, Monday, December 18, 2006, 1:32:39 PM, you wrote: > Andrew Diederich wrote the following on 18.12.2006 21:14 : >> Dec 18 12:32:43 tango sqlgrey: dbaccess: warning: couldn't do query: UPD= ATE from_awl SET last_seen =3D NOW(), first_seen =3D first_seen WHERE sende= r_name =3D 'man=C3=83=C5=A1genervy' AND sender_domain =3D 'abyss.wesn.sun.c= om' AND src =3D '81.215.189.168': ERROR: invalid byte sequence for encodin= g "UNICODE": 0xe86765 , reconnecting to DB >> =20 > Hum, did you try to use a database with ASCII instead of UNICODE?=20 > SQLgrey doesn't try to speak utf-8 with the database but only pure=20 > ASCII. If you receive adresses with characters outside the utf-8 space, > this behavior is expected with a UNICODE database. <rest snipped> I bet that's it. My database is in UNICODE. I'll try a dump and restore later this week and let you know how that goes. Thanks for the tip. --=20 Best regards, Andrew |
|
From: Juan P. B. <jp...@gr...> - 2006-12-19 03:40:50
|
Well, my DB is in latin1, as the whole mysql, same problem. Im being flooded with 50+ emails with db disconnect, db reconnected all = the time. Sorry not to mention the exact frace cose i delete with a rule all those mails. > -----Original Message----- > From: sql...@li...=20 > [mailto:sql...@li...] On=20 > Behalf Of Andrew Diederich > Sent: Monday, December 18, 2006 20:14 > To: SQLgrey users mailing-list > Subject: Re: [Sqlgrey-users] More on sqlgrey stop/recover issue >=20 >=20 > Hello Lionel, >=20 > Monday, December 18, 2006, 1:32:39 PM, you wrote: >=20 > > Andrew Diederich wrote the following on 18.12.2006 21:14 : > >> Dec 18 12:32:43 tango sqlgrey: dbaccess: warning: couldn't=20 > do query: UPDATE from_awl SET last_seen =3D NOW(), first_seen =3D=20 > first_seen WHERE sender_name =3D 'man?=B9genervy' AND=20 > sender_domain =3D 'abyss.wesn.sun.com' AND src =3D=20 > '81.215.189.168': ERROR: invalid byte sequence for encoding=20 > "UNICODE": 0xe86765 , reconnecting to DB > >> =20 >=20 > > Hum, did you try to use a database with ASCII instead of UNICODE?=20 > > SQLgrey doesn't try to speak utf-8 with the database but only pure=20 > > ASCII. If you receive adresses with characters outside the=20 > utf-8 space, > > this behavior is expected with a UNICODE database. >=20 > <rest snipped> >=20 > I bet that's it. My database is in UNICODE. I'll try a dump and > restore later this week and let you know how that goes. >=20 > Thanks for the tip. >=20 > --=20 > Best regards, > Andrew >=20 >=20 > -------------------------------------------------------------- > ----------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the=20 > chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge &CID=3DDEVDEV _______________________________________________ Sqlgrey-users mailing list Sql...@li... https://lists.sourceforge.net/lists/listinfo/sqlgrey-users |