Skip to content

Commit

Permalink
Merge pull request #31 from jkarlosb/master
Browse files Browse the repository at this point in the history
Added config folder for Postfix
  • Loading branch information
kaiyou committed Aug 2, 2016
2 parents 93aad40 + efff62c commit 44c1d42
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -5,3 +5,4 @@ __pycache__
/admin/include
pip-selfcheck.json
/data
/docker-compose.mac.yml
1 change: 1 addition & 0 deletions docker-compose.yml
Expand Up @@ -47,6 +47,7 @@ services:
volumes:
- /freeposte/freeposte:/data
- /freeposte/certs:/certs
- /freeposte/overrides:/overrides

milter:
build: rmilter
Expand Down
6 changes: 5 additions & 1 deletion postfix/conf/main.cf
Expand Up @@ -48,4 +48,8 @@ lmtp_host_lookup = native
smtpd_milters = inet:milter:9900
milter_protocol = 6
milter_mail_macros = i {mail_addr} {client_addr} {client_name} {auth_authen}
milter_default_action = tempfail
milter_default_action = tempfail

###############
# Extra Settings
###############
22 changes: 22 additions & 0 deletions postfix/start.sh
Expand Up @@ -5,6 +5,28 @@ for VARIABLE in `env | cut -f1 -d=`; do
sed -i "s={{ $VARIABLE }}=${!VARIABLE}=g" /etc/postfix/*.cf
done

# Override Postfix configuration
if [ -f /overrides/postfix.cf ]; then
while read line; do
postconf -e "$line"
done < /overrides/postfix.cf
echo "Loaded '/overrides/postfix.cf'"
else
echo "No extra postfix settings loaded because optional '/overrides/postfix.cf' not provided."
fi

# Include table-map files
if ls -A /overrides/*.map 1> /dev/null 2>&1; then
cp /overrides/*.map /etc/postfix/
postmap /etc/postfix/*.map
rm /etc/postfix/*.map
chown root:root /etc/postfix/*.db
chmod 0600 /etc/postfix/*.db
echo "Loaded 'map files'"
else
echo "No extra map files loaded because optional '/overrides/*.map' not provided."
fi

# Actually run Postfix
rm -f /var/run/rsyslogd.pid
/usr/lib/postfix/master &
Expand Down

0 comments on commit 44c1d42

Please sign in to comment.