Koozali.org: home of the SME Server

Split smtp mail to 2 different sites

Offline basmistry

  • *
  • 19
  • +0/-0
Split smtp mail to 2 different sites
« on: December 22, 2013, 12:10:02 PM »
We have a external Spam Filtering delivering to our SME server external IP. They said can only deliver to one

Now we have to split users to TWO separate sites

How can I do this:

SME Server A - at Site A with about 20 users
SME Server B - at Site B with about 10 users

Mail delivered to SME - based on user - I would like it to relay mail to 2nd site based on users

Problem is only 1 domain - users at both sites need to use the same domain.

Can something like this be done with SME server Postfix etc.

Offline mmccarn

  • *
  • 2,656
  • +10/-0
Re: Split smtp mail to 2 different sites
« Reply #1 on: December 22, 2013, 03:34:03 PM »
Not easily.

You could create forwarding rules at each site to forward email for users at the other site to a secondary email account.  I think SME will deliver email to <user>@<ip address>:

SiteA / ip.add.ress.a
user1: local
user2: forward to user2@ip.add.ress.b

SiteB/ ip.add.ress.b
user1: forward to user1@ip.add.ress.a
user2: local

You need all users on both systems.


You may also be able to do something with fetchmail on each site to go get mail from the other for the local users.

If your objective is to minimize network traffic at either site then both of these solutions suck, and you might want an off-site mail server that either forwards to each site or that is scanned from each site using fetchmail.

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Split smtp mail to 2 different sites
« Reply #2 on: December 23, 2013, 03:45:16 AM »
basmistry

The simplest approach is to let  Server A handle email for all users at both sites.
The 20 users at site A will connect locally via IMAPS, & the 10 users at site B will connect remotely via IMAPS.
There is a traffic penalty to this, but that's the easiest approach. It's no different to having 10 road warriers out in the field connecting to a main server (site A) on their notebooks & smartphones etc.

Another approach (although you say you don't want to do it, it is an effective answer) is to configure a second domain name for site B, maybe a derivation of your main domain name. Then have the users at site B use that domain name as their email address.
In server A you set the Delegate mail function so that all mail for domain B is sent to the SME Server B, this is done with a simple db command.
Obviously you configure both domains to point to server A for mail at least, done in external DNS records.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline basmistry

  • *
  • 19
  • +0/-0
Re: Split smtp mail to 2 different sites
« Reply #3 on: December 23, 2013, 08:59:49 AM »
Thanks

I have been looking on then internet and may be use of Postfix

users1@mydomain.com smtp:ipaddress  - this would point to Server A or B IP External address (or internal I guess)

I did have a quick try at this on another PC running postfix but it didn't work - at least for me
This may be that I didn't configure it correctly for user based redirect - obviously I missed something

I can make it work with domain
ie.
domain1.com smtp:ipaddress1
domain2.com smtp:ipaddress2

Has anyone attempted or this ?



Offline Franco

  • *
  • 1,171
  • +0/-0
    • http://contribs.org
Re: Split smtp mail to 2 different sites
« Reply #4 on: December 24, 2013, 08:34:50 PM »
Yes, postfix-forwarder
Works pretty good and you can also add another layer of security/anti-spam before it reaches the final recipient.

Best regards,