MySQL Bayes and timeout in amavisd

Tom Hendrikx via amavis-users amavis-users at amavis.org
Fri Sep 27 12:01:49 CEST 2013


On 09/27/2013 10:50 AM, Stefan Jakobs via amavis-users wrote:
> 
> Hello list,
> 
> I like to re-ask my question from march this year, as it is still an issue:
> 
> I run a setup with postfix 2.5.13 and amavisd-new 2.7.2 in pre-queue 
> configuration. Spamassassin (3.3.2) uses a MySQL DB as bayes storage backend.
> When the MySQL DB is under high load amavisd takes too long to process a 
> message which causes postfix to reject messages and report "queue file write 
> errors". Below is the log of such a message as an example.
> I'm wondering why amavisd takes more than 2 hours to process that message and 
> doesn't quit after 120 seconds despite $child_timeout = 120?
> Is it possible to configure amavisd/spamassassin in such a way that it will 
> quit if it can not receive an result from the bayes DB in less than X seconds?
> 
> /etc/amavisd.conf:
> ....
> $child_timeout = 120;
> ....
> 
> /etc/postfix/main.cf:
> ....
> smtpd_proxy_timeout = 125
> ....
> 
> /etc/mail/spamassassin/local.cf
> ....
> use_bayes 1
> bayes_store_module Mail::SpamAssassin::BayesStore::MySQL
> bayes_sql_dsn DBI:mysql:spamassassin:db.example.com;mysql_client_found_rows=0
> ....
> 
> /var/log/mail.log:
> ....
> Mar 25 11:51:43 server postfix/smtpd[5706]: setting up TLS connection from 
> host.example.com[AA.BB.CC.DD]
> Mar 25 11:51:43 server postfix/smtpd[5706]: Anonymous TLS connection 
> established from host.example.com[AA.BB.CC.DD]: TLSv1 with cipher DHE-RSA-
> AES256-SHA (256/256 bits)
> Mar 25 11:51:43 server postfix/smtpd[5706]: NOQUEUE: 
> client=host.example.com[AA.BB.CC.DD]
> Mar 25 11:51:43 server amavis[3513]: (03513-10) ESMTP:[::1]:10024 
> /var/spool/amavis/tmp/amavis-20130325T113759-03513-W3bG5EF4: 
> <user at example.com> -> <myuser at mydomain.tld> SIZE=11623 Received: from 
> server.mydomain.tld ([IPv6:::1]) by localhost (server.rus.uni-stuttgart.de 
> [IPv6:::1]) (amavisd-new, port 10024) with ESMTP for <myuser at mydomain.tld>; 
> Mon, 25 Mar 2013 11:51:43 +0100 (CET)
> Mar 25 11:51:43 server amavis[3513]: (03513-10) Checking: NWnem1z1wdjP 
> [AA.BB.CC.DD] <user at example.com> -> <myuser at mydomain.tld>
> Mar 25 11:53:48 server postfix/smtpd[5706]: warning: timeout talking to proxy 
> localhost:10024
> 
> Mar 25 12:01:10 server postfix/smtpd[5706]: timeout after END-OF-MESSAGE from 
> host.example.com[AA.BB.CC.DD]
> Mar 25 12:01:10 server postfix/smtpd[5706]: disconnect from 
> host.example.com[AA.BB.CC.DD]

At this point, the remote host (host.example.com) has given up on you
and has disconnected because your server took too much time to return an
answer. A sane remote server would handle a timeout during transit as a
temporary error, and retry to send the same message again.

While this does not solve the amavis problem, your message is never
rejected by anyone. If the message isn't retried by host.example.com,
you discovered a bug in the remote mta.

The log also fails to show the queue write errors from postfix that you
mention.

Regards,
	Tom

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <http://lists.amavis.org/pipermail/amavis-users/attachments/20130927/f4cd3bc0/attachment.sig>


More information about the amavis-users mailing list