[Exim] Secondary MX - defer if primary is up

Pàgina inicial
Delete this message
Reply to this message
Autor: Stephen Gran
Data:  
A: exim-users
Assumpte: [Exim] Secondary MX - defer if primary is up
Hello all,

I know I have seen references to doing this, but I can't find them now.
What I want to have is a secondary MX that, when it receives a rcpt to,
attempts to query the primary, and do the following:
2xx - defer (I don't want ot accept if the primary is up)
5xx - reject
4xx or no response - accept. This is the only valid use of the backup,
as I see it, anyway.

I have tried

defer  message  = The primary MX is up, please try them
       verify   = recipient/callout=30s,no_cache
       domains  = +backup_domains


accept domains  = +backup_domains
       endpass
       message  = No such user
       !verify  = recipient/callout=30s,defer_ok,no_cache,use_sender


But if the primary is down, the defer defers, and I get a 4xx message,
which is not what I'm trying to do. This is the output of a -bhc run:
>>> check verify = recipient/callout=30s,no_cache
>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>> routing foo@???
>>> example.com in "+relay_to_domains"? no (end of list)
>>> example.com in "+relay_to_domains"? no (end of list)
>>> example.com in "+local_domains"? no (end of list)
>>> example.com in "! +local_domains : ! +relay_to_domains"? yes (end of list)
>>> calling dnslookup router
>>> example.com in dns_again_means_nonexist? no (option unset)
>>> dnslookup router: defer for foo@???
>>> message: host lookup did not complete
>>> ----------- end verify ------------
>>> defer: condition test deferred

451 Temporary local problem - please try later
LOG: H=mail.example.com [xxx.xxx.xxx.xxx] F=<rradmin@???> temporarily rejected RCPT foo@???: host lookup did not complete

Names changed because they aren't particualrly relevant to the problem,
I don't think - I'm trying to solve a general problem and picked a host
(not one of mine) that I happen to know is down at the moment for
testing of the idea.

TIA,
--
--------------------------------------------------------------------------
|  Stephen Gran                  | If I have trouble installing Linux,     |
|  steve@???             | something is wrong. Very wrong.         |
|  http://www.lobefin.net/~steve | -- Linus Torvalds                       |

--------------------------------------------------------------------------