Bug 50647 - Postgrey ignores *.local configurations
Postgrey ignores *.local configurations
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Mail
UCS 4.4
Other Linux
: P5 normal (vote)
: UCS 4.4-3-errata
Assigned To: Tobias Wenzel
Sönke Schwardt-Krummrich
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-12-17 14:09 CET by Nico Stöckigt
Modified: 2020-03-18 12:27 CET (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 4: Minor Usability: Impairs usability in secondary scenarios
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.091
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2019121721000489
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nico Stöckigt univentionstaff 2019-12-17 14:09:13 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.
============================================================
Comment 1 Christian Kowarzik 2020-01-07 21:40:48 CET
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.
Comment 2 Tobias Wenzel univentionstaff 2020-02-13 09:31:40 CET
[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
Comment 3 Sönke Schwardt-Krummrich univentionstaff 2020-03-16 21:57:35 CET
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.
Comment 4 Tobias Wenzel univentionstaff 2020-03-17 13:43:12 CET
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
Comment 5 Sönke Schwardt-Krummrich univentionstaff 2020-03-17 21:32:49 CET
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
Comment 6 Erik Damrose univentionstaff 2020-03-18 12:27:46 CET
<http://errata.software-univention.de/ucs/4.4/488.html>