Koozali.org: home of the SME Server

Virtual domain email help

Offline jaywid

  • 4
  • +0/-0
Virtual domain email help
« on: May 19, 2009, 08:17:32 PM »
Hi and thanks in advance.

I have an SME server handling and distributing email for several domains in different locations.  I have one location where I would like to be able to forward mail for 2 domains but on different ports (the mail has to end up on different servers).  What I am thinking is I should be able to set one domain up this way

"db domains setprop domain1.com MailServer 1.2.3.4"

and have the mail for domain1.com delivered on port 25 and I should be able to set the second domain up like

"db domains setprop domain2.com MailServer 1.2.3.4 PORT#"

to deliver mail for domain2.com on port 2525.

The problem being that I don't know and haven't been able to find the format I need to use to do this.

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Virtual domain email help
« Reply #1 on: May 20, 2009, 12:28:16 AM »
jaywid

Quote
The problem being that I don't know and haven't been able to find the format I need to use to do this.

You cannot just "make up" a command, and expect it will achieve the end result you are desirous of having !
It would be great if coding servers was as easy as that. Charlie Brady and others would have very little to do !
Unless the code base/template fragment code supports the command,
then "fictiously created commands" will not work.

Reading the template fragment code associated with a command will indicate to you the extent of possibilities, but you will obviously need to be able to understand the code, to some degree.

Quote
... I would like to be able to forward mail for 2 domains but on different ports (the mail has to end up on different servers). 

Why the need for different ports ?
I think you would have to change the default port that the sme mail server uses, and that then would apply to all mail.

Just issue the (supported) commands of

db domains setprop domain1.com MailServer 1.2.3.4
db domains setprop domain2.com MailServer 1.2.3.5
signal-event email-update

« Last Edit: May 20, 2009, 12:38:09 AM by mary »
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline jaywid

  • 4
  • +0/-0
Re: Virtual domain email help
« Reply #2 on: May 20, 2009, 01:10:41 AM »
Quote
You cannot just "make up" a command, and expect it will achieve the end result you are desirous of having !
Well, thank you for that enlightening and altogether useless statement.
Quote
I think you would have to change the default port that the sme mail server uses, and that then would apply to all mail.

Just issue the (supported) commands of

db domains setprop domain1.com MailServer 1.2.3.4
db domains setprop domain2.com MailServer 1.2.3.5
signal-event email-update

So, by your reasoning, (if you recall I mentioned several locations / domains are receiving mail distributed by this box, one of those locations contains 2 mail servers behind the same IP receiving mail for 2 different domains) I should change the SME box to deliver ALL mail on a different port, change ALL the other locations / domains to receive mail on this different, nonstandard port, move domain2.com from 1.2.3.4 to 1.2.3.5 (also receiving (of course) on this different, nonstandard port) and my problem is solved!

Again ... thanks.

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Virtual domain email help
« Reply #3 on: May 20, 2009, 01:21:18 AM »
jaywid

Quote
Well, thank you for that enlightening and altogether useless statement.

Please show some more sensible gratitude for my reply to you. It's not at all useless, it is very informative. You were clearly trying to use an unsupported db command.

Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Virtual domain email help
« Reply #4 on: May 20, 2009, 01:30:48 AM »
jaywid

My comment was meant to advise that the sme mail server component does not selectively support different ports, and that the only way of changing the port for one domain would be to change the default port that the mail server uses, which would therefore affect all domains.

The part I did not think it necessary to specify, is that doing so would not be a good idea as you will then have difficulty communicating with all other mail servers, but I assumed you would have known that.

Quote
... I have one location where I would like to be able to forward mail for 2 domains but on different ports (the mail has to end up on different servers).

Your question suggests you have two different servers, which I then assumed must have different IPs.
What I suggested was that you forward mail for domain2 to the appropriate servers IP (eg 1.2.3.5), and questioned the need to use different ports, wasn't that clear to you ?
« Last Edit: May 20, 2009, 01:37:34 AM by mary »
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline jaywid

  • 4
  • +0/-0
Re: Virtual domain email help
« Reply #5 on: May 20, 2009, 06:04:09 AM »
Quote
Your question suggests you have two different servers, which I then assumed must have different IPs.
What I suggested was that you forward mail for domain2 to the appropriate servers IP (eg 1.2.3.5), and questioned the need to use different ports, wasn't that clear to you ?

This is a helpful post, thank you.

The trouble is I have one location with 2 companies, 2 domains, 2 email servers and one public IP address and so I need to deliver mail for domain1 and domain2 to 1.2.3.4 and have it land on the appropriate server.  The reason I would like to be able to deliver mail on 2 different ports would be to deliver mail for domain1 on port 25, forward port 25 to domain1's email server, and deliver domain2's email on 2525 and forward 2525 to port 25 (on the firewall at the location) in order to deliver it to domain2's email server.

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Virtual domain email help
« Reply #6 on: May 20, 2009, 09:25:11 AM »
This is a helpful post, thank you.

The trouble is I have one location with 2 companies, 2 domains, 2 email servers and one public IP address and so I need to deliver mail for domain1 and domain2 to 1.2.3.4 and have it land on the appropriate server.  The reason I would like to be able to deliver mail on 2 different ports would be to deliver mail for domain1 on port 25, forward port 25 to domain1's email server, and deliver domain2's email on 2525 and forward 2525 to port 25 (on the firewall at the location) in order to deliver it to domain2's email server.

so, put another SME in that location in front of your mail servers ad use the syntax
Code: [Select]
    db domains setprop domain1.com MailServer 1.2.3.4
    db domains setprop domain2.com MailServer 1.2.3.5
    signal-event email-update

where 1.2.3.4 and 1.2.3.5 are, obviously, private address, or get another public ip

Ciao
Stefano

Offline mmccarn

  • *
  • 2,657
  • +10/-0
Re: Virtual domain email help
« Reply #7 on: May 20, 2009, 02:31:59 PM »
Here's the wiki page on configuring SME to support "internal" mail servers - including different servers for different domains: http://wiki.contribs.org/Email#Internal_Mail_Servers