Koozali.org: home of the SME Server

This must be simple. 2 domains, 1 forwarded to exchange box.

Pete the Feet

This must be simple. 2 domains, 1 forwarded to exchange box.
« on: September 17, 2003, 07:34:55 PM »
Hiya

Just trying to solve a little puzzle here at work. :-)

We would like to use an e-smith box (on orange (DMZ) network of smoothwall / ipcop firewall) as a mail server for two domains, let us call them foo.com and foo.co.uk

All mail coming in to users at foo.com is to be stored in user mailboxes.  This is so users can pop in themselves and pick it up (15 mailboxes max, pretty low volume). This bit is easy, and works out of the box.

All mail coming in to users at foo.co.uk should be forwarded to an MS Exchange server on the green network (25 mailboxes max, pretty low volume).  This is the tricky bit. At the moment we have set up a username for each exchange user on the e-smith box, and a pop3 plugin for exchange then pops the mail from the e-smith box to the exchange box.  HOWEVER, the e-smith frequently flakes out (too many pop3 connections) and this is therefore not a viable solution.

I would like the e-smith box to simply forward all mail address to any user at foo.co.uk to the exchange box.  I have seen smtproute mentioned a few times, but am not sure if this is the way forward....

Anyone else achieved or looking at this? and would care to gently poke me in the right direction? We're runnning e-smith 5.6, and I've canned Squid as its not required.

TIA

Pete

Pete the Feet

Re: This must be simple. 2 domains, 1 forwarded to exchange
« Reply #1 on: September 19, 2003, 04:09:37 PM »
Pete the Feet wrote: some progress made, comments inline.

>
> Hiya
>
> Just trying to solve a little puzzle here at work. :-)
>
> We would like to use an e-smith box (on orange (DMZ) network
> of smoothwall / ipcop firewall) as a mail server for two
> domains, let us call them foo.com and foo.co.uk

e-smith 5.6 box set up as mail.foo.com, with foo.co.uk as a virtual domain
 
> All mail coming in to users at foo.com is to be stored in
> user mailboxes.  This is so users can pop in themselves and
> pick it up (15 mailboxes max, pretty low volume). This bit is
> easy, and works out of the box.

yup, tis okay.
 
> All mail coming in to users at foo.co.uk should be forwarded
> to an MS Exchange server on the green network (25 mailboxes
> max, pretty low volume).  This is the tricky bit. At the
> moment we have set up a username for each exchange user on
> the e-smith box, and a pop3 plugin for exchange then pops the
> mail from the e-smith box to the exchange box.  HOWEVER, the
> e-smith frequently flakes out (too many pop3 connections) and
> this is therefore not a viable solution.

I setup a template fragment doing the following:

[root@e-smith]# mkdir -p /etc/e-smith/templates-custom/var/qmail/control/smtproutes

[root@e-smith]# cd /etc/e-smith/templates-custom/var/qmail/control/smtproutes

[root@e-smith]# echo foo.co.uk:1.2.3.4:25 > foo.co.uk

[root@e-smith]# /sbin/e-smith/expand-template /var/qmail/control/smtproutes

[root@e-smith]# /etc/rc.d/init.d/smtpfront-qmail restart
 
But mail sent to whoever@foo.co.uk still ends up in the mailbox of whoever@foo.com, not forwarded to the mailserver at 1.2.3.4:25.

Any idea where I'm going wrong?

> I would like the e-smith box to simply forward all mail
> address to any user at foo.co.uk to the exchange box.  I have
> seen smtproute mentioned a few times, but am not sure if this
> is the way forward....
>
> Anyone else achieved or looking at this? and would care to
> gently poke me in the right direction? We're runnning e-smith
> 5.6, and I've canned Squid as its not required.
>
> TIA
>
> Pete

Jon Roberts

Re: This must be simple. 2 domains, 1 forwarded to exchange
« Reply #2 on: September 24, 2003, 07:13:48 PM »
Pete,

Not sure if this will work, but its an idea .....

If your problem is too many pop3 connections, could you work around this by forcing all mail for the exchange server into a single account on the e-smith.  You could do this either by using the admin account & setting unrecognised mail to direct to admin (rather than reject) - or by using pseudonyms for the other domain to redirect by name to a single account.

Set exchange to check the e-smith regularly and treat it as a multidrop POP mailbox.  Exhchange can handle this & will then pick up the mail from the e-smith & put it in the local mailboxes.

I'm pretty sure exchange can do this and I've done something similar with 2 e-smith boxes before when testing.  Config of this was:

1. Number of external domains all directing e-mail to a single POP account
2. e-smith server configured for Multidrop picks up all mail for this account.
3. Domains for first e-smith server set up as virtual domains, but the domains for second server not specified.
4. Mail for unspecified domains routed to admin account.
5. Second e-smith server configured with appropriate domain and also set a multidrop server.  pop account details are admin account on 1st e-smith.
6. second e-smith happily picks up mail & directs to correct accounts (assuming they exist on that server)

Bear in mind that all unknown mail will route to the second server if you do this, which may not be what you want.

I'm sure there must be a better way configuring the SMTP server but that's beyond me - sorry.

Pete the Feet

Re: This must be simple. 2 domains, 1 forwarded to exchange
« Reply #3 on: September 24, 2003, 07:20:00 PM »
Problem solved:

Foo.co.uk added to smtproutes and mail forwarded to Username@foo.co.uk

Passes the mail straight to the exchange server, works like a charm.