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

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Muhammad Irfan
Date:  
À: Exim-users
Sujet: Re: [exim] Exim: Select smarthost on basis of receipient address
Benson,

I am using CENTOS 5.
The only reason i am relaying emails from china (mail1.example.com SMTP) to
US host contains all user mailboxes including china & US users on (
mail.example.com). While if china users sends an email to external domains
i want those emails to send through china SMTP mail1.example.com because
most of the china users sends emails within china to external domains
through this they don't have to route to US host mail.example.com 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 mail1.example.com 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 mail.example.com. 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.

For email client for china users i will declare mail.example.com in
incoming mail server to fetch emails from US host mail.example.com and will
set mail1.example.com 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 = mail.example.com
transport = remote_smtp
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
route_list = * mail.example.com
host_find_failed = defer
no_more

dnslookup:
driver = dnslookup
domains = ! +local_domains : mail.example.com
transport = remote_smtp
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
no_more

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

> On 16/02/12 10:17, Dominic Benson wrote:
>
>> On 16/02/12 08:26, Muhammad Irfan wrote:
>>
>>> <https://mail.google.com/>**Hello,
>>>
>>> I know smarthost selection can be done on basis of sender_address.
>>> i found following two URL's are good resources for that.
>>>
>>> http://www.volker-wegert.de/**en/node/35<http://www.volker-wegert.de/en/node/35>
>>> http://www.tgunkel.de/docs/**exim_smarthosts.en<http://www.tgunkel.de/docs/exim_smarthosts.en>
>>>
>>> But is that possible on basis of recipient address? I need whenever my
>>> domain user send an email to same domain user it will relay to another
>>> server e.g. abc@??? sends an email to xyz@??? it need to
>>> relay on mail.example.com SMTP.
>>> And when my domain user sends an email to external domain it will go
>>> through locally by dnslookup. e..g abc@??? sends an email to
>>> hotmail,yahoo, gmail it needs to go through locally from
>>> mail1.example.comSMTP.
>>>
>>
>> The manualroute router is what you need here - full docs on it are at
>> http://www.exim.org/exim-html-**current/doc/html/spec_html/**ch20.html<http://www.exim.org/exim-html-current/doc/html/spec_html/ch20.html>
>>
>> In short, specify
>> domains=example.com
>> route_data=mail.example.com
>> transport=remote_smtp
>>
>> If you're on a Debian-ish setup, then router/150_exim4-config_**hubbed_hosts
>> contains a good generalised implementation
>>
>>
>>
>> It occurs to me that there are a couple of other thing I should say on
> this:
>
> - If all the mailboxes are on the US host, couldn't you just use dnslookup
> for *all* outbound mail - as there is no local delivery, your MX need only
> refer to the primary (US) site. The only reason not to (that I can think
> of) would be if you want to send to a backend host with a firewall
> exception, bypassing the normal frontend MXes. If you can, then it would
> remove some maintenance overhead.
>
> - Depending on your existing routers and the domains they handle, you may
> need to be careful about the router order. It needs to be before any other
> router that would (but shouldn't) handle the domain.
>
>
>
> --
> ## List details at https://lists.exim.org/**mailman/listinfo/exim-users<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/
>