Customizable Postfix SMTP banner host

The default SMTPD banner in Postfix is $hostname ESMTP $mail_name, which normally translates to something like <your_host_name> ESMTP Postfix.

If the internal server name does not match the public DNS, the SMTP shows a hostname which may be incorrect, and make some email services reject messages or mark them as SPAM.

It would be useful to have a way to override the default Postfix smtpd_banner configuration option.

This can be done as easy as including a new template snippet named /etc/e-smith/templates-custom/etc/postfix/main.cf/40smtpd_banner_host wit the following content:

#
# 40smtpd_banner_host -- Customizable SMTP banner host value 
#
{ $postfix{'BannerHost'} ? "" : "# " }smtpd_banner = { $postfix{'BannerHost'} } ESMTP $mail_name

After creating the template, you can set and activate the SMTPD banner host with:

config setprop postfix BannerHost your.public.hostname.com
signal-event nethserver-mail-server-update
7 Likes

Hi

Please steps can apply to Nethserver 7.5 ?

Thank you

Indeed. I have it working successfully on 7.5.

1 Like

Hi

I try but error

signal-event nethserver-mail-server-update
Can’t open directory /etc/e-smith/events/nethserver-mail-server-update

signal-event nethserver-mail-
nethserver-mail-common-save nethserver-mail-filter-save nethserver-mail-smarthost-save
nethserver-mail-common-update nethserver-mail-filter-update nethserver-mail-smarthost-update
Which’s correct command ?

I pasted your cmd line on my server and it worked flawlessly.

It seems you have some problem with your installation, you don’t seem to have the directory /etc/e-smith/events/nethserver-mail-server-update (and you should!)

This directory is the configuration dir for the event you need to fire. Perhaps you can restore this directory from backup?

1 Like

Work with SMTP Proxy and how to update event for this?