[SOLVED] Additional parameters added to /var/lib/pmg/templates/main.cf.in not applied after upgrade & restart

OhmegaStar

New Member
Feb 25, 2022
9
2
3
54
Hi,

I have implemented smart host with tls & credentials following the excellent guide here:
https://www.caretech.io/2018/10/06/how-to-use-proxmox-mail-gateway-with-an-authenticated-smarthost/

I've added my additional parameters to the /var/lib/pmg/templates/main.cf.in

Code:
[% IF pmg.mail.smarthost %]
default_transport = smtp:[% pmg.mail.smarthost %]:[% pmg.mail.smarthostport %]
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/relay_passwd
smtp_sasl_security_options =
[% END %]

I also added these lines manual to the /etc/postfix/main.cf
Code:
default_transport = smtp:mail.smarthost.com:2525
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/relay_passwd
smtp_sasl_security_options =

and restarted postfix

This works fine.

But after eg. kernel upgrade & restart the /etc/postfix/main.cf will be missing the extra lines, only retaining the default_transport:
Code:
default_transport = smtp:mail.smarthost.com:2525

The additional lines are still in /var/lib/pmg/templates/main.cf.in
What am I missing ?

/OhmegaStar
 
Version:
Linux hostname 5.15.108-1-pve #1 SMP PVE 5.15.108-2 (2023-07-20T10:06Z) x86_64
7.3-8

proxmox-mailgateway: 7.3-2
pmg-api: 7.3-8
pmg-gui: 3.3-2
pve-kernel-5.15: 7.4-4
pve-kernel-5.13: 7.1-9
pve-kernel-5.15.108-1-pve: 5.15.108-2
pve-kernel-5.15.107-2-pve: 5.15.107-2
pve-kernel-5.13.19-6-pve: 5.13.19-15
pve-kernel-5.13.19-1-pve: 5.13.19-3
 
Solved, was missing that there need to be a copy in /etc/pmg/templates/
(there was an old version without the added lines)
Placed a copy there. made sure the changes are in that file.

/OhmegaStar
 
  • Like
Reactions: Stoiko Ivanov

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!