diff options
author | Malfurious <m@lfurio.us> | 2024-06-08 14:49:26 -0400 |
---|---|---|
committer | Malfurious <m@lfurio.us> | 2024-06-09 14:16:42 -0400 |
commit | 26dab860bd733e4f110fc837e1f3d8c682248502 (patch) | |
tree | 165098e36582b02718685d678efa84ef9cc38c0e /postfix | |
parent | 55a364bda1d1f293a0691198cd6a4d1784cb2f87 (diff) | |
download | mailnode-26dab860bd733e4f110fc837e1f3d8c682248502.tar.gz mailnode-26dab860bd733e4f110fc837e1f3d8c682248502.zip |
postfix: Add service entrypoint script
This is used to generate database files used by postfix daemons.
In theory, this could also be performed at build-time by the Dockerfile.
However, I intend to create only a single image that each service
separately spawns from, since there will be several commonalities
between them. Moving these postfix-specific tasks to an entrypoint
script keeps the common Dockerfile more managable.
Signed-off-by: Malfurious <m@lfurio.us>
Diffstat (limited to 'postfix')
-rwxr-xr-x | postfix/entrypoint.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/postfix/entrypoint.sh b/postfix/entrypoint.sh new file mode 100755 index 0000000..18805eb --- /dev/null +++ b/postfix/entrypoint.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# Generate virtual mailbox mappings from user password file +# "user@domain domain/user/" +sed 's/:.*$//g' </etc/userconfig/passwd \ + | awk -F '@' '{printf "%s %s/%s/\n", $0, $2, $1}' >/etc/postfix/vmailbox + +# Generate Berkeley DB files +postmap /etc/postfix/vmailbox +postmap /etc/userconfig/aliases + +exec /usr/sbin/postfix start-fg |