Univention Bugzilla – Bug 50647
Postgrey ignores *.local configurations
Last modified: 2020-03-18 12:27:46 CET
When setting the UCR-V for whitelisting as ============================================================ # ucr info mail/postfix/greylisting/client/whitelist /etc/postgrey/whitelist_clients /etc/postgrey/whitelist_clients.local If greylisting is enabled (see 'mail/postfix/greylisting), this variable configures a list of configuration files in which mail domains are configured for which no greylisting is made. An example for the file format is /etc/postgrey/whitelist_clients. Multiple file names must be separated by spaces. # ucr info mail/postfix/greylisting/recipient/whitelist /etc/postgrey/whitelist_recipients /etc/postgrey/whitelist_recipients.local If greylisting is enabled (see 'mail/postfix/greylisting), this variable configures a list of configuration files in which e-mail addresses are configured for which no greylisting is made. An example for the file format is /etc/postgrey/whitelist_recipients. Multiple file names must be separated by spaces. ============================================================ the *.local files aren't read. This contradicts the manual as well as the man page man page: ============================================================ [...] per default /etc/postgrey/whitelist_clients.local and /etc/postgrey/whitelist_recipients.local are also read, so that you can put there local entries. ============================================================
After *initial* installation of univention-postgrey the postgrey configuration in /etc/default/postgrey does not reflect the values of the UCR variables mail/postfix/greylisting/client/whitelist and mail/postfix/greylisting/recipient/whitelist. # grep -v "^#" /etc/default/postgrey POSTGREY_OPTS='--inet=10023 --delay=300 --max-age=35 --retry-window=48h --auto-whitelist-clients=5 --lookup-by-host --privacy --whitelist-clients=/etc/postgrey/whitelist_clients --whitelist-recipients=/etc/postgrey/whitelist_recipients' # ucr get mail/postfix/greylisting/client/whitelist /etc/postgrey/whitelist_clients /etc/postgrey/whitelist_clients.local # ucr get mail/postfix/greylisting/client/whitelist /etc/postgrey/whitelist_clients /etc/postgrey/whitelist_clients.local Therefore the *local files aren't read by postgrey. Subsequent changes of the mentioned UCR variables do update /etc/default/postgrey correctly.
[4.4-3] 707f969ef4 Bug #50647: Set the values of the UCR variables mail/postfix/greylisting/client/whitelist and mail/postfix/greylisting/recipient/whitelist to update /etc/default/postgrey correctly during the installation of univention-postgrey. Set variable with '=' instead of '?' before restarting postfix and postgrey. Package: univention-postgrey Version: 7.0.0-2A~4.4.0.202002120944 Branch: ucs_4.4-0 Scope: errata4.4-3
The UCR template checks if the ".local" files exists, if and only if the file exists, the additional argument is added to /etc/default/postgrey. During initial installation, the following actions are done within the postinst script: 1) set mail/postfix/greylisting/client/whitelist to "/etc/postgrey/whitelist_clients /etc/postgrey/whitelist_clients.local" 2) create /etc/postgrey/whitelist_clients.local → the file does not exist when the UCR variable is set (and the UCR template is evaluated) Please reorder the postinst script: 1) create the .local files 2) #DEBHELPER 3) set the UCR variables as before via ? So the new code block is obsolete. Btw: debian/changelog lines should be no longer than 80 characters.
I implemented the suggestions. After the initial installation: #grep -v "^#" /etc/default/postgrey POSTGREY_OPTS='--inet=10023 --delay=300 --max-age=35 --retry-window=48h --auto-whitelist-clients=5 --lookup-by-host --privacy --whitelist-clients=/etc/postgrey/whitelist_clients --whitelist-clients=/etc/postgrey/whitelist_clients.local --whitelist-recipients=/etc/postgrey/whitelist_recipients --whitelist-recipients=/etc/postgrey/whitelist_recipients.local' [4.4-3] 175b2faabb Bug #50647: yaml [4.4-3] b1e03ddf29 Bug #50647: QA Suggestions [4.4-3] 857997bd88 Bug #50647: yaml [4.4-3] 80a64c1917 Bug #50647: Add yaml [4.4-3] 707f969ef4 Bug #50647: Set the values of the UCR variables mail/postfix/greylisting/client/whitelist and mail/postfix/greylisting/recipient/whitelist to update /etc/default/postgrey correctly during the installation of univention-postgrey. Successful build Package: univention-postgrey Version: 7.0.0-3A~4.4.0.202003171334 Branch: ucs_4.4-0 Scope: errata4.4-3
After a fresh installation: root@master32:~# ls -la /etc/postgrey/whitelist* -rw-r--r-- 1 root root 9175 Feb 9 2019 whitelist_clients -rw-r--r-- 1 root root 0 Mär 11 22:42 whitelist_clients.local -rw-r--r-- 1 root root 189 Feb 9 2019 whitelist_recipients -rw-r--r-- 1 root root 0 Mär 11 22:42 whitelist_recipients.local root@master32:~# grep POSTGREY /etc/default/postgrey POSTGREY_OPTS='--inet=10023 --delay=300 --max-age=35 --retry-window=48h --auto-whitelist-clients=5 --lookup-by-host --privacy --whitelist-clients=/etc/postgrey/whitelist_clients --whitelist-clients=/etc/postgrey/whitelist_clients.local --whitelist-recipients=/etc/postgrey/whitelist_recipients --whitelist-recipients=/etc/postgrey/whitelist_recipients.local' OK: code change OK: installation OK: update ~OK: changelog entry UPDATED: advisory OK: functional change OK: package built and installable
<http://errata.software-univention.de/ucs/4.4/488.html>