baruwaproject / baruwa2

Baruwa 2.0
http://www.baruwa.org
GNU General Public License v3.0
21 stars 9 forks source link

Some messages can't be restored from the backup log db #120

Closed rmoesbergen closed 7 years ago

rmoesbergen commented 7 years ago

On a number of systems, a message was 'stuck' in the /var/lib/baruwa/mailscanner/baruwa2.db

Also, this was logged for every message: Mar 2 10:19:16 lnx2633vm MailScanner[12118]: BaruwaSQL: Backup DB insert Fail

It might have something to do with (invalid?) unicode characters in the message. An example message that was stuck for weeks:

sqlite> select * from tm; 2017-02-21 10:34:16 1cg7lY-00086L-BE 15788 larsm�ller@faktura.dk faktura.dk supportdk@philips-tvconsumercare.com philips-tvconsumercare.com Faktura for ordre nr.299098 136.243.22.251 0 0 0 0 0 0 0.0 1 1 0 lnx2633vm.internal.asp4all.nl 2017-02-21 10:34:16 Received: from m20.cal.mail.pl ([136.243.22.251]) by mx01-hvs1.solvinity.com with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Baruwa 2.0) (envelope-from LarsM�ller@faktura.dk) id 1cg7lY-00086L-BE ret-id none; for supportdk@philips-tvconsumercare.com; Tue, 21 Feb 2017 11:33:52 +0100 Received: from 173-16-236-120.client.mchsi.com ([173.16.236.120]) by m8.cal.mail.pl with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.84) (envelope-from LarsM�ller@faktura.dk) id 1cg7mh-0007IC-4B for supportdk@philips-tvconsumercare.com; Tue, 21 Feb 2017 11:35:06 +0100 Message-ID: 24DE961C70A48B28F4F1B80D99E08752@faktura.dk From: =?utf-8?B?TGFycyBNw7hsbGVy?= LarsM�ller@faktura.dk To: supportdk@philips-tvconsumercare.com Subject: Faktura for ordre nr.299098 Date: Tue, 21 Feb 2017 11:33:35 +0100 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_1027_01D28C36.5652B830" X-Priority: 1 X-MSMail-Priority: High X-Mailer: Microsoft Windows Live Mail 14.0.8117.416 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8117.416 deliver 0 0 1 Sophos: >>> Virus 'Mal/DrodZp-A' found in file ./1cg7lY-00086L-BE/faktura_939405.zip Possible Microsoft JScript attack (91faktura_939405.js)

When I manually delete the record, the error messages disappear and everything works OK again.

rmoesbergen commented 7 years ago

A copy of the database containing the 'stuck' message. baruwa2.db.zip

tomtakan commented 7 years ago

This has been “fixed” in the new release, if messages are spam or flagged for some other reason they will be deleted immediately. These malicious senders deliberatly mis encode their messages so they cannot be decode to utf8

On 02 Mar 2017, at 11:21, rmoesbergen notifications@github.com wrote:

On a number of systems, a message was 'stuck' in the /var/lib/baruwa/mailscanner/baruwa2.db

Also, this was logged for every message: Mar 2 10:19:16 lnx2633vm MailScanner[12118]: BaruwaSQL: Backup DB insert Fail

It might have something to do with (invalid?) unicode characters in the message. An example message that was stuck for weeks:

sqlite> select * from tm; 2017-02-21 10:34:16 1cg7lY-00086L-BE 15788 larsm�ller@faktura.dk faktura.dk supportdk@philips-tvconsumercare.com philips-tvconsumercare.com Faktura for ordre nr.299098 136.243.22.251 0 0 0 0 0 0 0.0 1 1 0 lnx2633vm.internal.asp4all.nl 2017-02-21 10:34:16 Received: from m20.cal.mail.pl ([136.243.22.251]) by mx01-hvs1.solvinity.com with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Baruwa 2.0) (envelope-from LarsM�ller@faktura.dk) id 1cg7lY-00086L-BE ret-id none; for supportdk@philips-tvconsumercare.com; Tue, 21 Feb 2017 11:33:52 +0100 Received: from 173-16-236-120.client.mchsi.com ([173.16.236.120]) by m8.cal.mail.pl with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.84) (envelope-from LarsM�ller@faktura.dk) id 1cg7mh-0007IC-4B for supportdk@philips-tvconsumercare.com; Tue, 21 Feb 2017 11:35:06 +0100 Message-ID: 24DE961C70A48B28F4F1B80D99E08752@faktura.dk From: =?utf-8?B?TGFycyBNw7hsbGVy?= LarsM�ller@faktura.dk To: supportdk@philips-tvconsumercare.com Subject: Faktura for ordre nr.299098 Date: Tue, 21 Feb 2017 11:33:35 +0100 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_1027_01D28C36.5652B830" X-Priority: 1 X-MSMail-Priority: High X-Mailer: Microsoft Windows Live Mail 14.0.8117.416 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8117.416 deliver 0 0 1 Sophos: >>> Virus 'Mal/DrodZp-A' found in file ./1cg7lY-00086L-BE/faktura_939405.zip Possible Microsoft JScript attack (91faktura_939405.js)

When I manually delete the record, the error messages disappear and everything works OK again.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/baruwaproject/baruwa2","title":"baruwaproject/baruwa2","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/baruwaproject/baruwa2"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"Some messages can't be restored from the backup log db (#120)"}],"action":{"name":"View Issue","url":"https://github.com/baruwaproject/baruwa2/issues/120"}}}

rmoesbergen commented 7 years ago

Good! I've just upgraded the last node, so this should no longer occur. Thanks!