diff --git a/dockerfiles/services/nginx-php/ssmtp.conf b/dockerfiles/services/nginx-php/ssmtp.conf
index aa6b53bf0a457815701db3a6db5e886195fe73de..be9bec3f92caa809925489c6c859dfd9b2115e6e 100644
--- a/dockerfiles/services/nginx-php/ssmtp.conf
+++ b/dockerfiles/services/nginx-php/ssmtp.conf
@@ -1,4 +1,12 @@
-mailhub=172.17.42.1
-root=postmaster
+mailhub=##MAIL_HOST##:##MAIL_PORT##
+root=##MAIL_USER##
 FromLineOverride=YES
 
+# Use SSL/TLS before starting negotiation
+UseTLS=Yes
+UseSTARTTLS=Yes
+
+# Username/Password
+AuthUser=##MAIL_USER##
+AuthPass=##MAIL_PASS##
+
diff --git a/dockerfiles/services/owncloud/startup-owncloud.sh b/dockerfiles/services/owncloud/startup-owncloud.sh
index 19baf2481aabbd3d44b7f035fc764d35b054009f..8ce3bbbfe863bda9eb9e3ecc2a89df14cad18e38 100644
--- a/dockerfiles/services/owncloud/startup-owncloud.sh
+++ b/dockerfiles/services/owncloud/startup-owncloud.sh
@@ -1,4 +1,11 @@
 #!/bin/bash -eux
+
+### configure email
+sed -i s/##MAIL_HOST##/${MAIL_HOST}/ /etc/ssmtp/ssmtp.conf
+sed -i s/##MAIL_PORT##/${MAIL_PORT}/ /etc/ssmtp/ssmtp.conf
+sed -i s/##MAIL_USER##/${MAIL_USER}/ /etc/ssmtp/ssmtp.conf
+sed -i s/##MAIL_PASS##/${MAIL_PASS}/ /etc/ssmtp/ssmtp.conf
+
 ###
 # Check Pre Install
 ###