-
Notifications
You must be signed in to change notification settings - Fork 7
SMTP Mail Troubleshooting
[ Troubleshooting Checks ] [ Required inputs ] [ Debugging the problem ] [ Typical errors ] [ How to apply a modification and test it ] [ Working with 587 SSL port ] [ Default Configuration (STARTTLS with 587 port) ] [ Allow sending emails without SMTP Auth ] [ Allow sending emails using port 25, without TLS/STARTTLS ]
Requested input from supported CSIRT:
-
docker ps
: shows if docker containers are running -
docker logs csp-vcb_admin
: logs for the service
The way to debug the problem, is to edit the line in "docker-compose.yml" that looks like this:
command: sh -c "sleep 10 && java -Xmx512m -Dspring.profiles.active=docker -jar server.jar"
to this:
command: sh -c "sleep 10 && java -Xmx512m -Dspring.profiles.active=docker -Dspring.mail.properties.mail.debug=true -Dlogging.level.com.intrasoft=DEBUG -jar server.jar"
Note - the docker-compose.yml file is separated by spaces and not tabs, and spaces are important in the beginning of lines (indentation). When editing make sure the spaces are preserved.
Error when SSL is required but STARTTLS is configured:
DEBUG SMTP: could not connect to host "mx2.cert.ro", port: 587, response: -1
First, find the module directory in /opt/csp/modules (it should start with vcb and be only one):
cd /opt/csp/modules/vcb*
Then, to edit the file (docker-compose.yml), you should use an editor like 'vi' or 'vim' or similar
After editing, the change is applied with the following steps:
docker-compose up -d vcb-admin
and logs are obtained as this:
docker-compose logs vcb-admin > /tmp/vcblogs.txt
command: sh -c "sleep 10 && java -Xmx512m -Dspring.profiles.active=docker -Dspring.mail.properties.mail.smtp.ssl.enable=true -Dspring.mail.properties.mail.smtp.starttls.enable=false -Dspring.mail.properties.mail.debug=true -Dlogging.level.com.intrasoft=DEBUG -jar server.jar"
This will:
- Enable SSL directly
- Disable STARTTLS (has to be off)
- Optionally, leaving the mail.debug=true allows to verify that negotiation is correct.
The default configuration we have tested (mailgun.com) uses the following options to work:
spring.mail.host=smtp.mailgun.org
spring.mail.port=587
spring.mail.username=<\*\*\*USERNAMEHERE\*\*\*>
spring.mail.password=<\*\*\*PASSWORDHERE\*\*\*>
spring.mail.smtp.auth=true
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true
spring.mail.properties.mail.smtp.socketFactory.fallback=false
spring.mail.properties.mail.smtp.socketFactory.port=587
spring.mail.smtps.quitwait=false
The above options work with MailGun (mailgun.com) with connection on 587 (note, both "mail.port" and "mail.smtp.socketFactory.port" are 587)
The options above work with STARTTLS (plain connection, then upgrade to TLS)
By default Java does not allow to send emails without authentication, which is followed by the VCB Admin module. To override this, perform the following steps:
- Navigate to
vcb_admin
module directory,/opt/csp/modules/vcb_______
. Please note that you have to enter the latest created directory matching the previous name - Edit
docker-compose.yml
undervcb-admin
service so that start command includes the following parameters:
-Dspring.mail.smtp.auth=false -Dspring.mail.properties.mail.smtp.auth=false -Dspring.mail.properties.mail.smtp.starttls.enable=false
An example is provided below - Execute:
docker-compose stop
docker-compose up -d
docker restart csp-apache
- Check and test
Example of modified vcb-admin
docker service:
vcb-admin:
image: csp-java8:1.0
container\_name: csp-vcb\_admin
domainname: ${LOCAL\_DOMAIN}
hostname: csp-vcb\_admin
env\_file:
- .env
command: sh -c "sleep 10 && java -Xmx512m -Dspring.profiles.active=docker -Dspring.mail.smtp.auth=false -Dspring.mail.properties.mail.smtp.auth=false -Dspring.mail.properties.mail.smtp.starttls.enable=false -jar server.jar"
working\_dir: /opt/csp
volumes:
- ./vcb-admin-exec.jar:/opt/csp/server.jar
- /opt/csp/logs/:/opt/csplogs
- SSLDatavolume:/opt/ssl/
- JitsiDataVolume:/opt/vcb/data
expose:
- 9300
The configuration for connection to port 25 (plain SMTP) is as follows:
- Navigate to
vcb_admin
module directory,/opt/csp/modules/vcb_______
. Please note that you have to enter the latest created directory matching the name "vcb", there may be more than one directories there (use `ls -lrt` to find it) - Edit
docker-compose.yml
undervcb-admin
service so that start command includes the following parameters:
-Dspring.mail.properties.mail.smtp.starttls.enable=false
An example is provided below - Execute:
docker-compose stop
docker-compose up -d
docker restart csp-apache
- Check and test
vcb-admin:
image: csp-java8:1.0
container\_name: csp-vcb\_admin
domainname: ${LOCAL\_DOMAIN}
hostname: csp-vcb\_admin
env\_file:
- .env
command: sh -c "sleep 10 && java -Xmx512m -Dspring.profiles.active=docker -Dspring.mail.properties.mail.smtp.starttls.enable=false -jar server.jar"
working\_dir: /opt/csp
volumes:
- ./vcb-admin-exec.jar:/opt/csp/server.jar
- /opt/csp/logs/:/opt/csplogs
- SSLDatavolume:/opt/ssl/
- JitsiDataVolume:/opt/vcb/data
expose:
- 9300