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

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Dominic Benson
Ημερομηνία:  
Προς: exim-users
Αντικείμενο: Re: [exim] Exim: Select smarthost on basis of receipient address
On 16/02/12 10:56, Muhammad Irfan wrote:
> 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.

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 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

>


Well, if I read your previous posts correctly then domains should be
example.com - i.e. your users have addresses of the form
bob@???; not bob@???

The domains condition on the dnslookup router is wrong (I think) - see
http://www.exim.org/exim-html-current/doc/html/spec_html/ch10.html#SECID76
for an explanation of how negative list items work
- As it is after a router which would handle example.com (once
corrected), then it isn't necessary to exclude example.com 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.