mirror of
https://github.com/bokysan/docker-postfix.git
synced 2024-09-20 14:56:10 +08:00
OpenDKIM keys have been moved to the keys
folder
This is to make it easier to integrate with Kubernetes to be able to bind a `ConfigMap` to the said folder.
This commit is contained in:
parent
afccfdb3fc
commit
38d7627d96
|
@ -145,16 +145,13 @@ You'll need to create a folder for every domain you want to send through Postfi
|
|||
|
||||
```
|
||||
mkdir -p /host/keys; cd /host/keys
|
||||
mkdir example.com; cd example.com
|
||||
opendkim-genkey -s mail -d example.com
|
||||
cd ..
|
||||
mkdir example.org; cd example.org
|
||||
opendkim-genkey -s mail -d example.org
|
||||
opendkim-genkey -b 2048 -h rsa-sha256 -r -v -s example.com -d example.com
|
||||
opendkim-genkey -b 2048 -h rsa-sha256 -r -v -s example.org -d example.org
|
||||
```
|
||||
|
||||
`opendkim-genkey` is usually in your favourite distribution provided by installing `opendkim-tools` or `opendkim-utils`.
|
||||
|
||||
Add the created `mail.txt` files to your DNS record. Afterwards, just mount `/etc/opendkim/keys` into your image and DKIM
|
||||
Add the created `<domain>.txt` files to your DNS records. Afterwards, just mount `/etc/opendkim/keys` into your image and DKIM
|
||||
will be used automatically, e.g.:
|
||||
```
|
||||
docker run --rm --name postfix -e "ALLOWED_SENDER_DOMAINS=example.com example.org" -v /host/keys:/etc/opendkim/keys -p 1587:587 boky/postfix
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/sh
|
||||
if [ ! -d /etc/opendkim/keys ]; then
|
||||
sleep 9999999999999999999
|
||||
elif [ -z "$(find /etc/opendkim/keys -type d ! -name .)" ]; then
|
||||
elif [ -z "$(find /etc/opendkim/keys -type f ! -name .)" ]; then
|
||||
sleep 9999999999999999999
|
||||
else
|
||||
/usr/sbin/opendkim -D -f -x /etc/opendkim/opendkim.conf
|
||||
|
|
4
run.sh
4
run.sh
|
@ -201,7 +201,7 @@ if [ ! -z "$MASQUERADED_DOMAINS" ]; then
|
|||
fi
|
||||
|
||||
DKIM_ENABLED=
|
||||
if [ -d /etc/opendkim/keys ] && [ ! -z "$(find /etc/opendkim/keys -type d ! -name .)" ]; then
|
||||
if [ -d /etc/opendkim/keys ] && [ ! -z "$(find /etc/opendkim/keys -type f ! -name .)" ]; then
|
||||
DKIM_ENABLED=", ${emphasis}opendkim${reset}"
|
||||
echo -e "‣ $notice Configuring OpenDKIM."
|
||||
mkdir -p /var/run/opendkim
|
||||
|
@ -227,7 +227,7 @@ if [ -d /etc/opendkim/keys ] && [ ! -z "$(find /etc/opendkim/keys -type d ! -nam
|
|||
echo "" >> /etc/opendkim/TrustedHosts
|
||||
if [ ! -z "$ALLOWED_SENDER_DOMAINS" ]; then
|
||||
for i in $ALLOWED_SENDER_DOMAINS; do
|
||||
private_key=/etc/opendkim/keys/$i/mail.private
|
||||
private_key=/etc/opendkim/keys/$i.private
|
||||
if [ -f $private_key ]; then
|
||||
echo -e " ...for domain ${emphasis}$i${reset}"
|
||||
echo "*.$i" >> /etc/opendkim/TrustedHosts
|
||||
|
|
Loading…
Reference in a new issue