On 20/04/2021 00:08, Charles Curley wrote: > On installing on Bullseye, I usually install postfix, then configure it > with "dpkg-reconfigure postfix". > > I use postfix here only for logwatch and other system emails, so the > setup isn't concerned with the Internet at large. > > The default list of systems to accept mail for doesn't look right to me: > > grissom.localdomain, grissom.localdomain, localhost.localdomain, , localhost > > * Why is the fully qualified host name in there twice, but not the > hostname alone ("grissom")? (localdomain is my local TLD on a private > network.) > > * What with the two commas toward the end? > > Shouldn't that be > > grissom.localdomain, grissom, localhost.localdomain, localhost
This looks to come from the debian/postfix.config file, and is thus part of the Debian packaging of postfix, rather than an upstream thing. In that file, at line 228, we see: if ($mailertype eq "Internet Site") { if ($mailname eq $hostname) { $destinations = join ", ",("\$myhostname", $mailname, "localhost." . $domain, ", localhost"); } else { $destinations = join ", ",("\$myhostname", $mailname, $hostname, "localhost." . $domain . ", localhost"); } } else { # don't accept mail for $mailname by default if we have a relayhost or local only mail, # unless the mailname bears no resemblance to $myorigin. $destinations = join ", ",("\$myhostname", $hostname, "localhost." . $domain . ", localhost" ); unless ( $hostname =~ m/(^|[\.])$mailname$/ ) { $destinations = $mailname . ", " . $destinations; } } [ Taken from https://sources.debian.org/src/postfix/3.5.6-1/debian/postfix.config/#L228, which might be easier to read if that wraps ] This is perl, so the join() function takes a string and an array and delimits the array with the string. So, if we take the first one as an example, the literal string "$myhostname" is followed by a comma-space, then the value in the "mailname" variable, then the literal string "localhost." with the "domain" variable appended, then another comma-space. Finally, the last element to be added to the list is ", localhost". I don't know why this was written this way, but it means that in every case, the "destinations" variable will end with ", , localhost" Sadly, the earliest revision I can find of this file on salsa.debian.org (https://salsa.debian.org/postfix-team/postfix-dev/-/commit/a0577ca96dda9c4e5e5bc9dd0c5b7cfc545c5804#ac03215119d5f2efaeb830653c7f84124ceed640_0_192) already has the ", localhost" code in it, so I can't say why it was written like that. On the upside, though, this is an allowlist of domains postfix will accept mail for. If there are duplicates, it shouldn't REALLY make much difference. It's a nice to fix (just because, if you can't explain why the code is doing something weird, you can't adequately say whether it's a problem or not).
OpenPGP_signature
Description: OpenPGP digital signature