Dockerized postfix
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

26 lines
754 B

  1. #!/bin/sh
  2. echo "${PWD##*/}: started."
  3. # WORKAROUND:
  4. # postfix has to be aware of the DNS servers
  5. # without this workaround it uses 127.0.0.1:53 for some unknown (yet) reason...
  6. [ -d /var/spool/postfix/etc ] || mkdir -v /var/spool/postfix/etc
  7. diff -q /var/spool/postfix/etc/resolv.conf /etc/resolv.conf 2>/dev/null
  8. [ $? -eq 0 ] || cp -v /etc/resolv.conf /var/spool/postfix/etc/resolv.conf
  9. # run postfix consistency check and exit if failed
  10. set -e
  11. postfix check 2>&1
  12. # run Postfix
  13. set -x
  14. exec /usr/libexec/postfix/master 2>&1
  15. # alpine <3.9
  16. #exec /usr/lib/postfix/master 2>&1
  17. # Do not use 'postfix start-fg' command since it does not handle the signals,
  18. # e.g. if you do 'sv restart postfix', postfix/master will NOT receive the
  19. # SIGTERM signal.