• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Issue Wrong SMTP Banner with Postfix

JulienCaroff

New Pleskian
Hi Dear Pleskians,

I am Julien and I'm new on this forum. Nice to meet you all ! :)

For starters, I'm running Plesk Onyx Version 17.8.11 Update #84 on a Debian 9.12 Server. I use the inner Plesk DNS System. My Postfix version is 3.14.

Now, for some reason, some of my clients need to have a customized SMTP Banner with both dedicated IP and dedicated Hostname.

I thought it was easy to do when checking the Mail > Mail Server Settings > "Send from domain IP addresses and use domain names in SMTP greeting" checkbox. But it seems that it's not so obvious after all : Postfix always displays the same SMTP Banner with the same Hostname, for all of my domains and all of the IPs.

Let's say I have this configuration with dedicated IPs and domains :
- domainA.tld : 1.1.1.1
- domainB.tld : 2.2.2.2

When I send an email, Postfix uses the correct dedicated IP for each domain (e.g. 1.1.1.1 for domainA.tld, 2.2.2.2 for domainB.tld), so I guess that the sdd_transport_maps are set up properly, along with the master.cf with customized SMTP domains/IPs.

Here is an example of a domain configuration in master.cf :

plesk-domainA.tld-1.1.1.1- unix - n n - - smtp -o smtp_bind_address=1.1.1.1 -o smtp_bind_address6= -o smtp_preference=ipv4 -o smtp_helo_name = domaineA.tld -o myhostname=domainA.tld


The problem is, Postfix refuses to use the domain name in "smtp_helo_name" or in "myhostname" as the Hostname to display a customized SMTP Banner. It always uses the server default hostname (ns1234.ip9.9.9.9.com).

It just doesn't make no sense to me that the domain is correctly binded to the IP but not binded to the smtp_helo_name. Am I missing something ?

I have tried all day to modify so many settings into master.cf and main.cf, that I can't remember exactly what I did. None of the solutions I've found on this forum or on Google worked for me.

I'd really like some help guys :)

Thanks a lot,

Julien
 
@JulienCaroff,
The option "Send from domain IP addresses and use domain names in SMTP greeting" affects only SMTP EHLO name send by the Plesk mail server when it submits mail to other mail servers (e.g. when message is sent by [email protected] to [email protected]), not the SMTP banner displayed when client connects to Plesk mail server.

Setting custom SMTP banners per IP requires modifying binding for the incoming mail daemon, smtpd, by adding 2, or 3 (if submission on 587 port is enabled) lines per each IP address registered on the system to the /etc/postfix/master.cf file. The file must be altered as follows:
Code:
#smtp      inet  n       -       y       -       -       smtpd
127.0.0.1:smtp      inet  n       -       y       -       -       smtpd
10.52.46.55:smtp      inet  n       -       y       -       -       smtpd -o myhostname=example.com
10.52.34.8:smtp      inet  n       -       y       -       -       smtpd -o myhostname=example.org

Code:
#smtps inet n - y - - smtpd -o smtpd_tls_wrappermode=yes
127.0.0.1:smtps inet n - y - - smtpd -o smtpd_tls_wrappermode=yes
10.52.46.55:smtps inet n - y - - smtpd -o smtpd_tls_wrappermode=yes -o myhostname=example.org
10.52.34.8:smtps inet n - y - - smtpd -o smtpd_tls_wrappermode=yes -o myhostname=example.com

As a result, accessing different IP addresses via telnet will return different SMTP banners.

I have to warn you that this configuration may be reset on adding a new mail address, new domain, changing configuration of existing mail account, changing configuration of mail server in Plesk UI, or running plesk repair mail.
With that in mind, I would recommend voting for this feature instead: that you adapt the main domain name of an IP as the myhostname for POSTFIX or QMAIL.
 
Back
Top