run postmap on container startup
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
Mauro Torrez 2020-02-03 13:58:41 -03:00
parent e43d97f652
commit ef5ebfbc64
2 changed files with 16 additions and 0 deletions

View File

@ -96,6 +96,7 @@ RUN echo "_dev_null: /dev/null" > /etc/aliases \
scache/unix/chroot=n
ADD confd /etc/confd/
ADD postmap.sh /start.d/zz-postmap.sh
VOLUME ["/etc/postfix","/ssl","/var/spool/postfix"]
EXPOSE 25/tcp 587/tcp

15
postmap.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
# run postmap on all configured lookup tables
postconf -h \
postscreen_access_list \
postscreen_dnsbl_reply_map \
smtpd_client_restrictions \
smtpd_helo_restrictions \
smtpd_recipient_restrictions \
virtual_alias_maps \
virtual_mailbox_maps \
| sed "s/,/\n/g" | sed "s/ /\n/g" | sort | uniq \
| egrep '(hash|ldap|pcre):' \
| xargs postmap