Change HELO-fqdn for cluster gateways

Discussion in 'Mail Gateway: Installation and configuration' started by Greg_88, May 22, 2019.

  1. Greg_88

    Greg_88 New Member

    Joined:
    May 22, 2019
    Messages:
    4
    Likes Received:
    0
    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.
     
  2. Stoiko Ivanov

    Stoiko Ivanov Proxmox Staff Member
    Staff Member

    Joined:
    May 2, 2018
    Messages:
    1,218
    Likes Received:
    107
    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!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Greg_88

    Greg_88 New Member

    Joined:
    May 22, 2019
    Messages:
    4
    Likes Received:
    0
    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.
     
  4. Stoiko Ivanov

    Stoiko Ivanov Proxmox Staff Member
    Staff Member

    Joined:
    May 2, 2018
    Messages:
    1,218
    Likes Received:
    107
    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!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    Greg_88 likes this.
  5. Greg_88

    Greg_88 New Member

    Joined:
    May 22, 2019
    Messages:
    4
    Likes Received:
    0
    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?
     
  6. Stoiko Ivanov

    Stoiko Ivanov Proxmox Staff Member
    Staff Member

    Joined:
    May 2, 2018
    Messages:
    1,218
    Likes Received:
    107
    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)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    Greg_88 likes this.
  7. Greg_88

    Greg_88 New Member

    Joined:
    May 22, 2019
    Messages:
    4
    Likes Received:
    0
    Thank you for your help and guidance on the solution.
    I've made changes to my gates and it works as I assumed.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice