0

Exim4 send using smarthost, if smarthost down then send directly.

How can I achieve that?

Aaron Hall
  • 296
  • 3
  • 12
shamil
  • 1
  • It doesn't really. I assume you are talking about mail. Fail-overs for mail sending is normally done with dns mx records.By the sounds of it you want to first attempt a connection to a remote smtp server and in the event it is not contactable opt to send either using some built-in smtp service or contact the first available mail server on the rcpt's domain. If I wanted to do this I would do it programmatically, in which case you may want to ask stackoverflow. That being said I don't use either exim4 or smarthost, so I opted to post this as a comment. – Matt Dec 31 '10 at 04:09

1 Answers1

1

The way I'd do this would be to write a script that detected whether or not the smarthost was up or down, and returned 0 or 1 accordingly. Then you could configure your router with the following:

condition = ${run{/my/magic/script.sh}{1}{0}} 

If the smarthost is up If the smarthost is down, the router condition will fail, and Exim will jump down to the next router until it finds the direct SMTP router.

growse
  • 8,020
  • 13
  • 74
  • 115
  • nice idea! Thanks for sharing. I also would have written a scrpit but toggle exims config instead and do a reload. – ThorstenS Dec 30 '11 at 14:44