Skip to content
This repository has been archived by the owner on Feb 2, 2022. It is now read-only.

SMTP Mail Troubleshooting

Thanos edited this page Nov 18, 2019 · 1 revision

Mail / SMTP Configuration for CSP Videobridge Admin

[ 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 ]

Troubleshooting Checks

Required inputs

Requested input from supported CSIRT:

  1. docker ps : shows if docker containers are running
  2. docker logs csp-vcb_admin : logs for the service

Debugging the problem

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.

Typical errors

Error when SSL is required but STARTTLS is configured:

DEBUG SMTP: could not connect to host "mx2.cert.ro", port: 587, response: -1

How to apply a modification and test it

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

Working with 587 SSL port

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:

  1. Enable SSL directly
  2. Disable STARTTLS (has to be off)
  3. Optionally, leaving the mail.debug=true allows to verify that negotiation is correct.

Default Configuration (STARTTLS with 587 port)

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)

Allow sending emails without SMTP Auth

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:

  1. 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
  2. Edit docker-compose.yml under vcb-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
  3. Execute:
    docker-compose stop
    docker-compose up -d
    docker restart csp-apache
  4. 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

Allow sending emails using port 25, without TLS/STARTTLS

The configuration for connection to port 25 (plain SMTP) is as follows:

  1. 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)
  2. Edit docker-compose.yml under vcb-admin service so that start command includes the following parameters:
    -Dspring.mail.properties.mail.smtp.starttls.enable=false
    An example is provided below
  3. Execute:
    docker-compose stop
    docker-compose up -d
    docker restart csp-apache
  4. 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