Postfix Local only configuration adds 2 dots on hostname , blocking package upgrades

Bug #1929786 reported by Nikola M
This bug report is a duplicate of:  Bug #1906970: [SRU] dpkg hook hostname error. Edit Remove
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
postfix (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

After updating from 20.10 to 21.04 (Xubuntu) I ended up during upgrade asked if I want "internet site" or "Local only" configuration on postfix.
Since not planning on having FQDN mail server on this machine, I choosed Local only.
If I remove 2 dots from hostname = in /etc/postfix/main.cf , they get re-added after
' apt upgrade ' and that seems to stop packages upgrade process on machine.

Setting up postfix (3.5.6-1) ...
setting myhostname=xdesk.. in /etc/postfix

Postfix (main.cf) is now set up with the changes above. If you need to make
changes, edit /etc/postfix/main.cf (and others) as needed. To view Postfix
configuration values, see postconf(1).

After modifying main.cf, be sure to run 'systemctl reload postfix'.

Running newaliases
newaliases: warning: valid_hostname: misplaced delimiter: xdesk..
newaliases: fatal: file /etc/postfix/main.cf: parameter myhostname: bad parameter value: xdesk..
dpkg: error processing package postfix (--configure):
 installed postfix package post-installation script subprocess returned error exit status 75
Processing triggers for libc-bin (2.33-0ubuntu5) ...
Errors were encountered while processing:
 postfix
E: Sub-process /usr/bin/dpkg returned an error code (1)

ProblemType: Bug
DistroRelease: Ubuntu 21.04
Package: postfix 3.5.6-1
ProcVersionSignature: Ubuntu 5.11.0-17.18-generic 5.11.12
Uname: Linux 5.11.0-17-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.11-0ubuntu65.1
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: XFCE
Date: Thu May 27 09:35:04 2021
DuplicateSignature: InvalidHostOrDomain
EtcMailname: *** /etc/mailname does not exist ***
Hostname: xdesk
PostconfMydomain: .
PostconfMyhostname: xdesk..
PostconfMyorigin: $myhostname
SourcePackage: postfix
UpgradeStatus: Upgraded to hirsute on 2021-05-27 (0 days ago)

Revision history for this message
Nikola M (nikolam) wrote :
information type: Private Security → Public
Revision history for this message
Apport retracing service (apport) wrote : Possible regression detected

This crash has the same stack trace characteristics as bug #1531299. However, the latter was already fixed in an earlier package version than the one in this report. This might be a regression or because the problem is in a dependent package.

tags: removed: need-duplicate-check
tags: added: regression-retracer
Revision history for this message
Utkarsh Gupta (utkarsh) wrote :

Hi Nikola,

Thanks for filing the bug and help make Ubuntu server better.

I tried to reproduce the bug as you mentioned but wasn't able to. In a Groovy (20.10) VM, I install postfix, configured it as you mentioned, did upgrade, and finally upgrade to Hirsute (21.04) but both the upgrade went fix. I used hostname=xdesk and whilst I can confirm that it did add two dots but as I mentioned, the upgrade went OK.

$ grep myhostname /etc/postfix/main.cf
[...]
myhostname = xdesk..
[...]

Although your log shows that this is what caused the problem, I'd like to ask if you can help me layout a reproducer (that is, steps to reproduce this bug) so that we can help fix this?

Also, since we are in sync with the version of postfix in Debian (that is, 3.5.6-1)[1], can you please forward this bug report to Debian? Scott is an active maintainer and once this is fixed there, the fix will land here in Impish (21.10) and we can further backport (SRU) this fix to older releases, depending upon the patch and its details, et al. Thanks!

[1]: https://tracker.debian.org/pkg/postfix

Changed in postfix (Ubuntu):
status: New → Triaged
Revision history for this message
Daniel Hollocher (chogydan) wrote :

I had this issue as well. Seems to be some sort of config issue. I replaced with /etc/postfix/main.cf with a blank file, and it worked.

I did not configure it myself, but I did get a question about postfix during my upgrade, where I selected the default selection. The upgrade was from 20.10->21.04, so I think this might be an upgrade issue.

Changed in postfix (Ubuntu):
status: Triaged → Confirmed
Revision history for this message
Daniel Hollocher (chogydan) wrote :

I'm attaching my old config, ie, the one I deleted. Also, I switched the bug from Triaged to Confirmed because I'm not sure how this bug is Triaged. It might not even be a postfix issue.

That's all I got!

Revision history for this message
Bryce Harrington (bryce) wrote :

Hi Nicola and Daniel, this is a known issue (LP: #1906970) and I'll set this as a dupe. Discussions regarding fixing the underlying problem are centered on that bug.

It sounds like the workaround is to use your FQDN on initial installation or perhaps to exclude using `search .` in your config. HTH

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.