Re: [exim] test database conn to prevent rejecting messages

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Brent Jones
Datum:  
To: Graeme Fowler
CC: exim-users
Betreff: Re: [exim] test database conn to prevent rejecting messages
What about extending the "defer_ok" function to ACLs other than callouts
and virus scanning?
That way, if you have an ACL that does a DB lookup, you can add the
/defer_ok switch to the condition, and allow that ACL to accept itself if
there is a problem?

If you do this on blacklist or whitelist style ACLs, and not actual user
lookups or routers, you can safely pass them, error on the side of caution
if you wanted to just accept the message.
I'll look at the source, to see what that defer_ok looks like


On Sat, Oct 5, 2013 at 8:31 AM, Graeme Fowler <graeme@???> wrote:

> On Fri, 2013-10-04 at 18:16 -0400, josh trier wrote:
> > I am writing an ACL that a few of my relay servers will use. All is fine
> > with code. However if the central database server can not be connected
> to I
> > want to disable the ACL to prevent messages from being rejected.
> >
> > Right now this is what happens if DB conn fails (example of stopping
> mysqld
> > service)
> >
> > SMTP>> 451 Temporary local problem - please try later451 Temporary
> > local problem - please try later
> > LOG: MAIN REJECT
> >   H=localhost [127.0.0.1] F=<root@???> temporarily
> > rejected after DATA: MYSQL     connection failed: Can't connect to
> > local MySQL server through socket '/var/lib/mysql/mysql.sock'    (2)

>
> Although that is indeed a rejection, it's a temporary one. Well-behaved
> remote servers receiving that will simply re-queue the mail and try
> again later.
>
> Jasen's readsocket approach might have legs, but I think I'd create a
> shell or perl script that can give you a "DB is available" or "DB is
> dead" response and call that from a warn statement using $run.
>
> That way you could set a variable and check for its value in later ACLs,
> at the cost of making one extra DB connection per message.
>
> How to do that will be left as an exercise :)
>
> Graeme
>
>
> --
> ## List details at https://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/
>




--
Brent Jones
brent@???