Koozali.org: home of the SME Server

Forward mail for virtual domain to external server

Offline Brenno

  • *****
  • 208
  • +0/-0
Forward mail for virtual domain to external server
« on: December 05, 2005, 07:17:20 PM »
Hey all,

I host 3 virtual domains on my 6.0 machine, and need to forward all email for one of these virtual domains to an external mail server.  Currently, my MX records point to this external server, so new email coming in from the "wild" go there just fine, but any email from other domains hosted on the 6.0 machine still end up on the 6.0 machine.  Users are having to get mail from both servers.

I know Dungog has a package to do this, but I only need this for about 1 month and can't justify the expense for one rpm for one month.

Is there a way to do this from the Configuration > Hostnames and Addresses panel?

cc_skavenger

Forward mail for virtual domain to external server
« Reply #1 on: December 07, 2005, 03:47:09 AM »
that is correct.  You would change the mail from self to remote and put in the IP.

HTH

Offline Brenno

  • *****
  • 208
  • +0/-0
Forward mail for virtual domain to external server
« Reply #2 on: December 07, 2005, 03:53:51 AM »
CC,

Thanks for the reply.  Just to clarify, I change the mail.mydomain.com hostname to remote and plug in the IP?  That's all? Sounds too simple :)

cc_skavenger

Forward mail for virtual domain to external server
« Reply #3 on: December 07, 2005, 02:23:39 PM »
that is correct.  You are just configuring the DNS server on your server to have the correct entry.

HTH

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Forward mail for virtual domain to external server
« Reply #4 on: December 08, 2005, 04:28:28 AM »
Quote from: "Brenno"
CC,

Thanks for the reply.  Just to clarify, I change the mail.mydomain.com hostname to remote and plug in the IP?  That's all? Sounds too simple :)


Yes, it is too simple. It won't work. That will just change the DNS entry for mail.mydomain.com. It won't stop the server from handling mail for mydomain.com.

The server will handle mail for all virtual domains it is configured to handle. There's no simple way to change that. But since you don't want the server to handle the virtual domain (mail and web), then I presume you only want it to handle web for that domain. Why don't you set up www.mydomain.com as a virtual domain rather than mydomain.com?
Then mail for mydomain.com will be handled just the same as for any other domain.

KelvinLee

Forward mail for virtual domain to external server
« Reply #5 on: December 10, 2005, 12:42:44 AM »
Would the qmail smtproute entry do the job ?

Kelvin

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Forward mail for virtual domain to external server
« Reply #6 on: December 10, 2005, 05:07:41 PM »
Quote from: "KelvinLee"
Would the qmail smtproute entry do the job ?


Firstly, what smptroute entry?

Secondly, I don't think so. I think that virtualdomains is checked before smtproutes, so mail would still be treated as local.

What's wrong with my simple suggestion?

KelvinLee

Forward mail for virtual domain to external server
« Reply #7 on: December 11, 2005, 10:49:48 PM »
OK, without knowing the exact mechanics of how SME (or qmail) handles the e-mail internally, this suggestion is purely guesswork (hence the question mark at the end of my suggestion).

Case Study
In a previous setup, there was a SME server that needed to host a couple of virtual domains' web and mails but the primary domain's e-mails was to be handled by an internal Exchange server. We could not use the delegate mail server option as this delegates all mails not just the main domain's mails to the delegate server. Therefore, we used qmail's smtproute to route all mails bound for the main domain to the Exchange Server and kept all other virtual domains on the SME and this worked fine.

Noted that this is slightly different from Brenno's requirement's as he is aiming to redirect a Virtual domain's mails and not the main domain's mails. But as mentioned above, without knowing if SME (or qmail, or whichever component in the server) treats the main domain's mails differently to virtual domains' mails, it is reasonable to make the assumption that smtproutes might do the job in this situation as well and might be worth a shot (I thought in the Linux world, nothing ventured nothing gained ?).


Kelvin

Offline Brenno

  • *****
  • 208
  • +0/-0
Forward mail for virtual domain to external server
« Reply #8 on: December 12, 2005, 11:20:57 PM »
Quote from: "CharlieBrady"
Yes, it is too simple. It won't work. That will just change the DNS entry for mail.mydomain.com. It won't stop the server from handling mail for mydomain.com.

The server will handle mail for all virtual domains it is configured to handle. There's no simple way to change that. But since you don't want the server to handle the virtual domain (mail and web), then I presume you only want it to handle web for that domain. Why don't you set up www.mydomain.com as a virtual domain rather than mydomain.com?
Then mail for mydomain.com will be handled just the same as for any other domain.


Charlie,

You were right - this isn't working at all.  I will try your suggestion of setting up "www.domain.com" instead of just "domain.com".  Then I can remove the "domain.com" virtual domain and it should route externally. I'll let you know by way of post if this works out.

Offline Brenno

  • *****
  • 208
  • +0/-0
Forward mail for virtual domain to external server
« Reply #9 on: December 13, 2005, 02:52:55 PM »
Charlie,

Thanks for the simple yet effective tip.  This is working like a charm.