Re: [Exim] relaying for another domain

Pàgina inicial
Delete this message
Reply to this message
Autor: Nico Erfurth
Data:  
A: exim-users
Assumpte: Re: [Exim] relaying for another domain
edouard.boucher@??? wrote:
> Hi,
>
> I am using a domainlist router to relay mail for another domain when it's smtp
> server is down. I store the mail for that domain in a single file in BSMTP format.
>
> Here is an extract from the exim FAQ :
>
> Large ISPs who provide this kind of functionality do not usually leave waiting
> mail on the MTA's queue. Instead, they get it delivered into per-host
> directories, one message per file, in one of the special formats (BSMTP,
> maildir, or mailstore)
>
> Why does the FAQ say the mail have to be stored in seperate file ?
> when I transfer the mails to the other host i think it cost less to transfer a
> single file than to open different file.

I could think of some reasons.

if you want to feed the messages back into you exim, you first read a
list of available bsmtp-files for this domain, and then pump them into
exim via exim -bS, if the messages fail again, they will be written to a
new file, instead of appended to your current one (if you use a
singlefile solution) this could end in a endless loop, or you have to
care about locking issues etc. etc.

> lets say the domain i relay is domain1.com
> when i receive a mail from the outside world for x@???, i store it in a
> BSMTP file, whithout even trying to transfer to it's MX, because if the message
> when to my smtp server, that means that the primary MX for domain1.com is down
> (my smtp server is the second MX)
>
> the problem is that when i send a mail to that domain from my smtp server, it is
> stored in that file without trying to contact it's primary MX.
>
> I would like for mail to domain1.com from my host to first try a normal
> lookuphost and then if it fails use the BSMTP transport.
>
> how can i set that ?


remove the no_more option from the lookuphost-router
add your bsmtp-router as the second router, and let it act only on the
domains you relay for (domains = +relay_domains) add a no_more to this
router.

Now run a script every 20 minutes are so, and feed the bsmtp-files back
into exim. the lookuphost router will try to send them, of this fails,
they will be written back to a new bsmtp-file.


ciao