Add backwards compatibility for old dns_blocklists.cf files by making… #6157
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
… sure indentation is correct
Contribution Guidelines
What does this PR include?
Short Description
Some people had problems with the latest mailcow release (2024-11, see https://community.mailcow.email/d/4244-i-no-longer-receive-emails-and-i-no-longer-send-emails). The reason for the problems was an older version of data/conf/postfix/dns_blocklists.cf which was created with another indentation than the currently used one.
A new Postfix config line was introduced in c53bf85 which led to erroneous parsing due to the indentation and resulting in this error:
bad numerical configuration: lmtp_destination_recipient_limit = 1 postscreen_dnsbl_sites = wl.mailspike.net=127.0.0.[18;19;20]-2 hostkarma.junkemailfilter.com=127.0.0.1-2 list.dnswl.org=127.0.[0..255].0-2 list.dnswl.org=127.0.[0..255].1-4 list.dnswl.org=127.0.[0..255].2-6 list.dnswl.org=127.0.[0..255].3-8 ix.dnsbl.manitu.net2 bl.spamcop.net2 bl.suomispam.net2 hostkarma.junkemailfilter.com=127.0.0.23 hostkarma.junkemailfilter.com=127.0.0.42 hostkarma.junkemailfilter.com=127.0.1.21 backscatter.spameatingmonkey.net2 bl.ipv6.spameatingmonkey.net2 bl.spameatingmonkey.net2 b.barracudacentral.org=127.0.0.27 bl.mailspike.net=127.0.0.25 bl.mailspike.net=127.0.0.[10;11;12]4 dnsbl.sorbs.net=127.0.0.108 dnsbl.sorbs.net=127.0.0.56 dnsbl.sorbs.net=127.0.0.73 dnsbl.sorbs.net=127.0.0.82 dnsbl.sorbs.net=127.0.0.62 dnsbl.sorbs.net=127.0.0.92 zen.spamhaus.org=127.0.0.[10;11]8 zen.spamhaus.org=127.0.0.[4..7]6 zen.spamhaus.org=127.0.0.34 zen.spamhaus.org=127.0.0.23 zen.spamhaus.org=127.0.0.[10;11]8 zen.spamhaus.org=127.0.0.[4..7]6 zen.spamhaus.org=127.0.0.34 zen.spamhaus.org=127.0.0.23
Due to the indentation of data/conf/postfix/dns_blocklists.cf the content was added to the lmtp_destination_recipient_limit parameter, leading to the error.
The fix strips the whitespaces at the beginning of the line containing "postscreen_dnsbl_sites" to restore a proper indentation.
Affected Containers
Did you run tests?
Yes
What did you tested?
Edited /opt/postfix.sh inside the container to apply my new command, tested multiple variants of the dns_blocklists.cf file
What were the final results? (Awaited, got)
The indentation was corrected.
Before:
After: