Koozali.org: home of the SME Server

Email: Users split over 2 or more sites.

Offline Peasant

  • *
  • 143
  • +2/-0
Email: Users split over 2 or more sites.
« on: February 08, 2008, 11:53:35 PM »
I've been asked to set up a file/print/e-mail server for a local company, and sme fits the bill pretty much all the way. I'm anticipating hitting a snag with e-mail setup though, and would appreciate the panel's thoughts.

The company have an office in my local town, one in England, and one in USA. The company domain (mycompany.com) is hosted in the US. I was meaning to set up SME in the local office with the domain name mycompany.com, as they want to use the mycompany.com domain for e-mail. All mail sent to users at the local office would go to a drop box, and SME would collect from it. This means asking the hosting company in the US to forward all mail for the local office users to the drop box, which is not a problem.

The problem comes with sending e-mail. If an e-mail is sent to an external address it will work fine, however, if an e-mail is sent to a person in the US office say, then as I understand things, SME will try to send it locally, rather than sending it over the Internet.

How can I get round this problem?

Cheers
Jim

Offline raem

  • *
  • 3,972
  • +4/-0
Re: Email: Users split over 2 or more sites.
« Reply #1 on: February 09, 2008, 04:41:35 AM »
Peasant

Personal preferences or opinion will probably decide the answer.

1) Set a different domain name on each box, as you say the web site is hosted externally then there is no real reason to have the matching main domain name on both boxes.

a) Have different email addresses for the staff in USA & UK ie
user@domain for USA
user@domain2 for UK


2) Alternatively use one box with the main domain name to act as the main mail server for both locations, say the USA office, and configure all USA & UK users in that box, but set the UK users to forward to UKuser@domain2. The other server in UK is configured with domain2 and only has the UK users configured
In this case the public address for all users is user@domain
Yes mail sent from UK will go to USA and back to UK, that's the limitation of having one server as the master mail server. The same thing happens with every mail server in the world.
UK users can alway send direct to UKuser@domain2 if they want, and it will never leave the UK sme server in that case.

The sending domain in all cases is configured in the email client (ie the return address), so it does not really matter what domain name the server has.
...

Offline Peasant

  • *
  • 143
  • +2/-0
Re: Email: Users split over 2 or more sites.
« Reply #2 on: February 09, 2008, 11:17:23 PM »
Thanks for that. It almost answers my question, but not quite :-)

My original plan was to run SME in server only mode behind a firewall, with all mail being collected from an ISP drop box. This would allow them to turn off the machine overnight should they wish. Let us say that I go with your second solution, in that my SME box has the domain mycompany.uk.com, and the main server in the USA (mycompany.com) forwards mail to it. For your solution to work I would have to firstly register a domain (mycompany.uk.com), and secondly get a hosting package that gave me a drop box. (As an alternative to getting a hosting package I could set SME as a proper mail server, and have the domain MX record point to it. This would mean the SME machine would need to be on 24/7.)

I would then set SME up with the domain mycompany.uk.com, and set it to collect e-mail from the drop box.

Would this actually work? Let us say I have a user Joe Bloggs in the UK. He is given an e-mail account in the USA of joeb@mycompany.com, and all mail is forwarded to joeb@mycompany.uk.com. Would SME not take a look at any e-mail sent, see it is for joeb@mycompany.com, and say 'this domain does not exist here' and reject the e-mail?

TIA
Jim

Offline raem

  • *
  • 3,972
  • +4/-0
Re: Email: Users split over 2 or more sites.
« Reply #3 on: February 10, 2008, 08:05:05 AM »
Peasant

Quote
...say that I go with your second solution, in that my SME box has the domain mycompany.uk.com, and the main server in the USA (mycompany.com) forwards mail to it.

Firstly the mail server parts of sme still work whether the box is in gateway & server mode or server only mode. Only private server mode disables many external services, and rightly so as it is in "private" mode which means it cannot be seen from the Internet and no ports are open.

