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

Top Page
Delete this message
Reply to this message
Author: Muhammad Irfan
Date:  
To: Exim-users
Subject: Re: [exim] Exim: Select smarthost on basis of receipient address
Benson,

>> You can do it in Exim, though, but it would be more manual: if you give

both Exim instances a list of local parts in one of the locations (probably
China, for you) and deliver to that location when the local part is in that
(probably a lookup against a file), then go to the forward/accept router to
send mail to the other location. The domain being the same just means that
you have to do a bit more work to find where to deliver mail.

You mean i create an flat file which holds all china user names and made
appropriate changes in exim.conf on US primary exim server which will looks
for $local_part in file from router configuration and if found relay that
email to china and will land there in china user mailbox and if $local_part
not found in file than it will go to next router and deliever it locally
means if user not found in file list than that email is for US user.
*I thought it is nice which i can give a try.If is there any documentation,
howto or any article available to do this than please point.*
**
Question i had in mind through this i need to create china user mailboxes
on china only on mail1.example.com and US user mailboxes on US only
mail.example.com right ? And through this domain will be the same for all
users including US / China i.e. @example.com ?

If that was successfull i think i need to maintain china users file list in
china exim server also and will same way so when anyone sends an email from
china it will look into file that this email is for local china user if
yes, than deliever locally and if it is for US user than relay it to
mail.example.com in US.
i will add one more condition in send_to_gateway router in china that
whenever china user sends an email locally to it colleague (china user) it
will not relay email directly to mail.example.com in US instead first check
if user mailbox exists locally than deliver otherwise that email is for US
user usa-user@??? now relay it to US via route_list or route_data.
Is that correct ?

*send_to_gateway:
driver = manualroute
condition = ${if eq {${lc:$sender_address_domain}} {example.com} {true} fail }
domains = example.com
transport = remote_smtp
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
route_list = * example.com
host_find_failed = defer*

I appreciate your help in this regard.


On Fri, Feb 17, 2012 at 5:04 AM, Dominic Benson <dominic@???>wrote:

>
> On 16 Feb 2012, at 12:59, Muhammad Irfan wrote:
>
> > Yes, addresses of the form bob@???
> > corrected as follows:
> >
> > send_to_gateway:
> > driver = manualroute
> > domains = example.com
> > transport = remote_smtp
> > ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
> > route_list = * 69.16.197.150
> > host_find_failed = defer
> >
> > dnslookup:
> > driver = dnslookup
> > domains = ! +local_domains
> > transport = remote_smtp
> > ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
> > no_more
> >
> > 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
> >
>
> That looks fine to me.
>
>
> [snip]
> >
> > 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.
> >
> > Thanks,
> >
>
>
> I don't think that replicating mailboxes is the way to go. As I said
> before, if you're modifying it from both ends you're just making problems.
>
> You *can* have mailboxes in both places on the same domain. There are a
> few ways to do it; as I said before, I think that Cyrus is your best bet
> because it provides the ability to split mailboxes across multiple hosts,
> and connect via any. You don't have to maintain it all by hand that way.
>
> You can do it in Exim, though, but it would be more manual: if you give
> both Exim instances a list of local parts in one of the locations (probably
> China, for you) and deliver to that location when the local part is in that
> (probably a lookup against a file), then go to the forward/accept router to
> send mail to the other location. The domain being the same just means that
> you have to do a bit more work to find where to deliver mail.
>
>
> --
> ## 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/
>