How to change SMTP port from 25 to 26 in NS8?

NethServer Version: NethServer 8 Beta 1
Module: Mail, version 1.2.0

Hello everyone!

I want to use Proxmox Mail Gateway in combination with NS8 - the mail module.

For this, in NS8 the SMTP port 25 must be changed to 26 (mails “enter” through port 25 in PMG, exit through port 26 from PMG and must arrive in NS8 mail through port 26).

In NS7 I did this using a custom template, following @mrmarkuz’s solution here:

Thank you in advance for your help!

Hi Gabriel, refer to the developer docs here


Hi @davidep,

Thank you for help!

Unfortunately, “postfix” does not exist in “/etc” (please see the screenshots).
I also searched “” for postfix because I found the path to “postfix-custom” in “Mail > Status > App volumes”.

However, the email is functional.


NS8 is installed on top of Rocky Linux 9.2


Here you’re missing

ssh mail1@localhost

See Rootless vs Rootfull | NS8 dev manual

1 Like

Hi @davidep,

Now the command works correctly.
Thanks for the hints you gave me.
I will mark your previous answer as the resolution of my problem.
That is correct, even if I am not able to produce/write a custom template to change port 25 to 26 or to add port 26 as in @mmarkuz’s solution for NS7.

I am still confused in using NS8. It seems that it is not as simple as NS7, at least for me at the moment.
For now, I managed to install and it works “as is” the Mail, Nextcloud, MariaDB, NGiNX, WebTop, Collabora (still untested) modules.

In addition to the modification of SMTP port 25, I think I will have something to do with the operation of osTicket (it is not “native” for NGiNX but I found some tutorials for configuring NGiNX; I guess that your submissions to the NS8 dev manual will have to be taken into account for the solution. …).

The next step is to install WordPress and get my website up and running.

Thanks again for your help!

The NS8 module actually does not allow to customize Only customization is permitted by now.

To fully achieve your goal a new feature is required, if the following does not work:

Customize the following parameter:

known_tcp_ports = lmtp=24, smtp=26, smtps=submissions=465, submission=587

See Postfix Configuration Parameters

Ensure changing that value does not affect SMTP connections with other MTAs, for example you can send out a mail to a Gmail recipient.

1 Like

Hello Davide,

Thanks for the reply!

I will try during the day and send the feedback.


Update / Feedback:

How/What I did:

ssh mail1@localhost
podman exec -ti postfix vi /etc/postfix/

I inserted the following parameter:
known_tcp_ports = lmtp=24, smtp=26, smtps=submissions=465, submission=587

systemctl --user reload postfix

I think it should work because after modifying with the new settings, I can no longer send/receive emails (with WebTop).
However, in NS8 mail I have nowhere to configure mail relay because this “submodule” does not exist. Relay exists in NS7 and through it mails are sent/received via PMG (I use this configuration now with NS7).

Relay domains are not planned for now. See Trello card

1 Like