public
nobgit
read
NobMail
Based on mailcow: dockerized
Languages
Repository composition by tracked source files.
PHP
49%
JavaScript
35%
HTML
9%
CSS
4%
Shell
2%
Python
1%
Lua
0%
Perl
0%
Ruby
0%
SCSS
0%
Create file
Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git
Commit
[Postfix] Add custom_transport.pcre
e1fdbba0
.gitignore | 1 +
data/Dockerfiles/postfix/postfix.sh | 9 +++++++--
data/conf/postfix/main.cf | 3 ++-
3 files changed, 10 insertions(+), 3 deletions(-)
Diff
diff --git a/.gitignore b/.gitignore
index 4dd71779..9d1dbfda 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,6 +10,7 @@ data/conf/postfix/sni.map
data/conf/postfix/sni.map.db
data/conf/postfix/extra.cf
data/conf/postfix/sql
+data/conf/postfix/custom_transport.pcre
data/conf/postfix/allow_mailcow_local.regexp
data/conf/dovecot/sql
data/conf/nextcloud-*.bak
diff --git a/data/Dockerfiles/postfix/postfix.sh b/data/Dockerfiles/postfix/postfix.sh
index 766ed967..8af2cdbc 100755
--- a/data/Dockerfiles/postfix/postfix.sh
+++ b/data/Dockerfiles/postfix/postfix.sh
@@ -313,9 +313,14 @@ if [ -f /opt/postfix/conf/extra.cf ]; then
cat /opt/postfix/conf/extra.cf >> /opt/postfix/conf/main.cf
fi
+if [ ! -f /opt/postfix/conf/custom_transport.pcre ]; then
+ echo "Creating dummy custom_transport.pcre"
+ touch /opt/postfix/conf/custom_transport.pcre
+fi
+
# Fix Postfix permissions
-chown -R root:postfix /opt/postfix/conf/sql/
-chmod 640 /opt/postfix/conf/sql/*.cf
+chown -R root:postfix /opt/postfix/conf/sql/ /opt/postfix/conf/custom_transport.pcre
+chmod 640 /opt/postfix/conf/sql/*.cf /opt/postfix/conf/custom_transport.pcre
chgrp -R postdrop /var/spool/postfix/public
chgrp -R postdrop /var/spool/postfix/maildrop
postfix set-permissions
diff --git a/data/conf/postfix/main.cf b/data/conf/postfix/main.cf
index 36fb7d85..3157fb73 100644
--- a/data/conf/postfix/main.cf
+++ b/data/conf/postfix/main.cf
@@ -181,7 +181,8 @@ smtp_tls_policy_maps=proxy:mysql:/opt/postfix/conf/sql/mysql_tls_policy_override
smtp_header_checks = pcre:/opt/postfix/conf/anonymize_headers.pcre
mail_name = Postcow
# local_transport map catches local destinations and prevents routing local dests when the next map would route "*"
-transport_maps = pcre:/opt/postfix/conf/local_transport,
+transport_maps = pcre:/opt/postfix/conf/custom_transport.pcre,
+ pcre:/opt/postfix/conf/local_transport,
proxy:mysql:/opt/postfix/conf/sql/mysql_transport_maps.cf
smtp_sasl_auth_soft_bounce = no
postscreen_discard_ehlo_keywords = silent-discard, dsn