Mail relay question

Given below picture, I would expect this setting to always take precedence over aliasses or email_accounts defined locally:

However, when aliasses are defined that use a maildomain as configured above, mail gets delivered to the local mailbox, instead of routed to the listed server.

Alias looks like:

Am I being an idiot or is this a bug ? I would expect me to be able to configure aliasses first, then switch the domain later, and save myself having to do the aliasses at the moment of the migration, but this seems to be either a dumb idea, or a bug, or quite logical but I lack the knowledge to reason why.

Whelp ? :stuck_out_tongue:

Having now read the docs, I think this scenario has not been foreseen. I want to start with the new mail server being the internet facing one, and thus relaying for a couple of now local maildomains.
These maildomains are still live and sending mail. I want to be able to switch them over instantly … that requires the maildomain being forwarded while I create aliasses. But as soon as an alias exists, the mail gets delivered local, regardles of the maildomain setting as shown in the first picture.

This, to me, is undesired behaviour … am I asking silly things when I propose to either honor the maildomain setting, or be able to disable but not remove an alias ?

Hi Jeroen. Try setting the SMARTHOST as well. The smarthost would likely be the one you defined in the Relay.

You can try with this dirty (very dirty) hack (I don’t know if it works):

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

vi 10relay

In 10relay write:

yourdomain.nl smtp:[IP.of.relay.server]:25

(between yourdomain.nl and smtp:[… put a TAB (If someone tell me how to make it on this platform…))

then:

signal-event nethserver-mail-server-update

Pay attention that this template inibhits any relay that you made in dashboard (but you do not remove it from the dashboard)
Remember to remove that template when you are ready to have your mail in your Nethservice

That would make all my mail exit through the other server … and believe it or not, they are not properly configured. 1 never was and is the reason for the migration … the other kinda is, but since some dimbulb decided to move to yet another domain, it is in some sort of limbo … just some mail from web-apps lands there … This option would work, if the stuf I inherrited would not be so beyond rescue and insecure as can be. Thank you for the suggestion tho, I hadnt even thought of it yet and would have helped … past tense, as by now it has been migrated with a bit of a bang :stuck_out_tongue:

@saitobenkei

That is my issue … this setting is not honored when there is a local alias present for the domain. It seems local delivery has precedence over defined relays, which should not be the case imho.

afbeelding

I bet Postfix performs alias expansion before relaying to the next MTA. Aliases are always resolved to a local mailbox or forwarded to an external email address.

I wouldn’t set aliases for a relay domain though; the UI should forbid it. A relayed domain is like a remote queue of messages in front of the final MTA, which should expand aliases by itself.

We have two main scenarios for the mail components:

  • local mail server, with alias, mailboxes quotas + AV & Anti-spam
  • SMTP filter (AV & Anti-spam) MTA for messages relaying only

Did you try uninstalling the mail-server package?

yum --noplugins remove nethsever-mail-server
signal-event nethserver-mail-common-update

Yikes … I am migrating to this server … so the new domain is already live, but two old ones need to be folded in.

My preferred way was:

Have new mailserver act as relay.
Reconfigure firewall and public DNS.
When everything looks good, kill relay and start receiving local.

I just did 2 and 3 during off-hours now.

Do not define aliases on it while it acts as relay. When you’re ready for switching, put it offline, perform last operations (like last mail sync, alias definition, turn the domain to local delivery) then bring it online again.

SMTP servers attempt to transfer a message for some hours (days): no mail is lost, no hurry!

1 Like