We're using MySQL to enforce load-balancer-compatible sending limits 
using the RCPT and DATA ACL's in Exim 4.69:

acl_check_rcpt:
drop    condition = ${if > {${eval: $rcpt_count + ${lookup mysql{SELECT 
count FROM mailcount_$tod_logfile WHERE ip = '$sender_host_address'}}}} 
{1000} {yes}{no}}
        message = Message would exceed 1000 recipient limit for 
$sender_host_address

acl_check_data:
warn    continue = ${lookup mysql{INSERT INTO mailcount_$tod_logfile (ip, 
count) VALUES('$sender_host_address', $rcpt_count) ON DUPLICATE KEY 
UPDATE count=count+VALUES(count);}}

When MySQL is unavailable, the warn continue statement fails quietly and 
doesn't interrupt delivery. However, since the RCPT ACL uses a drop 
condition, all incoming mail is deferred when MySQL is down:

30625 lookup deferred: MYSQL connection failed: Can't connect to MySQL 
server on '192.168.X.X' (111)
30625 drop: condition test deferred
30625 SMTP>> 451 Temporary local problem - please try later
30625 LOG: MAIN REJECT
30625   H=(t) [127.0.0.1] F=<[EMAIL PROTECTED]> temporarily rejected 
RCPT [EMAIL PROTECTED]: MYSQL connection failed: Can't connect to 
MySQL server on '192.168.X.X' (111)
30625 LOG: lost_incoming_connection MAIN
30625   SMTP command timeout on connection from (host) [SENDER.HOST.IP]
30625 SMTP>> 421 servername: SMTP command timeout - closing connection

Is there any way to enable a "defer_ok" or equivalent functionality in 
this case?

Thanks!

Rich Sandberg
[EMAIL PROTECTED]


-- 
## List details at http://lists.exim.org/mailman/listinfo/exim-users 
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

Reply via email to