EHLO/HELO change does not work

UCR Core Edition release 5.0-0 errata68

Despite setting up UCR variables as follows:

UCR variable Value
mail/postfix/smtpd/banner commonsenseit.ca
mail/smtp/helo/name commonsenseit.ca

The transcript of a telnet session to my mail server shows:

220 commonsenseit.ca        <<<=== Banner changed
ehlo s5
250-ucs1.commonsenseit.ca   <<<=== Ehlo name unchanged
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250-DSN
250 CHUNKING

This happens even after a system reboot.

Note:

As per the following link, this seems to be an old issue (more than 5 years) still unsolved:

Postfix EHLO/HELO ändern funktioniert nicht

my “soltution” for that was to use Proxmox Mail Gateway as smarhost what also has the advantage of user spam management

rg
Christian

After some research, I found that the following excerpt from template file
/etc/univention/templates/files/etc/postfix/main.cf.d/10_general:

# some basic mail system settings
myhostname = @%@hostname@%@.@%@domainname@%@
# mydomain is unset - The default is to use $myhostname minus the first component.
@!@
fqdn = '%s.%s' % (configRegistry.get('hostname'), configRegistry.get('domainname'))
if configRegistry.get('mail/postfix/myorigin'):
        print('myorigin = %s' % configRegistry['mail/postfix/myorigin'])
else:
        print('myorigin = %s' % fqdn)
print('smtp_helo_name = %s' % configRegistry.get('mail/smtp/helo/name', fqdn))

  ...

# banner
@!@
if configRegistry.get('mail/postfix/smtpd/banner'):
        print('smtpd_banner = %s' % configRegistry['mail/postfix/smtpd/banner'])

Gets correctly translated into /etc/postfix/main.cf as:

# some basic mail system settings
myhostname = ucs1.commonsenseit.ca
# mydomain is unset - The default is to use $myhostname minus the first component.
myorigin = ucs1.commonsenseit.ca
smtp_helo_name = commonsenseit.ca

  ...

# banner
smtpd_banner = commonsenseit.ca

The issue seems to be then:

  • WHY is smtp_helo_name value being overwriten?
  • WHO is overwriting it?

Any hint?

I understand your solution but wouldn’t the whole UCS community benefit from this issue being fixed instead of everybody working around it?

http://www.postfix.org/postconf.5.html says that smtp_helo_name is "The hostname to send in the SMTP HELO or EHLO command. " which is a client (smtp) feature and nothing to be shown while connecting to postfix acting as a server (smtpd).
This means that smtp_helo_name will never change the EHLO-response.
As far as I remember the only chance to change this response would be to alter myhostname but this may have undesired side effects for example on mydestination.
In addition, myhostname defaults hardcoded to the real hostname itself. This could be addressed by following https://docs.software-univention.de/manual-5.0.html#mail::serverconfig::maincflocal

hth,
Dirk

The next sentence on the same document you refer states “The default value is the machine hostname. Specify a hostname or [ip.add.re.ss]”.
For my perspective, this means the once smtp_helo_name is changed, its new value would be sent as EHLO-response.
What would be the point of modifying a configuration variable, if its new value is not going to be used?

The basic misunderstanding here is that smtp_helo_name is what Postfix uses as a HELO/EHLO response, when in fact it describes what Postfix sends in the HELO/EHLO command, as @ahrnke already quoted from the postconf document.
What Postfix sends as a response is being defined in smtp_banner.

Mastodon