[SOLVED] howto change domainname in "double-bounce@mx.localdomain"

Plaintext

New Member
Feb 27, 2018
14
0
1
54
I am really sorry to ask, because it should be obvious somewhere. But I cannot find the right config file.

The "problem" is, that in all headers generated by the new PMG (6.0) the domainname is set to localdomain. Although mails are delivered fine this is not nice.
(i.e. "F=<double-bounce@mx.localdomain>")
/etc/hosts has the right domain, but this is obviously not used
/etc/resolv.conf and /etc/postfix/main.cf get overwritten on reboot.
I cannot find the right template in /var/lib/pmg/templates to change the domainname.

(I even change the domainname on boot with `domainname <FQDN>` and `domainname -d` gives the right answer, but still postfix says "localdomain".

Could anyone pleas give a hint why "[% dns.domain %]" isn't resolved correctly.
 
Last edited:
check your ''/etc/resolv.conf' - maybe the searchdomain still points to 'localdomain'?

I hope this helps!
 
Do you have a 'search' entry in '/etc/resolv.conf' - since the code takes that as 'dns.domain' ?
(please post your '/etc/resolv.conf' if yes - then I'll try to reproduce it here)
as for the template - '/etc/postfix/main.cf' gets rendered by PMG from '/var/lib/pmg/templates/main.cf.in' , you need to copy it to '/etc/pmg/templates' if you wish to change it (check the reference documentation -https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#_service_configuration_templates).
'/etc/resolv.conf' gets written by `resolvconf` with the information from '/etc/network/interfaces'
 
Do you have a 'search' entry in '/etc/resolv.conf' - since the code takes that as 'dns.domain' ?
(please post your '/etc/resolv.conf' if yes - then I'll try to reproduce it here)
as for the template - '/etc/postfix/main.cf' gets rendered by PMG from '/var/lib/pmg/templates/main.cf.in' , you need to copy it to '/etc/pmg/templates' if you wish to change it (check the reference documentation -https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#_service_configuration_templates).
'/etc/resolv.conf' gets written by `resolvconf` with the information from '/etc/network/interfaces'

Hmm, /etc/resolv.conf gets overwritten on reboot .
So I "hardcoded" these in /var/lib/pmg/templates/main.cf.in (do I have to copy it to /etc/pmg/templates?)
"mydomain = myName # [% dns.domain %]"
"myhostname = myFullname# [% dns.hostname %].[% dns.domain %]"

that seems to work. I guess my provider (hetzner) ist rewriting my resolv.conf on reboot :-(
 
So I "hardcoded" these in /var/lib/pmg/templates/main.cf.in (do I have to copy it to /etc/pmg/templates?)
yes - otherwise it will get overwritten upon package-upgrades! - and you need to check that the template remains compatible upon package-upgrades.

that seems to work. I guess my provider (hetzner) ist rewriting my resolv.conf on reboot :-(
can happen - but do also check whether you have any 'dns-' options configured in '/etc/network/interfaces' and the 'resolvconf' package installed
(if not you could install it and configure it accordingly)
 
  • Like
Reactions: Plaintext
Great, I reverted my changes in the template and with dns-search in /etc/network/interfaces it works.
Thanks for your time!
 
Glad you solved the issue! Please mark the post as 'SOLVED' so that others know what to expect.
Thanks!
 

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!