howto edit/change main.cf permanently

Ronny

Well-Known Member
Sep 12, 2017
59
3
48
40
Hello,

i have two changes made in main.cf:
- disable fqdn checks (for internal mailing)
- add header_checks (for subjects in logs)

but after restarting the pmg host all my changes in main.cf are lost :(

how can in edit/change the main.cf permanently in pmg?


regards
Ronny
 
  • Like
Reactions: stathis
Hi,

you have to copy the template from `/var/lib/pmg/templates/` to `/etc/pmg/templates/` and make your changes there.
See also 4.3 in the admin guide.
Keep in mind that you have to update the config as well if the original got updated (changes get not synced automatically).

Greetz
 
Hi,

aaah, ok, i found it.

it is possible to add/change this parameters via web-gui?

thanks a lot :)

regards
Ronny
 
Hi,

Keep in mind that you have to update the config as well if the original got updated (changes get not synced automatically).

Obviously this isn't true any longer, the newest update wants to change my copied config:

Code:
───────────────────────────────────┤ Modified configuration file ├───────────────────────────────────┐
 Line by line differences between versions

 --- /etc/pmg/templates/main.cf.in root.root 0644 2018-04-02 11:51:59
 +++ /var/lib/pmg/templates/main.cf.in root.root 0644 2020-04-24 19:31:15

[]

Wow.

Regards,

Matze
 
Hi,

yes since the last update (6.2) pmg handle now those custom changes.

https://pmg.proxmox.com/wiki/index.php/Release_History#Proxmox_Mail_Gateway_6.2 said:
Handling of changes to overridden templates with ucf
  • Starting with this release all service configuration templates, copied and modified in /etc/pmg/templates get registered with ucf. Should a overridden template change with a new package version the administrator is asked and can accept or reject the changes.
  • All users who have templates in /etc/pmg/templates will be asked about the current changes for the initial registration.

Greetz
 
Obviously this isn't true any longer, the newest update wants to change my copied config:
yes - you get asked once on this upgrade - and afterwards you will get notified whenever the shipped templates change.
 
  • Like
Reactions: matze1
I am confused. Why would PMG update overwrite /etc/pmg/templates/main.cf.in ?
PMG does not overwrite your manually modified templates in /etc/pmg/templates - the one change with PMG 6.2 was that they get registered with ucf (see `man ucf`, `man ucfr`) - and for this registration you get asked about your modifications.

with ucf you have the advantage that you will get asked about changes that are shipped with our packages (and can compare them to your modified template)

I hope this explains it.
 
  • Like
Reactions: heutger

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!