Package: exim4-config
Version: 4.50-6
When upgrading any recent version of the exim4 package, the exim4-config
postinst script tries to update /etc/exim4/update-exim4.conf.conf
configuration file automagically. This configuration file is used (by
update-exim4.conf) to dynamically create a new exim configuration file
(/var/lib/exim4/config.autogenerated) from templates
(/etc/exim4/exim4.conf.template or /etc/exim4/conf.d).
All appears to work if the configuration variables (ie environment
variables) in etc/exim4/update-exim4.conf.conf do not contained escape
sequences. If they do they will be replaced with their expansion. A
result can be that the exim configuration is fatally corrupted.
For example, a configuration in /etc/exim4/update-exim4.conf.conf
such as...
dc_relay_domains='*.some.net.somewhere:\\N^[^.]*$'
will be re-written (after upgrading exim4) as ...
dc_relay_domains='*.some.net.somewhere:\N^[^.]*$'
This change in the configuration is clearly not intended. (The result
in the example above is that exim stops sending mail and resolving
addresses.)
A patch fixing the problem is attached...
Regards,
Barry.
--
Barry Kitson <[EMAIL PROTECTED]>
diff -Naur exim4-4.50.old/debian/exim4-config.postinst exim4-4.50/debian/exim4-config.postinst
--- exim4-4.50.old/debian/exim4-config.postinst 2005-04-23 14:54:29.701122199 +1000
+++ exim4-4.50/debian/exim4-config.postinst 2005-04-23 14:56:45.164653443 +1000
@@ -283,22 +283,38 @@
echo "${variable}=''" >> $UE4CC
fi
done
+
# insert new values, remove outdated ones.
- sed -e "s�^[[:space:]]*dc_eximconfig_configtype=.*�dc_eximconfig_configtype='${dc_eximconfig_configtype}'�" \
- -e "s�^[[:space:]]*dc_local_interfaces=.*�dc_local_interfaces='${dc_local_interfaces}'�" \
- -e "s�^[[:space:]]*dc_other_hostnames=.*�dc_other_hostnames='${dc_other_hostnames}'�" \
- -e "s�^[[:space:]]*dc_readhost=.*�dc_readhost='${dc_readhost}'�" \
- -e "s�^[[:space:]]*dc_relay_domains=.*�dc_relay_domains='${dc_relay_domains}'�" \
- -e "s�^[[:space:]]*dc_relay_nets=.*�dc_relay_nets='${dc_relay_nets}'�" \
- -e "s�^[[:space:]]*dc_smarthost=.*�dc_smarthost='${dc_smarthost}'�" \
- -e "s�^[[:space:]]*dc_minimaldns=.*�dc_minimaldns='${dc_minimaldns}'�" \
- -e "s�^[[:space:]]*CFILEMODE=.*�CFILEMODE='${CFILEMODE}'�" \
- -e "s�^[[:space:]]*dc_never_users=.*��" \
- -e "s�^[[:space:]]*dc_use_split_config=.*�dc_use_split_config='${dc_use_split_config}'�" \
- -e "s�^[[:space:]]*dc_hide_mailname=.*�dc_hide_mailname='${dc_hide_mailname}'�" \
- -e "s�^[[:space:]]*dc_mailname_in_oh=.*�dc_mailname_in_oh='${dc_mailname_in_oh}'�" \
- < $UE4CC \
- > ${UE4CC}.tmp
+
+ # Use environment variables to communicate data to awk, to
+ # avoid shell (or awk or sed) string expansion which may
+ # expand escape sequences. Note that the variables named in
+ # ${dc_directives} (but not the variable names themselves) may
+ # contain escaped characters.
+
+ export dc_directives ${dc_directives}
+
+ awk '
+ BEGIN {
+ split( ENVIRON["dc_directives"], directives, "[[:space:]]" );
+ }
+ {
+ written = 0;
+ for ( i in directives )
+ {
+ regex = "^[[:space:]]*" directives[i] "=";
+ if ( ( $0 ~ regex ) && ( ! written ) )
+ {
+ # Add single quotes (\0x27) around the value.
+ print directives[i] "=\x27" ENVIRON[directives[i]] "\x27";
+ written = 1;
+ break;
+ }
+ }
+ if ( ! written )
+ print $0;
+ }' < ${UE4CC} > ${UE4CC}.tmp
+
mv ${UE4CC}.tmp $UE4CC
echo $mailname > /etc/mailname