From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: pmg-devel@lists.proxmox.com
Subject: [pmg-devel] [PATCH pmg-api 1/1] fix #3712: strip trailing dot from searchdomain
Date: Mon, 22 Nov 2021 20:49:39 +0100 [thread overview]
Message-ID: <20211122194939.358920-1-s.ivanov@proxmox.com> (raw)
having a trailing '.' in the search domain is perfectly legal syntax
(for domain names in general). postfix refuses to use a fqdn with
trailing dot as hostname[0].
The restriction might be due to section 2.3.5 (Domain Names) of
RFC5321 (a top-level domain is a single string without any dots) [1]
[0] src/util/valid_hostname.c in the postfix source
[1] https://datatracker.ietf.org/doc/html/rfc5321#section-2.3.5
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
src/PMG/Config.pm | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/PMG/Config.pm b/src/PMG/Config.pm
index cbcda6e..31f9c6f 100755
--- a/src/PMG/Config.pm
+++ b/src/PMG/Config.pm
@@ -1278,6 +1278,8 @@ sub get_host_dns_info {
my $resolv = PVE::INotify::read_file('resolvconf');
my $domain = $resolv->{search} // 'localdomain';
+ # postfix will not parse a hostname with trailing '.'
+ $domain =~ s/^(.*)\.$/$1/;
$dnsinfo->{domain} = $domain;
$dnsinfo->{fqdn} = "$nodename.$domain";
--
2.30.2
next reply other threads:[~2021-11-22 19:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-22 19:49 Stoiko Ivanov [this message]
2021-11-23 11:52 ` [pmg-devel] applied: " Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211122194939.358920-1-s.ivanov@proxmox.com \
--to=s.ivanov@proxmox.com \
--cc=pmg-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox