Skip to content

Commit d33dc53

Browse files
Merge pull request #39 from mazhora/develop
feat(postfix): add support for extending mynetworks
2 parents fdd3c1e + 13b0656 commit d33dc53

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ _mailserver-postfix_ requires various environment variables to be set. The cont
6161
| `PF_TLS_CAPATH` | Directory that contains trusted CA root certificates. | `/etc/ssl/certs` |
6262
| `PF_TLS_CAFILE` | Name of single file that contains trusted CA root certificates. | `/etc/postfix/CAcert.pem` |
6363
| `PF_TLS_ADMIN_EMAIL` | E-mail address to be notified when TLS certificate is about to expire (10 days) | `postmaster@$PF_MYDOMAIN` |
64+
| `PF_ADD_MYNETWORKS`| A string containing additional subnets with a mask to add to the `mynetworks` file in main.cf | |
6465

6566
## Volumes
6667
You need to provide data volumes in order to secure your mailboxes from data loss.

etc/postfix/main.cf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
##
22
## NETWORKING
33
##
4-
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
4+
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 __PF_ADD_MYNETWORKS__
55
inet_interfaces = all
66
myhostname = __PF_MYHOSTNAME__
77
myorigin = __PF_MYORIGIN__

src/entrypoint.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ fi
7474
if [[ -z "${PF_MILTERS}" ]]; then
7575
PF_MILTERS=
7676
fi
77+
if [[ -z "${PF_ADD_MYNETWORKS}" ]]; then
78+
PF_ADD_MYNETWORKS=
79+
fi
7780
####################
7881
# Helper functions
7982
####################
@@ -131,6 +134,7 @@ copy_template_file() {
131134
replace_var $TMP_DST 'PF_DB_PASS'
132135
replace_var $TMP_DST 'PF_ENABLE_UTF8'
133136
replace_var $TMP_DST 'PF_MILTERS'
137+
replace_var $TMP_DST 'PF_ADD_MYNETWORKS'
134138
fi
135139
if [ ! -f $TMP_DST ]; then
136140
echo "Cannot create $TMP_DST" 1>&2

0 commit comments

Comments
 (0)