SMTP Host for each domain (external relaying domain)


(Rosi Steiner) #1

Is it possible on a NETHSERVER to map the following situation?

I want to host multiple e-mail domains in an internal network on a NETHSERVER. Specifically, each user can have multiple e-mail addresses.

One domain is hosted by NETHSERVER itself and other domains (such as gmx.at, outlook.com, gmail.com) are to be picked up only the mail with fetchmail and moved to the respective mailbox.

Is it possible that I for these other domains (such as gmx.at, outlook.com, gmail.com) each own SMTP - Server furnish so from these addresses can also be sent mails. In Exchange is it referred as “external domain Relaying”.

Thank You
Rosi


(Davide Principi) #2

Hi @rosi_steiner,

NethServer is currently designed to provide the mail services for its mail domains only, possibly using a smart host as default route or relay to other servers for specific domains.

AFAIK, mail handled by other providers (gmail,gmx,ms) should be configured into each mail client: certainly the external relaying domain feature living in Exchange has a specific use case scenario that I can’t figure out. Could you provide more details about it?


(Rosi Steiner) #3

I need a mail server on the intranet.

With this I want each user to manage multiple e-mail addresses. The e-mail addresses of all other domains, such as outlook.com, etc. gmx.net the intranet users need to work on different computers, so I put the mail with IMAP available. On each computer that will so the same mails be available and downloaded only once.

Fetching the mail from these email providers I’ll do with fetchmail and put it in the server locally from.

I am now looking for a way for these external mail - domains for each user the correct SMTP - to use server so that, for example, user1@outlook.com is sent via the SMTP of Outlook.com.

Greetings and thank you
Rosi


(Alessio Fattorini) #4

If i’m getting your request right, you want multiple smarthost choosed automatically, for each email, by sender address. Right?


(Rosi Steiner) #5

This where a BIG POINT.

But my wish is only to install one smarthost manualy for every external domain. I will send e.g. any @outlook.com emails with the outlook.com - SMTP and so on.

Rosi


#6

I have this same requirement. I currently use postfix with sender_dependent_relayhost_maps which chooses a smart/relay host based on the senders @domain address.

Why do I do this? It allows me to keep a single point of configuration for clients (server details and username and password) on the LAN instead of configuring separate SMTP details per email address.


#7

Can I manually edit the Postfix configuration files to permit Sender Dependent Relyhost Maps without breaking NethServer?

I really want a Linux based all-in-one home server instead of an AD, File server and hMail server running on Windows.

Any pointers would be appreciated :smile:


(Filippo Carletti) #8

You need a custom template to make the configuration “permanent”.
See the developer manual:
http://docs.nethserver.org/projects/nethserver-devel/en/latest/templates.html

In case of doubts, show here the modifications you need to make and we will help you.


#9

Thanks Filippo.

(Pulled from my working test server VM, CentOS 6.5 which I was testing about 1.5-2 years ago before going with hmailserver)

:: main.cf ::
smtp_sender_dependent_authentication = yes
sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/isp_passwd

sender_relay DB has 2 columns, usernames and forwarding hosts.
isp_passwd DB has 2 columns, email address and username:password

forwarding hosts were set as 127.0.0.1:Port which forwarded to stunnel (for SSL Port 465 connections to ISP’s mail servers).

The stunnel configuration file /etc/stunnel/stunnel.conf is configured with ISP’s e.g.:

[gmail-smtp]
client = yes
accept = 127.0.0.1:11125
connect = smtp.gmail.com:465

[yahoo-smtp]
client = yes
accept = 127.0.0.1:11126
connect = smtp.mail.yahoo.co.uk:465

[Hotmail-smtp]
client = yes
accept = 127.0.0.1:11128
connect = smtp.live.com:587
protocol = smtp

(My wife signs up to multiple free mail services and no amount of pleading stops her ;))

From the mail client I setup email aliases for each ISP email address and then its a case of selecting the desired ‘send as’ address to use and the server relays to through the relevant ISP.

So I believe with Templates I can add the additional Postfix configuration to Postfix and point the additional files to my sender_relay and isp_passwd DB’s.

Stunnel will need to be manually installed and configured separately. Will this cause any issues with mail filtering or mail flows and is the above the correct approach?

Many thanks,


(Martin Droste) #10

hi,

did you finally got your answers? You talked about your wife - but me and my wife, we have 3 children with their own emails addresses :smiley:

thx


(Davide Principi) #11

Feature in progress, tracked by