Change HELO-fqdn for cluster gateways

Greg_88

Active Member
May 22, 2019
6
0
41
36
Hello everyone,

My topics (and problem) is smiliar to https://forum.proxmox.com/threads/change-helo-fqdn-independently-from-server-hostname.44186/ and https://forum.proxmox.com/threads/change-helo-hostname.52582/.
We want 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 (identical problem as second topic).

We have two gateways (on cluster) where we cannot change a smtp_helo_name for these machnies.
When we change a smtp_helo_name, cluster system after synchronization overwrites the values, and this way we back to the start position. I've introduced a changes directly in file /etc/postfix/main.cf but this way system overwrites the values.

We use a version 5.1-4 Proxmox Gateways.
 
hmm - could you provide a bit more details - what is your current hostname on the systems (if you want, pseudonymize the domains)? and what do you want to set smtp_helo_name to for each node?

I assume you already copied the main.cf.in template from /var/lib/pmg/templates to /etc/pmg/templates (if not please see https://www.proxmox.com/images/download/pmg/docs/pmg-admin-guide.pdf - section 4.3)
(you can use a few variables in the templates, e.g. the hostname)

Hope this helps!
 
Thank you for response.

I've read about copy main.cf.in template from /var/lib/pmg/templates to /etc/pmg/templates, but I did not do it. I make a test for 2-3 houres (unfortunatelly on production system). Of course i give you sign about results this operation.

We must remember that file/files from /etc/pmg/templates will be automatically synchronized to the second gateways. What will happen if the second gate has a different address?

For more details I decribe a technical situation :

We have :
- mailserver
- first proxmox gate: aaaa1r (hostname: gw1r)
- second proxmox gate: bbbb2cz (hostaname: gw2cz)
Gatways are working as cluster (active - passive).

External DNS for:
- first proxmox gate is: example3.mail.xxx on 10.10.12.201
- second proxmox gate: example2.mail.xxx on 10.10.55.202
(fiction domain and IP's)


and on this point I would like back to my question form this post: What will happen if the second gate has a different address?
What will happen when we set variable "hostname = example3.mail.xxx" on first proxmox gate? According to the guide (point 4.3 from your link) data will be synchronizred automatically.
In this situation the second gateway will be not working.

I make a test and give you sign.
 
not sure i understood your examples completely are 'aaaa1r' and 'bbbb2cz' the hostnames? domainnames?
In any case since it seems that your 'external' hostname (and the one you want to set as smtp_helo_name don't match any part of the internal names you probably will need to use the templating mechanisms for the config - roughly like this:
Code:
[% IF dns.hostname == 'gw1r' %]
smtp_helo_name = example3.mail.xxx
[% ELSE %]
smtp_helo_name = example2.mail.xxx
[% END %]

you can see the variables you can use in the if clause with `pmgconfig dump`

the template toolkit (which is used for the config-file templates) documentation can be found at http://www.template-toolkit.org/docs/modules/Template.html

hope this helps!
 
  • Like
Reactions: Greg_88
ok I understand that I have to copy the file main.cf.in from the location /var/lib/pmg/templates to the location /etc/pmg/templates/

The only question is whether in this file I have to leave only the configuration that I want to change or the entire file to copy as it flies because I do not understand how this file works. How do I copy this file, it will not overwrite the current settings that I already have?

This solution you gave looks good.

So this file (main.cf.in) must be completely copied with the configuration that is contained in it? Can I clean it and add only the variable that interests me, such as your example?
 
So this file (main.cf.in) must be completely copied with the configuration that is contained in it?
yes - this file is used to generate your '/etc/postfix/main.cf' - only what is written in this file is written in '/etc/postfix/main.cf'

you can make a backup of your current config, edit the template, run `pmgconfig sync` and compare both files (the new '/etc/postfix/main.cf' and the backup you made)
 
  • Like
Reactions: mdo and Greg_88
Thank you for your help and guidance on the solution.
I've made changes to my gates and it works as I assumed.
 
This is what I did to make sure each cluster node presents itself to the outside with the correct name:

[% IF dns.hostname == '<server1>' %]
myhostname = mx1.domain.nl
[% END %]
[% IF dns.hostname == '<server2>' %]
myhostname = mx2.domain.nl
[% END %]
 

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!