Contacts hosted outside of domain

NethServer Version: 7
Module: email

Hi,

I’m in the process of migrating users from an internal exchange server to a nethserver install, there are some of the exchange users who are not hosted directly on exchange server but connect directly to the remote host.

On exchange emails are routed internally by creating a contact with an external mail address but I’m not sure how to do the same thing on nethserver, anyone have any experience of this?

To elaborate; I need routing outside of the mail domain but only for specific email addresses, I’ve searched for how to do this with postfix but haven’t been able to find anything.

Have found the answer to this myself, set the client smtp to the web mail server rather than the internal nethserver mail server and the issue never occurs.

This is probably worth doing anyway to reduce the risk of blacklisting.

Hi All,
I’ve looked at this again and can still see a point where i’d like to be able to set up mail routing for a given user at some point in the future.

So back to my original question I guess does anyone have any ideas on how to set up routing rules for one particular address so that postfix always delivers it externally rather than within the ou.

I used this configuration on a Nethserver NG 6.x, maybe it works on NG 7.x too:

First of all you have to disable in Postfix the check of the existence of the addresses of the recipients on the local domain

Create the 99sender fragment in /etc/e-smith/templates-custom/etc/postfix/main.cf directory

mkdir -p /etc/e-smith/templates-custom/etc/postfix/main.cf
cd /etc/e-smith/templates-custom/etc/postfix/main.cf
vi 99sender

in 99sender put these commands:

#
# Custom
# 99sender
#

smtpd_reject_unlisted_recipient = no

You must then enter the external mail addresses relating to the local domain indicating the MX host of the domain to which they are to be sent:

Create the 30forward fragment /etc/e-smith/templates-custom/etc/postfix/transport directory

mkdir -p /etc/e-smith/templates-custom/etc/postfix/transport
cd /etc/e-smith/templates-custom/etc/postfix/transport
vi 30forward

In 30forward put these commands:

#
# Custom
# 30forward
#

localdomain.tld      local:
externaluser1@localdomain.tld        smtp:mx.localdomain.tld:25
externaluser2@localdomain.tld        smtp:mx.localdomain.tld:25

Where in localdomain.tld must be indicated the domain whose mail is managed by the server, in externaluser1@localdomian.tld must be indicated the external email address to this server and in mx.localdomian.tld the external MX host of the mail domain.

Then apply the new configuration

signal-event nethserver-mail-server-update

1 Like

That’s brilliant thanks for that it’ll be a while until I can get around to trying this but I’ll take a look then.

Only just got back to checking this as it wasn;t an issue for most users whn using local clients and smarthosts configured directly but it all works perfectly thanks very much for you help :slight_smile:

1 Like

I think this would be fine as a HowTo in the wiki.
Would you mind to write one? :pray: :slight_smile:

1 Like

I only make config at
mail
domain
change
Forward to another server (isp/mail provider smtp.xx.xx

then only deliver the local listet mail accounts and when not send it to smtp.xx.xx
hope this was clear and right