From 2baa58e05623c887eadc67903f7407674f002173 Mon Sep 17 00:00:00 2001 From: marcos Date: Tue, 18 Dec 2018 13:48:28 -0300 Subject: [PATCH 1/2] Send alarms by email Addition of mysql container with pinpoint database to allow the registration of users, groups and alarms. Including lib, implementation of AlarmMessageSender and settings in the pinpoint-web container to allow sending alert emails. --- docker-compose.yml | 43 ++++++++++++++++ pinpoint-mysql/Dockerfile | 11 +++++ pinpoint-web/Dockerfile | 6 ++- pinpoint-web/build/mail.zip | Bin 0 -> 3959 bytes pinpoint-web/build/scripts/start-web.sh | 63 ++++++++++++++++++++++++ 5 files changed, 122 insertions(+), 1 deletion(-) create mode 100644 pinpoint-mysql/Dockerfile create mode 100644 pinpoint-web/build/mail.zip diff --git a/docker-compose.yml b/docker-compose.yml index c7dc35c..fd58229 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -35,6 +35,30 @@ services: - "16030:16030" restart: always + pinpoint-mysql: + build: + context: ./pinpoint-mysql/ + dockerfile: Dockerfile + args: + - PINPOINT_VERSION=${PINPOINT_VERSION} + + container_name: pinpoint-mysql + restart: always + image: pinpointdocker/pinpoint-mysql:${PINPOINT_VERSION} + hostname: pinpoint-mysql + ports: + - "13306:3306" + environment: + MYSQL_ROOT_PASSWORD: root123 + MYSQL_USER: admin + MYSQL_PASSWORD: admin + MYSQL_DATABASE: pinpoint + + volumes: + - mysql_data:/var/lib/mysql + networks: + - pinpoint + pinpoint-web: build: context: ./pinpoint-web/ @@ -47,6 +71,7 @@ services: depends_on: - pinpoint-hbase + - pinpoint-mysql restart: always expose: - "8080" @@ -66,6 +91,23 @@ services: - BATCH_ENABLE=${BATCH_ENABLE} - BATCH_SERVER_IP=${BATCH_SERVER_IP} - BATCH_FLINK_SERVER=${BATCH_FLINK_SERVER} + - JDBC_DRIVER=com.mysql.jdbc.Driver + - JDBC_URL=jdbc:mysql://pinpoint-mysql:3306/pinpoint?characterEncoding=UTF-8 + - JDBC_USERNAME=admin + - JDBC_PASSWORD=admin + - MAIL_HOST=stmp.test.com + - MAIL_PORT=123 + - MAIL_USERNAME=user + - MAIL_PASSWORD=pass +# - MAIL_PROPERTIES_MAIL_TRANSPORT_PROTOCOL=smtp + - MAIL_PROPERTIES_MAIL_SMTP_AUTH='true' + - MAIL_PROPERTIES_MAIL_SMTP_PORT=587 +# - MAIL_PROPERTIES_MAIL_SMTP_FROM=test@example.com + - MAIL_PROPERTIES_MAIL_STARTTLS_ENABLE='true' +# - MAIL_PROPERTIES_MAIL_STARTTLS_REQUIRED='true' +# - MAIL_PROPERTIES_MAIL_DEBUG='true' + links: + - "pinpoint-mysql:pinpoint-mysql" networks: - pinpoint @@ -215,6 +257,7 @@ services: volumes: data-volume: + mysql_data: networks: pinpoint: diff --git a/pinpoint-mysql/Dockerfile b/pinpoint-mysql/Dockerfile new file mode 100644 index 0000000..dba9d2b --- /dev/null +++ b/pinpoint-mysql/Dockerfile @@ -0,0 +1,11 @@ +FROM mysql:5.7 + +ENV PINPOINT_VERSION=1.8.0 + +RUN apt update \ + && apt-get install -y --no-install-recommends ca-certificates wget \ + && wget -O /docker-entrypoint-initdb.d/CreateTableStatement-mysql.sql "https://raw.githubusercontent.com/naver/pinpoint/$PINPOINT_VERSION/web/src/main/resources/sql/CreateTableStatement-mysql.sql" \ + && wget -O /docker-entrypoint-initdb.d/SpringBatchJobRepositorySchema-mysql.sql "https://raw.githubusercontent.com/naver/pinpoint/$PINPOINT_VERSION/web/src/main/resources/sql/SpringBatchJobRepositorySchema-mysql.sql" \ + && sed -i '/^--/d' /docker-entrypoint-initdb.d/CreateTableStatement-mysql.sql \ + && sed -i '/^--/d' /docker-entrypoint-initdb.d/SpringBatchJobRepositorySchema-mysql.sql \ + && apt-get purge -y --auto-remove ca-certificates wget diff --git a/pinpoint-web/Dockerfile b/pinpoint-web/Dockerfile index e51d805..e295197 100644 --- a/pinpoint-web/Dockerfile +++ b/pinpoint-web/Dockerfile @@ -6,12 +6,16 @@ ARG PINPOINT_VERSION=${PINPOINT_VERSION:-1.8.0} ARG INSTALL_URL=https://github.com/naver/pinpoint/releases/download/${PINPOINT_VERSION}/pinpoint-web-${PINPOINT_VERSION}.war COPY /build/scripts/start-web.sh /usr/local/bin/ +COPY /build/mail.zip /assets/mail.zip RUN chmod a+x /usr/local/bin/start-web.sh \ && curl -SL ${INSTALL_URL} -o pinpoint-web.war \ && rm -rf /usr/local/tomcat/webapps \ && mkdir -p /usr/local/tomcat/webapps \ && unzip pinpoint-web.war -d /usr/local/tomcat/webapps/ROOT \ - && rm -rf pinpoint-web.war + && rm -rf pinpoint-web.war \ + && curl -SL https://maven.java.net/content/repositories/releases/com/sun/mail/javax.mail/1.5.2/javax.mail-1.5.2.jar -o /usr/local/tomcat/webapps/ROOT/WEB-INF/lib/javax.mail-1.5.2.jar \ + && unzip /assets/mail.zip -d /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/ \ + && rm -rf /assets/mail.zip ENTRYPOINT ["/usr/local/bin/start-web.sh"] diff --git a/pinpoint-web/build/mail.zip b/pinpoint-web/build/mail.zip new file mode 100644 index 0000000000000000000000000000000000000000..851516bf54f1f3cb8ce967a2b9430270b6c24b3a GIT binary patch literal 3959 zcmbuCc{r47AIB$T9Z`&(>|`BAma=3&V~iz2*2Y-EU}hNE5@M8H)(FR%tq~?mcB6<8 zvWtjPc1g12g$~j z1jzsZ1}Xr66951p&}ftk65;LQ>7nWA;qB<_E$NPMK}q?#qcW4GJu|?J9ogM>GvBxq zeM-!wAKM6aSEKyaa=o*?-&nlD?LIIXQ2+3} z?RG=+iNyz7-*ts*NzY>&3s*PT$Mad+XId^;Y31M2v6Y>>ndQ&vt!T^0qBh_=FVB_E z8isvyeMUZhF_0@=o6qz@(p>>#HzD<>qqI`cUdi_KsPlGh(X%jNrIiFD9f*zIBfXCn zbV~0)3g?BOEQBaRn^Zz&T7P=#5Tug~D3m+PVot|&L2saYRD62vTA(JfiTtdq4WiK8 zyjWiEHpWwnKZ5*WS)K!_l#-#^CtZ?U$~3!MCMWqDY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EI03!o>T4j` zn9wLF>Qpqf1uxUYOWB86PT=KmjbrR>ES)??2_X}iyYN-+evYAg5W!nZBx#{;{$ijM z&e#Cb8|-N6R)lu5Y|6?Jpaacwh5NlYnUzPqRQXJ*SpB!U-`Ran@P4jQB~tKt$xSh4 zoE-58SfOrz<5Aw`dIG+zrt6P|6po@ zWds6UvY30_uB%{9S|4&yY}z`juuajiL$LX>DqGdL;$pywvu$Ydt z!j#!9E`$(~E=J}bHLBP8`3)*-l|bqUSd!#ylrBCT2^^&t=r7i;F_FFk`_g3(r7S|5 z4fo$Nf}J2!Bmd{R=Wst9Hr`-j$kFo`RnW1~-!tx!8~|Vp-dDFd+-pCG_h;(ADvp@< zM>|s7`a^LHsK3f~#K6be(!Xf`gxg=495L~+$=iQ6`9a9XBl$Z/g" /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/log4j.xml +WEB_INF_CLASSES_DIR=/usr/local/tomcat/webapps/ROOT/WEB-INF/classes +APPLICATION_CONTEXT_WEB_FILE=${WEB_INF_CLASSES_DIR}/applicationContext-web.xml +APPLICATION_CONTEXT_MAIL_FILE=${WEB_INF_CLASSES_DIR}/applicationContext-mail.xml + +echo -e " +jdbc.driverClassName=${JDBC_DRIVER:-com.mysql.jdbc.Driver} +jdbc.url=${JDBC_URL:-jdbc:mysql://localhost:13306/pinpoint?characterEncoding=UTF-8} +jdbc.username=${JDBC_USERNAME:-admin} +jdbc.password=${JDBC_PASSWORD:-admin} +" > ${WEB_INF_CLASSES_DIR}/jdbc.properties + +sed -i '/classpath:applicationContext-mail.xml/d' ${APPLICATION_CONTEXT_WEB_FILE} +if [ "$MAIL_HOST" != "" ]; then + sed -i 's/<\/beans>/ \ +<\/beans>/' ${APPLICATION_CONTEXT_WEB_FILE} + + sed -i "/name=\"host\"/c\ " ${APPLICATION_CONTEXT_MAIL_FILE} + sed -i "/name=\"port\"/c\ " ${APPLICATION_CONTEXT_MAIL_FILE} + sed -i "/name=\"username\"/c\ " ${APPLICATION_CONTEXT_MAIL_FILE} + sed -i "/name=\"password\"/c\ " ${APPLICATION_CONTEXT_MAIL_FILE} + + if [ "$MAIL_PROPERTIES_MAIL_TRANSPORT_PROTOCOL" != "" ]; then + sed -i "/prop key=\"mail.transport.protocol\"/c\ ${MAIL_PROPERTIES_MAIL_TRANSPORT_PROTOCOL}" ${APPLICATION_CONTEXT_MAIL_FILE} + else + sed -i "/prop key=\"mail.transport.protocol\"/c\ " ${APPLICATION_CONTEXT_MAIL_FILE} + fi + + if [ "$MAIL_PROPERTIES_MAIL_SMTP_PORT" != "" ]; then + sed -i "/prop key=\"mail.smtp.port\"/c\ ${MAIL_PROPERTIES_MAIL_SMTP_PORT}" ${APPLICATION_CONTEXT_MAIL_FILE} + else + sed -i "/prop key=\"mail.smtp.port\"/c\ " ${APPLICATION_CONTEXT_MAIL_FILE} + fi + + if [ "$MAIL_PROPERTIES_MAIL_SMTP_AUTH" != "" ]; then + sed -i "/prop key=\"mail.smtp.auth\"/c\ ${MAIL_PROPERTIES_MAIL_SMTP_AUTH}" ${APPLICATION_CONTEXT_MAIL_FILE} + else + sed -i "/prop key=\"mail.smtp.auth\"/c\ " ${APPLICATION_CONTEXT_MAIL_FILE} + fi + + if [ "$MAIL_PROPERTIES_MAIL_STARTTLS_ENABLE" != "" ]; then + sed -i "/prop key=\"mail.smtp.starttls.enable\"/c\ ${MAIL_PROPERTIES_MAIL_STARTTLS_ENABLE}" ${APPLICATION_CONTEXT_MAIL_FILE} + else + sed -i "/prop key=\"mail.smtp.starttls.enable\"/c\ " ${APPLICATION_CONTEXT_MAIL_FILE} + fi + + if [ "$MAIL_PROPERTIES_MAIL_STARTTLS_REQUIRED" != "" ]; then + sed -i "/prop key=\"mail.smtp.starttls.required\"/c\ ${MAIL_PROPERTIES_MAIL_STARTTLS_REQUIRED}" ${APPLICATION_CONTEXT_MAIL_FILE} + else + sed -i "/prop key=\"mail.smtp.starttls.required\"/c\ " ${APPLICATION_CONTEXT_MAIL_FILE} + fi + + if [ "$MAIL_PROPERTIES_MAIL_DEBUG" != "" ]; then + sed -i "/prop key=\"mail.debug\"/c\ ${MAIL_PROPERTIES_MAIL_DEBUG}" ${APPLICATION_CONTEXT_MAIL_FILE} + else + sed -i "/prop key=\"mail.debug\"/c\ " ${APPLICATION_CONTEXT_MAIL_FILE} + fi + + if [ "$MAIL_PROPERTIES_MAIL_SMTP_FROM" != "" ]; then + sed -i "/prop key=\"mail.smtp.from\"/c\ ${MAIL_PROPERTIES_MAIL_SMTP_FROM}" ${APPLICATION_CONTEXT_MAIL_FILE} + else + sed -i "/prop key=\"mail.smtp.from\"/c\ " ${APPLICATION_CONTEXT_MAIL_FILE} + fi +fi exec /usr/local/tomcat/bin/catalina.sh run From 372890e46cba7483ce8a84863789b10a533ce2d2 Mon Sep 17 00:00:00 2001 From: marcos Date: Wed, 19 Dec 2018 15:09:07 -0300 Subject: [PATCH 2/2] Put parameters in .env files Put all the parameters in .env files Update readme file --- .env | 22 ++++++++++++++++++- Readme.md | 11 +++++++++- docker-compose.yml | 38 ++++++++++++++++----------------- pinpoint-mysql/.env | 1 + pinpoint-mysql/Dockerfile | 2 +- pinpoint-web/.env | 19 +++++++++++++++++ pinpoint-web/docker-compose.yml | 15 +++++++++++++ 7 files changed, 86 insertions(+), 22 deletions(-) create mode 100644 pinpoint-mysql/.env diff --git a/.env b/.env index 8954fca..07d7d4f 100644 --- a/.env +++ b/.env @@ -6,6 +6,11 @@ PINPOINT_HBASE_NAME=pinpoint-hbase #config for hbase in external docker EXTERNAL_HBASE_PORT=2180 +### Pinpoint-mysql +MYSQL_ROOT_PASSWORD=root123 +MYSQL_USER=admin +MYSQL_PASSWORD=admin +MYSQL_DATABASE=pinpoint ### Pinpoint-Web @@ -32,6 +37,21 @@ BATCH_FLINK_SERVER=pinpoint-flink-jobmanager CONFIG_SHOW_APPLICATIONSTAT=true +JDBC_DRIVER=com.mysql.jdbc.Driver +JDBC_URL=jdbc:mysql://pinpoint-mysql:3306/pinpoint?characterEncoding=UTF-8 +JDBC_USERNAME=admin +JDBC_PASSWORD=admin +MAIL_HOST=stmp.test.com +MAIL_PORT=123 +MAIL_USERNAME=user +MAIL_PASSWORD=pass +MAIL_PROPERTIES_MAIL_TRANSPORT_PROTOCOL=smtp +MAIL_PROPERTIES_MAIL_SMTP_AUTH=true +MAIL_PROPERTIES_MAIL_SMTP_PORT=587 +MAIL_PROPERTIES_MAIL_SMTP_FROM=test@example.com +MAIL_PROPERTIES_MAIL_STARTTLS_ENABLE=true +MAIL_PROPERTIES_MAIL_STARTTLS_REQUIRED=true +MAIL_PROPERTIES_MAIL_DEBUG=false ### Pinpoint-Collector @@ -71,4 +91,4 @@ FLINK_WEB_PORT=8081 ### Pinpoint-quickstart -APP_PORT=8000 \ No newline at end of file +APP_PORT=8000 diff --git a/Readme.md b/Readme.md index bf0fcac..120b9ee 100644 --- a/Readme.md +++ b/Readme.md @@ -38,13 +38,22 @@ This will install and run all services required to run all features in Pinpoint - Pinpoint-Flink - Pinpoint-Zookeeper - Pinpoint-Hbase - - Pinpoint-QuickStart(a sample application) + - Pinpoint-QuickStart(a sample application) + - Pinpoint-Mysql This may take several minutes to download all necessary images. You can replace `QuickStart` application part with your application to start monitoring. - check [`Testing QuickStart application`](#testing-quickstart-application) for a quick demo of pinpoint - check [`Monitoring YOUR Application`](#monitoring-your-application) part for further details +### Mysql (optional) + +The Pinpoint-Mysql server is running on port 13306 and contains the data structure used to register users, groups, and alerts to be sent. + +To send email alerts, you must make BATCH_ENABLE=true and change the other mail-related environment variables (MAIL_HOST, MAIL_PORT, MAIL_USERNAME, MAIL_PASSWORD, MAIL_PROPERTIES_MAIL_SMTP_FROM, ...) to the Pinpoint-Web server in *.env* file. + +For more information see [Setting Alarm](http://naver.github.io/pinpoint/alarm.html) in Pinpoint documentation. + ### Flink configuration (optional) After all containers are started and ready to go. There is one more thing to do to use all existing features in Pinpoint. diff --git a/docker-compose.yml b/docker-compose.yml index fd58229..c194a3c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -49,10 +49,10 @@ services: ports: - "13306:3306" environment: - MYSQL_ROOT_PASSWORD: root123 - MYSQL_USER: admin - MYSQL_PASSWORD: admin - MYSQL_DATABASE: pinpoint + - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} + - MYSQL_USER=${MYSQL_USER} + - MYSQL_PASSWORD=${MYSQL_PASSWORD} + - MYSQL_DATABASE=${MYSQL_DATABASE} volumes: - mysql_data:/var/lib/mysql @@ -91,21 +91,21 @@ services: - BATCH_ENABLE=${BATCH_ENABLE} - BATCH_SERVER_IP=${BATCH_SERVER_IP} - BATCH_FLINK_SERVER=${BATCH_FLINK_SERVER} - - JDBC_DRIVER=com.mysql.jdbc.Driver - - JDBC_URL=jdbc:mysql://pinpoint-mysql:3306/pinpoint?characterEncoding=UTF-8 - - JDBC_USERNAME=admin - - JDBC_PASSWORD=admin - - MAIL_HOST=stmp.test.com - - MAIL_PORT=123 - - MAIL_USERNAME=user - - MAIL_PASSWORD=pass -# - MAIL_PROPERTIES_MAIL_TRANSPORT_PROTOCOL=smtp - - MAIL_PROPERTIES_MAIL_SMTP_AUTH='true' - - MAIL_PROPERTIES_MAIL_SMTP_PORT=587 -# - MAIL_PROPERTIES_MAIL_SMTP_FROM=test@example.com - - MAIL_PROPERTIES_MAIL_STARTTLS_ENABLE='true' -# - MAIL_PROPERTIES_MAIL_STARTTLS_REQUIRED='true' -# - MAIL_PROPERTIES_MAIL_DEBUG='true' + - JDBC_DRIVER=${JDBC_DRIVER} + - JDBC_URL=${JDBC_URL} + - JDBC_USERNAME=${JDBC_USERNAME} + - JDBC_PASSWORD=${JDBC_PASSWORD} + - MAIL_HOST=${MAIL_HOST} + - MAIL_PORT=${MAIL_PORT} + - MAIL_USERNAME=${MAIL_USERNAME} + - MAIL_PASSWORD=${MAIL_PASSWORD} + - MAIL_PROPERTIES_MAIL_TRANSPORT_PROTOCOL=${MAIL_PROPERTIES_MAIL_TRANSPORT_PROTOCOL} + - MAIL_PROPERTIES_MAIL_SMTP_AUTH=${MAIL_PROPERTIES_MAIL_SMTP_AUTH} + - MAIL_PROPERTIES_MAIL_SMTP_PORT=${MAIL_PROPERTIES_MAIL_SMTP_PORT} + - MAIL_PROPERTIES_MAIL_SMTP_FROM=${MAIL_PROPERTIES_MAIL_SMTP_FROM} + - MAIL_PROPERTIES_MAIL_STARTTLS_ENABLE=${MAIL_PROPERTIES_MAIL_STARTTLS_ENABLE} + - MAIL_PROPERTIES_MAIL_STARTTLS_REQUIRED=${MAIL_PROPERTIES_MAIL_STARTTLS_REQUIRED} + - MAIL_PROPERTIES_MAIL_DEBUG=${MAIL_PROPERTIES_MAIL_DEBUG} links: - "pinpoint-mysql:pinpoint-mysql" networks: diff --git a/pinpoint-mysql/.env b/pinpoint-mysql/.env new file mode 100644 index 0000000..f54d43d --- /dev/null +++ b/pinpoint-mysql/.env @@ -0,0 +1 @@ +PINPOINT_VERSION=1.8.0 \ No newline at end of file diff --git a/pinpoint-mysql/Dockerfile b/pinpoint-mysql/Dockerfile index dba9d2b..3d8f87f 100644 --- a/pinpoint-mysql/Dockerfile +++ b/pinpoint-mysql/Dockerfile @@ -1,6 +1,6 @@ FROM mysql:5.7 -ENV PINPOINT_VERSION=1.8.0 +ARG PINPOINT_VERSION=${PINPOINT_VERSION:-1.8.0} RUN apt update \ && apt-get install -y --no-install-recommends ca-certificates wget \ diff --git a/pinpoint-web/.env b/pinpoint-web/.env index 5f766ac..ff33195 100644 --- a/pinpoint-web/.env +++ b/pinpoint-web/.env @@ -26,3 +26,22 @@ BATCH_SERVER_IP=127.0.0.127 BATCH_FLINK_SERVER=pinpoint-flink-jobmanager CONFIG_SHOW_APPLICATIONSTAT=true + +#mysql information required +JDBC_DRIVER=com.mysql.jdbc.Driver +JDBC_URL=jdbc:mysql://pinpoint-mysql:3306/pinpoint?characterEncoding=UTF-8 +JDBC_USERNAME= +JDBC_PASSWORD= + +#mail server information required +MAIL_HOST= +MAIL_PORT= +MAIL_USERNAME= +MAIL_PASSWORD= +MAIL_PROPERTIES_MAIL_TRANSPORT_PROTOCOL= +MAIL_PROPERTIES_MAIL_SMTP_AUTH= +MAIL_PROPERTIES_MAIL_SMTP_PORT= +MAIL_PROPERTIES_MAIL_SMTP_FROM= +MAIL_PROPERTIES_MAIL_STARTTLS_ENABLE= +MAIL_PROPERTIES_MAIL_STARTTLS_REQUIRED= +MAIL_PROPERTIES_MAIL_DEBUG= \ No newline at end of file diff --git a/pinpoint-web/docker-compose.yml b/pinpoint-web/docker-compose.yml index 4db45e3..d23b185 100644 --- a/pinpoint-web/docker-compose.yml +++ b/pinpoint-web/docker-compose.yml @@ -30,4 +30,19 @@ services: - BATCH_ENABLE=${BATCH_ENABLE} - BATCH_SERVER_IP=${BATCH_SERVER_IP} - BATCH_FLINK_SERVER=${BATCH_FLINK_SERVER} + - JDBC_DRIVER=${JDBC_DRIVER} + - JDBC_URL=${JDBC_URL} + - JDBC_USERNAME=${JDBC_USERNAME} + - JDBC_PASSWORD=${JDBC_PASSWORD} + - MAIL_HOST=${MAIL_HOST} + - MAIL_PORT=${MAIL_PORT} + - MAIL_USERNAME=${MAIL_USERNAME} + - MAIL_PASSWORD=${MAIL_PASSWORD} + - MAIL_PROPERTIES_MAIL_TRANSPORT_PROTOCOL=${MAIL_PROPERTIES_MAIL_TRANSPORT_PROTOCOL} + - MAIL_PROPERTIES_MAIL_SMTP_AUTH=${MAIL_PROPERTIES_MAIL_SMTP_AUTH} + - MAIL_PROPERTIES_MAIL_SMTP_PORT=${MAIL_PROPERTIES_MAIL_SMTP_PORT} + - MAIL_PROPERTIES_MAIL_SMTP_FROM=${MAIL_PROPERTIES_MAIL_SMTP_FROM} + - MAIL_PROPERTIES_MAIL_STARTTLS_ENABLE=${MAIL_PROPERTIES_MAIL_STARTTLS_ENABLE} + - MAIL_PROPERTIES_MAIL_STARTTLS_REQUIRED=${MAIL_PROPERTIES_MAIL_STARTTLS_REQUIRED} + - MAIL_PROPERTIES_MAIL_DEBUG=${MAIL_PROPERTIES_MAIL_DEBUG}