tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[patch] fixes for rc.d/postfix

(The mailing list seems to have eaten my email (from, resending it from my other email address)

1. A postfix configuration entry like:
> alias_database = hash:$config_directory/foo
causes the postfix's rc script to say
> postfix: rebuilding $config_directory/foo (missing $config_directory/foo)
i.e. $config_directory isn't expanded (by postconf).  The fix is to
give postconf an -x so it does expand variables.

2. A configuration list like:
> alias_database =
>         hash:foo,
>         hash:bar
causes the postfix's rc script to probe for 'foo,':
> postfix: rebuilding foo, (missing foo,.db)
even though comma is a legitimate separator (as is whitespace) in
postfix's configuration file.
More generally, any sequence of comma, space, tab, newline acts as a
separator as far as postfix is concerned. postconf does not normalize
the separators, so the rc script needs to be able to handle cases like
"foo,bar fizz, buzz" (should split into 'foo' 'bar' 'fizz' 'buzz'
rather than 'foo,bar' 'fizz,' 'buzz' as it does currently).

The below patch addresses both issues.

Note that NetBSD 6's postconf does not support expansion, so if
backported, the -x must be dropped.

  Timo Buhrmester

--- etc/rc.d/postfix.orig	2016-08-18 00:32:51.000000000 +0200
+++ etc/rc.d/postfix	2016-08-18 00:32:41.000000000 +0200
@@ -44,9 +44,10 @@ postfix_precmd()
-	for f in $($postconf -h alias_database); do
-		OIFS="${IFS}"
-		IFS="${IFS}:"
+	OIFS="${IFS}"
+	IFS="${IFS},"
+	for f in $($postconf -hx alias_database); do
+		IFS="${OIFS}:"
 		set -- $f
 		case "$1" in

Home | Main Index | Thread Index | Old Index