[SOLVED] Change HELO hostname

Mar 19, 2019
2
0
6
34
Hello,

I have a question regarding Helo checks.
I would like to change our Helo name to something different then our hostname of proxmox. The reason is that some mailservers who force Helo check are blocking our e-mails currently they see our internal hostname of proxmox server.

In /etc/pmg/templates i've edited the file main.cf.in to a different hostname. After the change external servers were accepting our mail, but we were not receiving any. All incoming mails were accepted/bounced with the message: mail for xxx loops back to myself. I had edited the line: myhostname to our mx adress.

The pmgconfig sync --restart 1 command also gave an error, nextserver: Bootstrap discovery failed. Giving up.
But the change was still done.

So my question is:
Which line do i need to change for HELO so outgoing and incoming mail works as intended?

We are using the latest version 5.1-4.

Thanks in advance.
 
hm - you could try to set the:
'smtp_helo_name' variable in the main.cf.in (after copying it to '/etc/pmg/templates') - see `man 5 postconf`
That should only affect the name your server identifies with when connecting to other servers

Hope this helps!
 
Hello Stoiko,

You are correct and It's solved now.
At first the 'smtp_helo_name' didnt exist and I didn't think about adding the variable myself.
After I've added smtp_helo_name into main.cf.in in /etc/pmg/templates I did the resync and its working now.

Thank you!
 
for me this 'smtp_helo_name' variable in the main.cf.in did not work (i had it in /var/li/pmg/templates/main.cf.in)
telnet mx1.issoire-linux.org 25 always gave me ... internal FQDN ?

Trying 89.234.140.242...
Connected to mx1.issoire-linux.org.
Escape character is '^]'.
220-mx1.ilinux.dmz10 ESMTP Issoire Linux
220 mx1.ilinux.dmz10 ESMTP Issoire Linux
QUIT
221 2.0.0 Bye
Connection closed by foreign host.


What can be done ?

PMG add to /etc/hosts :

# --- BEGIN PVE ---
10.30.30.31 mx1.issoire-linux.org mx1
# --- END PVE ---

(first install PMG i tried with internal FQDN ... issue , so with external FQDN ... issue !)

BUT if we change PVE Zone ... cluster won't work ? ...
this is mad.
 
Last edited:
The smtp_helo_name is the name postfix uses for outbound connections...
you can try to set the mail_name to the external name (have not tested it)...
 
i create a template and add this (i hace two PMG in cluster) :
nano /etc/pmg/templates/main.cf.in

and add :

# Modif : correction hostname etc
mydomain = issoire-linux.org
[% SWITCH dns.hostname %]
[% CASE 'rmx1' %]
myhostname = mx1.issoire-linux.org
[% CASE 'rmx2' %]
myhostname = mx2.issoire-linux.org
[% CASE %]
myhostname = mxErr.issoire-linux.org
[% END %]

... and it's work, now seeing the good mx name.
 
Last edited:
I was also in need of this (PMG 6.2.5). I succeeded by adding smtp_helo_name to /var/lib/pmg/templates/main.cf.in.

But one question about that: Should I copy this file to /etc/pmg/templates? This folder does actually not exist in my setup. Or has the file system structure maybe changed with PMG 6.x?

And for the change to take effect I needed to make a change in the Mail Proxy relaying configuration (i just changed SMTP port temporarily and immediately back again). After that the /etc/postfix/main.cf got rewritten with the smtp_helo_hostname.

Just a bit unsure how update safe this change is, how frequently /var/lib/pmg/templates/main.cf.in got changed and if proxmox keeps or ask about keeping changes here?
 
Last edited:
But one question about that: Should I copy this file to /etc/pmg/templates?
yes - the directory needs to be created first

Just a bit unsure how update safe this change is, how frequently /var/lib/pmg/templates/main.cf.in got changed and if proxmox keeps or ask about keeping changes here?
from PMG 6.2 on the templates in /etc/pmg/templates (if any) are registered with ucf(1) - should the shipped template change you'll be asked what to do with your modifications

I hope this helps!
 
from PMG 6.2 on the templates in /etc/pmg/templates (if any) are registered with ucf(1) - should the shipped template change you'll be asked what to do with your modifications
@Stoiko Ivanov could this be included in the pmg admin doc?
I was searching for it in the admin doc and could not find it and was wondering what would happen when a shipped template would change.
Your answer is clear.
 
Last edited:
Hi Emrahtolu.

With pleasure.

First start by creating this folder if it doesn't exists on your master node:
Code:
mkdir /etc/pmg/templates

Next copy this file to the new folder you just created:
Code:
cp /var/lib/pmg/templates/main.cf.in /etc/pmg/templates/

Next edit with "nano /etc/pmg/templates/main.cf.in" :
Code:
Around line 22, find this:
mydomain = [% dns.domain %]
myhostname = [% dns.hostname %].[% dns.domain %]

and REPLACE it with this (making sure you change mydomain and myhostname with yours):
# Modif : correction hostname etc
mydomain = domainxyz.net
[% SWITCH dns.hostname %]
[% CASE 'pmg10' %]
myhostname = pmg10.domainxyz.net
[% CASE 'pmg11' %]
myhostname = pmg11.domainxyz.net
[% CASE 'pmg13' %]
myhostname = pmg13.domainxyz.net
[% CASE %]
myhostname = pmgErreur.domainxyz.net
[% END %]

Next you need to force a synch to your slaved:
Code:
 pmgconfig sync --restart 1
Don't worry if you get some "could not change directory to "/root": Permission denied".

It should create the folder on each node, and synch the file main.cf.in in it, you should check.
 

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!