Re: [exim] Exim: Select smarthost on basis of receipient add…

Top Page

Reply to this message
Author: Muhammad Irfan
To: Exim-users
Subject: Re: [exim] Exim: Select smarthost on basis of receipient address
Yes, addresses of the form bob@???
corrected as follows:

driver = manualroute
domains =
transport = remote_smtp
ignore_target_hosts = :
route_list = *
host_find_failed = defer

driver = dnslookup
domains = ! +local_domains
transport = remote_smtp
ignore_target_hosts = :

Also tested will exim -bt command and looks OK to me. Let me know if you
still found any issues in it.

$ exim -bt bob@???
router = send_to_gateway, transport = remote_smtp

$ exim -bt bob@???
router = dnslookup, transport = remote_smtp

Also, as i said i am doing this because my china office colleagues having
problems to send huge emails along with attachments because of connectivity
and bandwidth limitation between US / China. From this now china users can
directly send email to external domains from china DC SMTP
mail1.example.comand if they need to send email within same domain @ email will relay from china SMTP to SMTP primary MTA in US DC which contains all users
mailboxes including US and China users.
Hopefully, above settings will eliminate email sending issues.The only
thing i need to do for china users they need to set china DC SMTP in email client.

Further, only one issue still persists, need to reslove that.
That is when an external user let say an external domain user in china
user@??? sends an attachment to bob@??? (bob is in china
office) it is problematic. Most of the time we don't recieve attachments
again becz of connectivity issues b/w China US as our mailboxes are hosted
in US DC.
At this point i am also thinking to move all china users mailboxes to China
DC on so china external users our customers can easily
send emails to our china users. But the only limitation is that i don't
want to separate mailboxes domain name regionally. i.e. i don't want to
move china user mailboxes from US DC server to in china because of domain name
I don't want to change domain for china user.
Is there any way in exim to replicate mailboxes ? so i can replicate china
user mailboxes from US DC primary MTA to secondry SMTP.
Is there any possibliity without changing domain name for any user i can
improve email receive mechanism.
Any suggestion.
And sorry for long post.

Waiting for your reply.


On Thu, Feb 16, 2012 at 5:27 PM, Dominic Benson <dominic@???>wrote:

> On 16/02/12 10:56, Muhammad Irfan wrote:
>> Benson,
>> I am using CENTOS 5.
>> The only reason i am relaying emails from china ( SMTP)
>> to
>> US host contains all user mailboxes including china& US users on (
>> While if china users sends an email to external
>> domains
>> i want those emails to send through china SMTP because
>> most of the china users sends emails within china to external domains
>> through this they don't have to route to US host and
>> than
>> it delievers back in china. I am having huge no. of complains from china
>> users when sending emails with attachments. Fortunately i have machine in
>> china DC. I installed exim on it and configured as STMP server for china
>> users.
>> I foresee sending emails from china to china host will
>> improve email sending. Further, i will authenticate all china users via
>> STMP AUTH through /etc/exim/passwd file and will store china users info
>> there to authenticate. While for email recieving china users still need to
>> fetch emails from US At this point i am also looking to
>> replicate china user mailboxes from US to china host through unix rsync
>> command. Don't know it's suitable or not.
> I think that would be tricky. Especially with deletes - because the delete
> would happen on one server, and then probably be undone. And the 'new'
> state of messages would be constantly clobbered.
> I would think that it would be considerably easier to split the mailboxes
> between the two, as has already been suggested. Cyrus with Murder is
> probably the easiest way to do it. It also has the advantage that mailboxes
> can be moved and clients updated independently. And that roaming users can
> always connect to the closest regardless of where their mailbox really
> resides.
>> For email client for china users i will declare in
>> incoming mail server to fetch emails from US host and
>> will
>> set in outgoing mail server option to send email for
>> china users.
>> I declared send_to_gatewary router just above dnslookup as follows.
>> Also, please check following routers those will work as anticipitation ?
>> And help me on this this solution is appropriate for my situation or not.
>> Thanks in advance.
>> send_to_gateway:
>> driver = manualroute
>> domains =
>> transport = remote_smtp
>> ignore_target_hosts = :
>> route_list = *
>> host_find_failed = defer
>> no_more
>> dnslookup:
>> driver = dnslookup
>> domains = ! +local_domains :
>> transport = remote_smtp
>> ignore_target_hosts = :
>> no_more
> Well, if I read your previous posts correctly then domains should be
> - i.e. your users have addresses of the form bob@???;
> not bob@???
> The domains condition on the dnslookup router is wrong (I think) - see
> ch10.html#SECID76<>for an explanation of how negative list items work
> - As it is after a router which would handle (once
> corrected), then it isn't necessary to exclude anyway, so you
> could just drop the second part
> - If you did need to exclude multiple host lists, I think you would have
> to negate each one. Or possibly you can negate the entire condition
> (!domains=...), it works in an ACL, but I don't know if it does in a router
> definition.
> --
> ## List details at**mailman/listinfo/exim-users<>
> ## Exim details at
> ## Please use the Wiki with this list -