Skip to content

Commit

Permalink
Merge #2361
Browse files Browse the repository at this point in the history
2361: postfix: wrap IPv6 CIDRs in square brackets for RELAYNETS (backport #2325) r=mergify[bot] a=mergify[bot]

This is an automatic backport of pull request #2325 done by [Mergify](https://mergify.com).


---


<details>
<summary>Mergify commands and options</summary>

<br />

More conditions and actions can be found in the [documentation](https://docs.mergify.com/).

You can also trigger Mergify actions by commenting on this pull request:

- ``@Mergifyio` refresh` will re-evaluate the rules
- ``@Mergifyio` rebase` will rebase this PR on its base branch
- ``@Mergifyio` update` will merge the base branch into this PR
- ``@Mergifyio` backport <destination>` will backport this PR on `<destination>` branch

Additionally, on Mergify [dashboard](https://dashboard.mergify.com/) you can:

- look at your merge queues
- generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com
</details>


Co-authored-by: Pim van den Berg <pim@nethuis.nl>
  • Loading branch information
bors[bot] and pommi committed Jun 8, 2022
2 parents dcd9488 + 7d16b39 commit 1709070
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/postfix/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import multiprocessing
import logging as log
import sys
import re

from podop import run_server
from pwd import getpwnam
Expand Down Expand Up @@ -50,6 +51,10 @@ def is_valid_postconf_line(line):
os.environ["POSTFIX_LOG_SYSLOG"] = os.environ.get("POSTFIX_LOG_SYSLOG","local")
os.environ["POSTFIX_LOG_FILE"] = os.environ.get("POSTFIX_LOG_FILE", "")

# Postfix requires IPv6 addresses to be wrapped in square brackets
if 'RELAYNETS' in os.environ:
os.environ["RELAYNETS"] = re.sub(r'([0-9a-fA-F]+:[0-9a-fA-F:]+)/', '[\\1]/', os.environ["RELAYNETS"])

for postfix_file in glob.glob("/conf/*.cf"):
conf.jinja(postfix_file, os.environ, os.path.join("/etc/postfix", os.path.basename(postfix_file)))

Expand Down
1 change: 1 addition & 0 deletions towncrier/newsfragments/2325.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
postfix: wrap IPv6 CIDRs in square brackets for RELAYNETS

0 comments on commit 1709070

Please sign in to comment.