OK, if you set your USA server with mydomain.com, then I suggest the following.

You can obtain a perfectly functional and free domain from dyndns.com (and many other free domain name providers) eg mydomain.dyndns.org (or other variants), and give your UK box that domain.
Note that in Australia real au domains cost approx $AUD45 for two years, so that's not a real significant cost for any business, if you prefer to register a "real" domain.
For a "real" domain, you can get free DNS hosting at www.zoneedit.com, and configure and maintain it yourself, quite easily.

I would forget the drop box idea as it's not really necessary, just use both servers as smtp mail servers, which in most default configurations is already running. If the UK server is turned off overnight, then qmail on the USA server will queue the mail for delivery when it cannot get a connection with the smtp mail server on the UK server. It will keep trying to deliver the messages for 7 days before it finally gives up and sends the original sender an undeliverable message, but of course the UK server will come back on in that time and accept the mail messages (on the next scheduled retry).

Of course it will work.
In server manager you configure the user accounts (for UK users) in the USA box, to deliver all mail to UKuser1@mydomain.dyndns.org (or whatever domain you chose). When mail for UKuser1@mydomain.com arrives at the USA server it automatically gets forwarded to the nominated users address.
As mentioned above if the UK smtp server is offline, then the USA server will queue the messages to retry delivery later.

The domain name mydomain.com exists anywhere in the world (that's what DNS & MX records are for), and so therefore does UKuser@mydomain.com and USAuser@mydomain.com.
The sme server's smtp server will send email to the correct external smtp server that is configured for email for the domain used in the email address.

As sme is easily maintained remotely, then it's just as easy to configure users on the USA server from the UK, as it is to do so locally (& vice versa).
...

Offline p-jones

  • *
  • 594
  • +0/-0
Re: Email: Users split over 2 or more sites.
« Reply #4 on: February 10, 2008, 10:53:02 AM »
If your domain is hosted externally, I would suggest you set up each server as a "local" domain (eg myukcompany.local, mysucompany.local) ) and add the main domain into the domain list.

I have gotten into a bit of strife with DNS by using the registered domain name as the main domain name for the server when the services were hosted off site as exactly as you described.

I think the minimum you requre at the remote office is a fixed IP so your abroad users can be forwarded to the server at that IP. Once again, I have had a bit of "fun" with dynamic DNS and email.

Outside of these comments, I have followed the same broad strategy as described by Ray Mitchell and it does work just fine.
...

Offline raem

  • *
  • 3,972
  • +4/-0
Re: Email: Users split over 2 or more sites.
« Reply #5 on: February 10, 2008, 09:12:29 PM »
Peasant & p-jones

Quote
If your domain is hosted externally, I would suggest you set up each server as a "local" domain (eg myukcompany.local, mysucompany.local) ) and add the main domain into the domain list.
I have gotten into a bit of strife with DNS by using the registered domain name as the main domain name for the server when the services were hosted off site as exactly as you described.

If you have web hosting for mydomain.com on an external server and want to use the same domain name for a local email server, then you obviously need to redirect the web requests in one of a number of ways.

1) Put a redirect in the Primary ibay (or other ibay if it's a virtual domain), how to do this has been answered in the forums quite a few times in the last few months/years.
2) Ad a proxy pass entry in the sme server database for that domain, to forward web requests to the external server, search forums/wiki/bugtracker for this command.
3) Change the entries in the Hostnames and addresses panel for the www content so it points to an external server.
4) Configure external DNS records to point the www content to the external web server, and mail content eg mail.mydomain.com and the MX record to your sme server.
« Last Edit: February 10, 2008, 09:38:14 PM by RayMitchell »
...

Offline Peasant

  • *
  • 143
  • +2/-0
Re: Email: Users split over 2 or more sites.
« Reply #6 on: February 10, 2008, 11:11:04 PM »
Thanks folks for all the helpful advice. I'll build a test rig this week to see how it is all going to work.

The only other point I'll make now is that the US end does not use SME (or not to my knowledge at any rate) but I don't see how this will make any difference to what you have been saying.

Cheers.
Jim

Offline SoftDux

  • *****
  • 240
  • +0/-0
    • http://www.SoftDux.com
Re: Email: Users split over 2 or more sites.
« Reply #7 on: February 20, 2008, 02:31:30 PM »
If your domain is hosted externally, I would suggest you set up each server as a "local" domain (eg myukcompany.local, mysucompany.local) ) and add the main domain into the domain list.


If I understand you correctly, p-jones, one needs to configure SME via the console, then change the domain to mydomain.local (IINM, mydomain.local is a set DNS standard like 192.168.0.0 for privat IP subnets?), and then after the reboot add the actual domain in http://sme/server-manager? Then, when you setup a user, how will sme know for which domain that user is?
And if you send mail on the local lan from 1 user to another, do I configure the email clients with user!mydomain.local OR do I configure the real internet accesable email address?

Offline raem

  • *
  • 3,972
  • +4/-0
Re: Email: Users split over 2 or more sites.
« Reply #8 on: February 21, 2008, 06:19:44 AM »
SoftDux

Quote
...(IINM, mydomain.local is a set DNS standard like 192.168.0.0 for privat IP subnets?)

That's "Windows" terminology and you would be best to drop those concepts.
Just give sme server the real domain name or if you are using a dynamic service, then give sme the dynamic domain name eg mydomain.dyndns.org.

Quote
when you setup a user, how will sme know for which domain that user is?

Every user name will be applicable to all hosted domains, but you can alter that behaviour using the Pseudonyms panel. Please read the Pseudonyms chapter of the manual.

You would configure the mail clients with whatever return address you want them to appear to be sending email from.

PLEASE read ALL the manuals thoroughly, all of this configuration is covered there.
...

Offline raem

  • *
  • 3,972
  • +4/-0
Re: Email: Users split over 2 or more sites.
« Reply #9 on: February 21, 2008, 06:39:23 AM »
SoftDux

Based on information in your other posts, external DNS records will need to be setup appropriately.
ie
Configure www for softdux.com to go to your externally hosted website.
All external Internet requests for your domain will be directed to that site.

On your sme server you confgure www to forward to the external website using the Hostnames and addresses panel, so local requests for your domain will also then go to the externally hosted site.

As you want to use a dynamic IP, then for mail you configure external DNS to point the mx record at mydomain.dyndns.org and all email sent to your domain will go to sme server. As sme has multiple domains configured then sme will receive mail for any valid user for any of those domains.
Do not configure a backup mx record as it is not needed & may reduce the effectiveness of spam filtering/blocking.

If users send mail locally to one of your domains email addresses, then the mail server in sme will know to deliver that mail to a local user.

It's as simple as that, so don't complicate it with more complex naming methods etc.

You can control which users get mail for which domains by configuring full domain style email addresses in the Pseudonyms panel (the domains & user must be valid on sme)
eg
office@domain1 > john
office@domain2 > mary


...

Offline raem

  • *
  • 3,972
  • +4/-0
Re: Email: Users split over 2 or more sites.
« Reply #10 on: February 21, 2008, 08:53:30 AM »
SoftDux

Quote
...one needs to configure SME via the console, then change the domain to mydomain.local....and then after the reboot add the actual domain in http://sme/server-manager?

The main or primary domain is configured using the console, but there is no need to re-add this in the server manager Domains panel as it will already be there. You only add additional (virtual) domains using that panel.

In server gateway mode, if you use a dymamic service (eg dyndns or yi.org) to keep the dynamic IP updated, then the main domain must be the dynamic service providers domain ie mydomain.dyndns.org

If you are in server only mode, then you would install & use the ddclient contrib to manage the dynamic IP for a dynamic service.
...