diff options
Diffstat (limited to 'content')
-rw-r--r-- | content/etc/davmail/davmail.properties.template | 8 | ||||
-rwxr-xr-x | content/opt/davmail/entrypoint.sh | 9 |
2 files changed, 13 insertions, 4 deletions
diff --git a/content/etc/davmail/davmail.properties.template b/content/etc/davmail/davmail.properties.template index 74b9584..c37be5b 100644 --- a/content/etc/davmail/davmail.properties.template +++ b/content/etc/davmail/davmail.properties.template @@ -39,10 +39,10 @@ davmail.bindAddress= davmail.clientSoTimeout= # DavMail listeners SSL configuration -davmail.ssl.keystoreType= -davmail.ssl.keystoreFile= -davmail.ssl.keystorePass= -davmail.ssl.keyPass= +davmail.ssl.keystoreType=${DAVMAIL_SSL_PASS:+PKCS12} +davmail.ssl.keystoreFile=${DAVMAIL_SSL_PASS:+/etc/davmail/davmail.p12} +davmail.ssl.keystorePass=${DAVMAIL_SSL_PASS} +davmail.ssl.keyPass=${DAVMAIL_SSL_PASS} # Accept specified certificate even if invalid according to trust store davmail.server.certificate.hash=${DAVMAIL_SERVER_CERTIFICATE_HASH} diff --git a/content/opt/davmail/entrypoint.sh b/content/opt/davmail/entrypoint.sh index 7b3b518..6555503 100755 --- a/content/opt/davmail/entrypoint.sh +++ b/content/opt/davmail/entrypoint.sh @@ -13,6 +13,15 @@ elif [ -n "$DAVMAIL_URL" ]; then done < /etc/davmail/davmail.properties.template > $CONFIG fi +if [ -n "$DAVMAIL_SSL_PASS" ]; then + if [ ! -r /etc/davmail/davmail.p12 ] || [ ! -s /etc/davmail/davmail.p12 ]; then + echo "ERROR: can't read ssl keystore [/etc/davmail/davmail.p12]!" + return 2 + fi +fi + +if [ -z "$DAVMAIL_SSL_PASS" ] || [ ! -s /etc/davmail/davmail.p12 ] + if [ -r "$CONFIG" ]; then exec /opt/davmail/davmail.sh "$CONFIG" else |