Local SMTP Server Docker 1.8.0rc3 "Fail to send.."

Hello, our organization is testing out xibo. We’ve been using 1.7.9 installed manually (not docker). I want to switch to docker once 1.8 is released stable. I spun up a new vm and installed docker. I used docker-compose to to start up the xibo container and migrated a display over to the new cms. Everything works perfectly except for email alerts. I’ve setup the config.env as well as I know how. The SMTP server is local and does not use authentication. In the log, I get:

DEBUG / Marking notification as sent
ERROR / Unable to send email notification mail to 'email address’
DEBUG / Sending Notification email to 'email address’
DEBUG / Notification found: 15
DEBUG / Notification Queue sending from 'from address’
DEBUG / Running Task Email Notifications [3]

To be clear, I’ve removed actual email addresses and replaced with ‘email address’.

Looking for some advice on how to get more debug info or more relevant logs.

Thanks,

You configured your SMTP server settings in config.env I take it before running docker-compose up -d?

If so, how did you configure the SMTP settings in there please?

If not, you’ll need to take the containers down (docker-compose down), fix the config.env file, and then bring them back up.

Alex, thank you for your message.

You configured your SMTP server settings in config.env I take it before running docker-compose up -d?
Yes, I configured the config.env prior to starting the containers after I began to grasp how it all worked. I’ve torn down the containers a few times playing around with the settings.

## CMS Configuration

## Please make a copy of this file as config.env, and then
## edit it to suit your environment

## The CMS brings its own MySQL server to store your
## data. We need to create a user account for the CMS to
## connect to that database with. What password should
## that account use? Enter a random password here.
## We recommend using a 16 character random upper/lower case
## and digits.
## You could for example use the random.org password generator
## here: https://www.random.org/passwords/?num=1&len=16&format=plain&rnd=new
MYSQL_PASSWORD='database_password'

## SMTP Server Configuration
## The CMS needs to be able to send email to you
## Please enter credentials for a suitable SMTP server
## Defaults will work for GMail - replacing your GMail username
## and password as appropriate. You will also need to enable access
## for less secure applications on your GMail account for this to
## work. See https://support.google.com/accounts/answer/6010255

## SMTP Server Hostname
CMS_SMTP_SERVER='SMTP_server_host_name':25
CMS_SERVER='SMTP_server_host_name':25
## SMTP Username
CMS_SMTP_USERNAME=
## SMTP Password
CMS_SMTP_PASSWORD=
## Use a TLS Connection YES/NO
CMS_SMTP_USE_TLS=NO
## Use a STARTTLS Connection YES/NO
CMS_SMTP_USE_STARTTLS=NO
## Rewrite domain (the domain your email will appear to come from)
CMS_SMTP_REWRITE_DOMAIN='org_domain_name'
## Hostname that we should identify ourself to the remote server as
CMS_SMTP_HOSTNAME='org_domain_name'
## Can the From line be overridden in the outbound email
## NB GMail will rewrite the From address anyway so it's not important
## for GMail - YES/NO
CMS_SMTP_FROM_LINE_OVERRIDE=YES

## It is sometimes necessary to configure the webserver running inside
## the container to know the DNS name by which you will normally
## access the CMS. For most installations this is unnecessary and can
## be left as default, however, if you know this, it won't hurt to
## set it
CMS_SERVER_NAME='server_host_name'

I don’t think you want the single quotes around the names in there.

Note also that you’ll need your SMTP server name to resolve in DNS if you’re going to name it, rather than give its IP

So I think I’ve found a workaround. After starting the containers, going into /etc/ssmtp/ssmtp.conf (I guess this config file is generated by the startup scripts in xibo container) and commenting all of the lines relative to authentication fixed the issue. It seems like the lines relating to authentication are there no matter what I put in the config.env. The actual error that was occurring before this change is: “Server didn’t like our AUTH LOGIN (503 5.5.1 Error: authentication not enabled)”. Here is my ssmtp.conf:
# Config file for sSMTP sendmail
# Set root= blank to avoid relaying all the local emails for
# root out to the internet
root=

# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=<ServerHostName>:25

#AuthUser=
#AuthPass=
#UseTLS=NO
#UseSTARTTLS=NO

# Where will the mail seem to come from?
#rewriteDomain=gmail.com

# The full hostname
#hostname=none

# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
FromLineOverride=YES

You may have to do that every time you restart the container though.

The man page for ssmtp says setting the Auth lines to be empty should be sufficient, so I’m surprised that isn’t working.

Is it perhaps putting a space or something on that line?

You may have to do that every time you restart the container though.

  • Yeah, I’ll just have to make a note of that.
    The man page for ssmtp says setting the Auth lines to be empty should be sufficient, so I’m surprised that isn’t working.

  • I saw that, it’s why i hadnt really worried about those lines being in there.
    Is it perhaps putting a space or something on that line?

  • I went ahead and systematically gathered some details, which are listed below (Specific info like my real server address will be sanitized with *):
    Commenting out virtually everything in config.env except for CMS_SMTP_SERVER results in the following ssmtp.conf:

    Config file for sSMTP sendmail

    Set root= blank to avoid relaying all the local emails for

    root out to the internet

    root=

    The place where the mail goes. The actual machine name is required no

    MX records are consulted. Commonly mailhosts are named mail.domain.com

    mailhub=**********:25

    AuthUser=none
    AuthPass=none
    UseTLS=YES
    UseSTARTTLS=YES

    Where will the mail seem to come from?

    rewriteDomain=gmail.com

    The full hostname

    hostname=none

    Are users allowed to set their own From: address?

    YES - Allow the user to specify their own From: address

    NO - Use the system generated From: address

    FromLineOverride=YES
    This results in “Cannot open *********:25” from ssmtp. Setting config.env like so:

    SMTP Username

    CMS_SMTP_USERNAME=

    SMTP Password

    CMS_SMTP_PASSWORD=

    Use a TLS Connection YES/NO

    CMS_SMTP_USE_TLS=NO

    Use a STARTTLS Connection YES/NO

    CMS_SMTP_USE_STARTTLS=NO

This creates a ssmtp.conf like so:
# Config file for sSMTP sendmail
# Set root= blank to avoid relaying all the local emails for
# root out to the internet
root=

# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=*******:25

AuthUser=
AuthPass=
UseTLS=NO
UseSTARTTLS=NO

# Where will the mail seem to come from?
rewriteDomain=gmail.com

# The full hostname
hostname=none

# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
FromLineOverride=YES

Testing this results in “Server didn’t like our AUTH LOGIN (503 5.5.1 Error: authentication not enabled)”. There were not spaces after AuthUser or AuthPass so I’m not sure why its still trying auth.

The following discussion helped me figure out how to actually test ssmtp: http://askubuntu.com/questions/12917/how-to-send-mail-from-the-command-line

Thanks for your feedback. That’s really helpful.

I’ll see if I can make a change to get those lines commented out if no value is set or the value is empty.