[BlueOnyx:25637] Re: Switching between sendmail and postfix on 3210R

Neil Watson neil at waterend.net
Mon Oct 10 05:15:14 -05 2022



Hi Michael

Thanks for the reply.

>> Hi Neil,

> My mail gets relayed via a 3rd party who insists on connections via 
> port 587 - which the GUI doesn't seem to accept in the Smart Relay 
> Server field. I'd put it in manually to make it work in sendmail.mc...

> Port 587 gets opened and bound by the MTA (Sendmail *or* Postfix) when 
> the checkbox "Enable Submission Port" is ticked in "Network Services" / 
> "Email" in the "Basic" Tab.
> 
> For "Smart Relay Server" see the same GUI page in the "Advanced" Tab. 
> That's where you can set this.
> 
> In fact pretty much every aspect of the Email related GUI works for 
> both Sendmail and Postfix.
> 
> The GUI writes the changes to the Sendmail configuration files (even if 
> Postfix is the MTA) and restarts whatever MTA is enabled. Whenever 
> Postfix is restarted, it will parse the Sendmail configuration and an 
> will dynamically write out an updated Postfix configuration.
> 
> Therefore manual edits to the Postfix configuration should only be done 
> for options that the GUI does not change.

Its not incoming mail to my server that has to be on port 587, its the 
outbound connection to the Smart Relay . 
(https://www.linuxbabe.com/mail-server/postfix-smtp-relay-ubuntu-sendinblue 
explains it - and what Postfix needs to look like to handle it.)

For sendmail.mc, to get relaying working I put:

define(`SMART_HOST', smtp-relay.sendinblue.com')dnl

define(`RELAY_MAILER, `esmtp')dnl

define(`RELAY_MAILER_ARGS, `TCP $h 587')dnl

where the RELAY_MAILER_ARGS argument identifies which port to 
communicate with the relay with (outgoing!). (I'm not 100% that the 
middle line is necessary...)

For Postfix, its a bit simpler:

relayhost = [smtp-relay.sendinblue.com]:587

I wonder if there might be scope for the GUI accepting a port number as 
it doesn't accept one at present (maybe something like 
"smtp-relay.sendinblue.com:587") and generating the appropriate 
lines/syntax in the sendmail configuration if a port number is present 
and then finding it when scanning to generate the postscript 
configuration?

You might be wondering why I'm using a mail marketing company to relay 
my email: its a simple matter of "reputation" - some mail systems won't 
accept (or treat as SPAM) all mail that comes from a "non-business" 
network connection and I was getting problems with sending email direct!

> However, when sendmail.mc gets parsed, the port (in RELAY_MAILER_ARGS) 
> doesn't get picked up, so postfix tries to use port 25 - and the relay 
> won't accept the authenticated connection! Editing mail.cf  manually 
> (or via Webmin) to set the relayhost enabled it to work - until the 
> file gets regenerated automatically.
> 
> If you don't want the MTA to use port 25, then you can simply untick 
> the checkbox "Enable SMTP Server". It will still use port 465 and 587 
> if "Enable SMTPS Server" and "Enable Submission Port" are enabled.

> The other thing that's a bit of a pain is that it seems /etc/procmailrc 
> gets regenerated when I make the switch...

> I'm not going to touch that, as /etc/procmailrc is a file on BlueOnyx 
> that's entirely "owned" by the GUI. If you want to prevent the GUI from 
> messing with a custom /etc/procmailrc, then you can use this command to 
> prevent even user "root" from making changes to it:
> 
> chattr +i /etc/procmailrc
> 
> If you want to "unlock" it again, use:
> 
> chattr -i /etc/procmailrc

That's fair enough - I just keep a copy of what I want procmailrc to 
look like and copy it back - if it annoys me enough I'll write a simple 
cron to check it for change and restore it :)

> There are other utilities (like the sendmail command) that seem to be 
> able to "soft link" in /etc/alternatives/mta* to either a version for 
> .sendmail or .postfix. What switches these links - as the GUI change 
> doesn't seem to have done it. Do I have to do it manually?
> 
> No, we don't touch these at all. When you switch the MTA in the GUI, we 
> simply run "systemctl disable <service>" and "systemctl enable 
> <service>" on Sendmail and Postfix. There is also a config file called 
> /etc/sysconfig/bxmta which gets updated and tells the GUI which MTA is 
> active. That file either has ...
> 
> MTA=POSTFIX
> 
> ... or ...
> 
> MTA=SENDMAIL
> 
> ... in it.

Again, fair enough - I was just checking that there wasn't something 
else that needed to be run. I will probably write a simple script to 
swap the links over

Thanks

Neil.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.blueonyx.it/pipermail/blueonyx/attachments/20221010/815afa77/attachment.html>


More information about the Blueonyx mailing list