Change SMTP banner and EHLO response

KennyMacCormik

New Member
Aug 22, 2019
4
0
1
32
Greetings,

I'm struggling to change SMTP banner and EHLO response for the PMG. When I follow the admin guide and change "SMTPD BANNER" setting in the "Mail Proxy" section I see the following banner when using telnet "220 %FQDN% %SMTPD BANNER%". I need to have "220 %SMTPD BANNER%" instead.

Also when I use EHLO command I get the following reply "250-%FQDN%". But I need to see "250-%MyValue%" instead.

Could you please point me to the right direction?
 
Greetings,

Unfortunately it is not helping. I've copied /var/lib/pmg/templates/main.cf.in to /etc/pmg/templates/main.cf.in and added the following config:

smtpd_banner = [% pmg.mail.banner %]
smtp_helo_name=qwerty

Then I've executed pmgconfig sync --restart 1. But I still see

220 %banner%
helo mx1.internal.local
250 %localhost%

Any other suggestions?
 
sorry - I wasn't clear enough:
* the link was just to show how to adapt the main.cf
* smtp_helo_name is the name your system uses when connecting to another mailserver vs. when receiving a connection
(in general postfix options starting with smtp are for the smtp-client (when postfix connects to another server) - those with smtpd_ are for the server (when someone connects to it)

Try setting the mail_name variable accordingly: http://www.postfix.org/postconf.5.html#mail_name

I hope this helps!
 
  • Like
Reactions: Fra
Greetigs,

I have the following config lines in /etc/pmg/templates/main.cf.in

smtpd_banner = [% pmg.mail.banner %]
mail_name = qwerty

But I still see the following while communicating via smtp

220 %banner%
ehlo mx1.something.somewhere
250-%hostname%

Any suggestions?
 
Glad it worked!
Please mark the thread as 'SOLVED' so that others know what to expect.
Thanks!
 
Hallo Support, habe eben 6.2.5 installiert bzw upgedatet, und gesehen, dass das Umstellen des SMTP-Banners / EHLO Banners immer noch so ein Gefrickle mit Template und/oder /etc/hostname etc. ist.

Warum macht Ihr da nicht einfach zwei Variablen (Mail_Name, HELO_Name) in die GUI rein? Das betrifft doch eigentlich jeden der das Gateway professionell hernimmt...
Grüße Helmut
 
Please stick with English in the English forum
Warum macht Ihr da nicht einfach zwei Variablen (Mail_Name, HELO_Name) in die GUI rein? Das betrifft doch eigentlich jeden der das Gateway professionell hernimmt...
Grüße Helmut

Put shortly we don't have the HELO name configurable separately, since updating it separately from the hostname is not necessary in most use-cases - mostly people happily just change their hostname if they need to adapt the HELO name.

If I missed a point where this makes sense for a larger group of users - please open an enhancement request over at https://bugzilla.proxmox.com with an explanation of why you want that change and in what environments it makes sense.
Thanks!
 
I did just that (changed with "hostname mail.customer-domain.at" ), because customer´s MX records changed. The hostname before was "mailgateway".
After that action, some portions of the GUI stopped respondig ("cannot connect to <mailgateway>", error 500).
This is what I mean with Gefrickel.

You can setup nearly everything in the GUI, way not such essentials as mail_name and helop_name ?!?
 
changed with "hostname mail.customer-domain.at"
usually only the short name is set with hostname (`hostname mail`) - the fqdn is added to '/etc/hosts' pointing to an ip configured on the machine.

for PMG additionally the DNS-name is taken from the search list in '/etc/resolv.conf' - see https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#_configuration_files_overview

Most things can be configured in the GUI (the search domain in this case for example). However I agree that two pieces are missing - setting the hostname and editing /etc/hosts - would you open an enhancement request over at https://bugzilla.proxmox.com for this (product pmg, component pmg)

The one thing I currently don't see the point in making available over the GUI is the helo_name - since it is not necessary in most setups to set it differently from the hostname.

I hope this helps!
 
usually only the short name is set with hostname (`hostname mail`) - the fqdn is added to '/etc/hosts' pointing to an ip configured on the machine.

for PMG additionally the DNS-name is taken from the search list in '/etc/resolv.conf' - see https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#_configuration_files_overview

Most things can be configured in the GUI (the search domain in this case for example). However I agree that two pieces are missing - setting the hostname and editing /etc/hosts - would you open an enhancement request over at https://bugzilla.proxmox.com for this (product pmg, component pmg)

The one thing I currently don't see the point in making available over the GUI is the helo_name - since it is not necessary in most setups to set it differently from the hostname.

I hope this helps!

it makes totally sense! i'm hosting a bunch of domains for customers and now want to implement PMG (without re-doing my [split-horizon, internal/external] DNS-setup; let's say it's complex)

current setup is like (internet side):
domain-customer.xyz > mx=abc.domain-hoster.xyz
domain-hoster.xyz > mx=abc.domain-hoster.xyz
abc.domain-hoster.xyz = IP 100.100.100.100

current flow (simplified) of a sending eMail-Server:
want to send email for user@domain-customer.xyz
– lookup of mx-record for domain-customer.xyz > result is "abc.domain-hoster.xyz"
– lookup of IP for abc.domain-hoster.xyz > result is "100.100.100.100"
– (maybe) doing reverse lookup of IP 100.100.100.100 and compare to result of mx lookup (maybe take actions if different)
– connecting to IP 100.100.100.100
– sending helo / receiving helo
– (maybe) verifying received helo <<< THIS now could ruin the delivery (my servers would stop here if it's not the same as the above lookups)

because i can't (and don't want to) change the internal DNS names/configuration of the systems, especially the mail server i need:
– a different DNS name for the PMG system (VM/CT) with a different IP
– so it's FQDN (and resulting hostname, etc.) are different then abc.domain-hoster.xyz
– strictly configured/checking eMail-Server will see the mismatch between the send helo string of PMG (and the provided DNS informations)
BOOM, or maybe boom (depends)

my internal DNS names/IPs can't be changed in favor of PMG – it simply needs to send/respond to connections like the mail server itself.

THIS then guarantees, that the same setup (now with PMG in between) would work, without any modifications elsewhere (except maybe that the eMail-Server from then on sends it's outgoing eMails via PMG as smarthost, but not needed if not wanted); and in case of any intermitted problems it's easy as hell to temporarily remove PMG as well.


hopefully i could give reasons why we need this (little) change [for the better], which makes PMG an even more complete package for everyone.
NOBODY loses, but EVERYBODY wins!
 
Last edited:
making the helo-name used when sending mail statically configurable is enhancement filed under:
https://bugzilla.proxmox.com/show_bug.cgi?id=3342
- you can subscribe there to see when some progress on the issue is made (no promises on when this will be).

From a quick scan of your post this should help you in your setup
 
  • Like
Reactions: s.Oliver
Where is this variable defined?
pmg.mail.banner
when I change mail_name nothing happens and I suppose it should change the smtpd_banner which is defined by that variable.
smtpd_banner = $myhostname [% pmg.mail.banner %]
But a quick grep reveals nothing in either /etc or /var/lib/pmg
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!