Just read @saitobenkei 's post The idea is to put whatever you want to add or customise into a template. The listening port is not set in master.cf but in /etc/postfix/transport.
No, I do not know how to. I manually changed the 40smtpd_public template and replaced smtp with 8025, but the template is overwritten by the next update and so is the postfix master.cf file.
Do you really want to REPLACE the port? Why not using a relay port like @pagaille recommended and @saitobenkei has explained?
Sorry, I misunderstood the whole thing
Just add a custom template to /etc/e-smith/templates-custom/etc/postfix/master.cf/41smtpd_custom with following content:
#
# 41smtpd_custom -- custom public smtp server on port 8025
#
8025 inet n - n - { $connections_limit > 0 ? $connections_limit: '-' } smtpd
{
$OUT = join("\n", map { " -o " . $_ } @smtpd_public_options);
}
Now you have port 8025 open additionally to port 25. I don’t recommend a replacement of the port as it implies a replacement of the 40smtpd_custom template which may lead to troubles with updates.
The mails go to port 25 of a mailgate vm with mailscanner first. From there the mails are forwarded to port 8025 of an internal mail server. I think it’s strange enough that the service ports cannot be configured in the GUI. A bit more flexibility would be fine here.
You may also config mailscanner to send mails to Nethserver on port 25. These “alternative” ports are only necessary when services are running on the same machine.
By the way…do you like mailscanner? I didn’t know this software before. It’s free and has packages for CentOS, would it be interesting on NethServer?
I didn’t understood that modifying an existing template like I did (40smtpd_public) wasn’t allowed since it probably wouldn’t survive the next update. Now I know how to add my own custom things.
#
# 40smtpd_public -- public smtp server on port 25
#
smtp inet n - n - { $connections_limit > 0 ? $connections_limit: '-' } smtpd
{
$OUT = join("\n", map { " -o " . $_ } @smtpd_public_options);
}
to make master.cf look like this after expanding the template:
#
# 40smtpd_public -- public smtp server on port 25
#
smtp inet n - n - - smtpd
-o smtpd_helo_required=yes
-o strict_rfc821_envelopes=yes
-o smtpd_proxy_filter=127.0.0.1:10024
-o smtpd_proxy_options=speed_adjust
I think it’s a design concept to have all variables defined in 00template_vars which makes coding easier but I am still learning