Koozali.org: home of the SME Server

Email passthrough for one domain to another sme server from primary

Offline pcdoc

  • *
  • 56
  • +0/-0
I have a situation where I have multiple domains on the main gateway server for our network, and I need a second server only mail server inside on the local network for a different domain.

I have setup proxypass and that works well to get web pages etc. I can send mail out from the internal server to the outside world, but when I send email in, they get redirected at the primary server to the primary domain name.

IE, local network mail server is mail.localnet.net.au, gateway domain is mail.gateway.net.au. Mail coming in for info@localnet.net.au does not get past the mail.gateway.net.au.

/var/log/qmail/current shows mail comes in and starts delivery to local alias-localdelivery-info@localnet.net.au, then a couple of lines further shows starting delivery to local info@mail.gateway.net.au

I had a look at httpd.conf and it shows virtual domain 0.0.0.0:443 as being correct to redirect to the internal IP.

I have very little hair left now as most of it has been pulled out. I have been googling and hunting through forums for too many hours.

Please help if you have done this before, or even if you can point me in the correct direction.

Thank you.
There are 10 types of people in this world,
   Those that know binary, and those who don't!

Offline _alex

  • ***
  • 103
  • +0/-0
Re: Email passthrough for one domain to another sme server from primary
« Reply #1 on: August 15, 2013, 07:07:30 PM »
hi,
here's an example for a couple of domains:

Code: [Select]
mkdir -p /etc/e-smith/templates-custom/var/qmail/control/smtproutes
echo "adomain.com:smtp.aserver.com" > /etc/e-smith/templates-custom/var/qmail/control/smtproutes/10routes
echo "anotherdomain.com:192.168.20.3" >> /etc/e-smith/templates-custom/var/qmail/control/smtproutes/10routes
signal-event email-update

in this example, messages for domain adomain.com are relayed to external smtp.aserver.com, and messages for domain anotherdomain.com are relayed to internal server 192.168.20.3

HTH

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Email passthrough for one domain to another sme server from primary
« Reply #2 on: August 15, 2013, 07:46:06 PM »
There's no need for a custom template for that. Just do:

db domains setprop adomain.com MailServer smtp.aserver.com
db domains setprop anotherdomain.com MailServer 192.168.20.3
signal-event email-update

Offline pcdoc

  • *
  • 56
  • +0/-0
Re: Email passthrough for one domain to another sme server from primary
« Reply #3 on: August 15, 2013, 07:55:49 PM »
Thanks Charlie, yours seems to have done the trick. I hunted through the forums and wiki and could not find that info. Guess I have to look harder next time.

Cheers
There are 10 types of people in this world,
   Those that know binary, and those who don't!

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: Email passthrough for one domain to another sme server from primary
« Reply #4 on: August 15, 2013, 09:22:50 PM »
pcdoc

Quote
I hunted through the forums and wiki and could not find that info. Guess I have to look harder next time.

No need to look harder, just read the published information !
See the link at the top of this very Forum page to the FAQ.
Please peruse/read all of that as it has a wealth of information, including the answer to your problem, under the Section 4 - Email - Internal Mail Servers
It has been there for many years now.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.