How to configure Scalr to SES mail server?

139 views
Skip to first unread message

Akshay Sharma

unread,
May 21, 2015, 7:08:47 AM5/21/15
to scalr-...@googlegroups.com
I have installed Scalr 5.3.2 (Open Source Edition). How to configure Scalr to send mails or critical alerts?

Also, can I use the SES mailing service provided by AWS? If yes, where should I set the config?

Thanks

Thomas Orozco

unread,
May 21, 2015, 10:08:41 AM5/21/15
to scalr-...@googlegroups.com
Hi there,

Scalr can use any SMTP server to deliver mail through. SES should work.

You can get started here and look for email configuration (it's under app options): https://scalr-wiki.atlassian.net/wiki/x/RgAeAQ. First you'll have to set app[:email_mailserver].

There might be a bit of work to configure email in addition to just the mailserver (e.g. usernames, etc.). Internally, Scalr uses SSMTP, here are the docs for SSMTP's configuration file: http://linux.die.net/man/5/ssmtp.conf. You can include those settings in app[:email_configuration].

Cheers,

-- Thomas | Product Manager @ Scalr | tho...@scalr.com | www.scalr.com | blog.scalr.com

--
You received this message because you are subscribed to the Google Groups "scalr-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalr-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

William Fleming

unread,
Jan 21, 2016, 2:00:15 PM1/21/16
to scalr-discuss
Looking for a little more insight here.  In my scalr-server.rb file I have setup the following for SMTP Server Settings:

# Email Server Settings

app[:email_mailserver] = 'email-smtp.us-west-2.amazonaws.com:25'

app[:email_configuration] = 'root=no_r...@cloudscalr.com'

app[:email_configuration] = 'AuthUser=User'

app[:email_configuration] = 'AuthPass=Password'

app[:email_configuration] = 'UseSTARTTLS=YES'


I then run a reconfigure.  

When I look at the ssmtp.conf file, it is updated with the configuration settings however it does not add in the AuthUser or AuthPass.  Am I doing something wrong here?

-wf

Daniele Testa

unread,
Jan 21, 2016, 2:02:25 PM1/21/16
to scalr-...@googlegroups.com
The config should just be one big string:

app[:email_configuration] = 'root=no_r...@cloudscalr.com

AuthUser=User

AuthPass=Password

UseSTARTTLS=YES

'

Regards,

--
Regards,
Daniele Testa | Solutions Engineer @ Scalr | dan...@scalr.com | www.scalr.com | blog.scalr.com

William Fleming

unread,
Jan 21, 2016, 2:07:15 PM1/21/16
to scalr-discuss
You are a rockstar!!!  That fixed it.  Thank you for the guidance.

-wf

William Fleming

unread,
Jan 21, 2016, 2:16:51 PM1/21/16
to scalr-discuss
The configuration is all set and the ssmtp.conf is accurate.  When I register a user however, I am still not getting any emails and SES shows that no emails have been sent.  Do I need to install ssmtp on the server?  Also, what is the path for scalr logs on the server?

Thank you.

-wf

Daniele Testa

unread,
Jan 21, 2016, 2:20:08 PM1/21/16
to scalr-...@googlegroups.com
No need to install ssmtp, it is bundled with Scalr. You will find the logs under /opt/scalr-server/var/log

William Fleming

unread,
Jan 21, 2016, 4:49:17 PM1/21/16
to scalr-...@googlegroups.com
Still have a time with this.

I have configured the following:

# AWS SES SMTP Settings

app[:email_mailserver] = 'email-smtp.us-west-2.amazonaws.com:465'

app[:email_configuration] = 'root=no_r...@domain.com

AuthUser=User

AuthPass=Pass

UseTLS=YES

AuthMethod=LOGIN'


I have also tried:

# AWS SES SMTP Settings

app[:email_mailserver] = 'email-smtp.us-west-2.amazonaws.com:587'

app[:email_configuration] = 'root=no_r...@domain.com

AuthUser=User

AuthPass=Pass

UseSTARTTLS=YES'


I keep getting the following:

Creating SSL connection to host

SSL connection using ECDHE-RSA-AES128-GCM-SHA256

554 Message rejected: Email address is not verified.


I have added and verified my domain and two email accounts.  Any thoughts?


-wf


--
You received this message because you are subscribed to a topic in the Google Groups "scalr-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/scalr-discuss/D9Hg5ll0zBQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to scalr-discus...@googlegroups.com.

William Fleming

unread,
Jan 21, 2016, 7:02:34 PM1/21/16
to scalr-discuss
Okay...

So I setup up Sendgrid and got it working.  Interestingly it was actually being sent as:

“scalr-app@hostname”

I also found the config.yml file in app/etc/config.yml - in there I see the following:

  email:
    address: exampl...@scalr.net
    name: Scalr Service

This file is supposed to get overwritten by `/opt/scalr-server/bin/scalr-server-ctl reconfigure` command.  I am not sure however understanding how to overwrite the values through an automated method.  Additionally, the values set for email are not even being used for the outgoing emails.  Further digging, I found that SimpleMailer.php seems to be the one that is setting the "From" email address.  I could be wrong...  nonetheless, I am not seeing how I can dynamically set the "From" email or name that seems to be used.  I need this to happen in order to allow SES to see a "valid" domain or email.

Any help greatly appreciated.

-wf
To unsubscribe from this group and stop receiving emails from it, send an email to scalr-discuss+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Regards,
Daniele Testa | Solutions Engineer @ Scalr | dan...@scalr.com | www.scalr.com | blog.scalr.com

--
You received this message because you are subscribed to a topic in the Google Groups "scalr-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/scalr-discuss/D9Hg5ll0zBQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to scalr-discuss+unsubscribe@googlegroups.com.

Daniele Testa

unread,
Jan 22, 2016, 4:54:56 AM1/22/16
to scalr-...@googlegroups.com
You should use app[:configuration] = {} if you want to make any persistent chances to the yaml config file.

More info here:

To change the From field, you might need to take a look at ssmtp config how to do this.

Regards,


--
You received this message because you are subscribed to a topic in the Google Groups "scalr-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/scalr-discuss/D9Hg5ll0zBQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to scalr-discus...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "scalr-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalr-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jay Farschman

unread,
Jan 22, 2016, 10:28:37 AM1/22/16
to scalr-discuss
William,

I have to build a similar configuration and was planning on working with the email subsystem later this week.  I'll see if I can get started this afternoon since you are working it actively.

--
You received this message because you are subscribed to a topic in the Google Groups "scalr-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/scalr-discuss/D9Hg5ll0zBQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to scalr-discus...@googlegroups.com.

Jay Farschman

unread,
Jan 22, 2016, 2:12:47 PM1/22/16
to scalr-discuss
William,

I got email setup and working, but not with AWS SES.  We use Google Mail (yourgoogledomain.com) where I work so I set things up like this.  Seems like SES is pretty similar.  If you get that working I'd be curious how it work.

Anyway, I configured things as below.  To trouble shoot, try /opt/scalr-server/embedded/sbin/ssmtp you...@yourdomain.com and watch the log file.  Pretty quiet, but I think you can add debug levels.  This is my first time using ssmtp.conf

app[:configuration] = {
  :scalr => {
    :email => {
      :address => 'myuser@yourgoogledomain.com',
      :name    => 'Scalr Robot',
    }
  }
}

app[:email_mailserver] = 'smtp.gmail.com:587'

app[:email_configuration] = '

AuthPass=XXXXXXXXXXX
UseTLS=YES
UseSTARTTLS=yes

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

# The full hostname

# 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 received this message because you are subscribed to a topic in the Google Groups "scalr-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/scalr-discuss/D9Hg5ll0zBQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to scalr-discus...@googlegroups.com.

William Fleming

unread,
Jan 22, 2016, 2:34:59 PM1/22/16
to scalr-...@googlegroups.com
Jay you rock!  I just got it working both with SendGrid and AWS SES.  Woot!

Here are the configurations for both:

# AWS SES SMTP Settings
app[:email_mailserver] = 'email-smtp.us-west-2.amazonaws.com:587'  # Depends what region your in.  Verify with SES SMTP Settings.
app[:email_configuration] = 'root=no_r...@domain.tld
AuthUser=<IAMSMTP USER>
AuthPass=<IAMSMTP PASS>
UseSTARTTLS=YES
UseTLS=YES
RewriteDomain=domain.tld
Hostname=no_r...@domain.tld
FromLineOverride=YES'

# SendGrid SMTP Settings
#app[:email_mailserver] = 'smtp.sendgrid.net:587'
#app[:email_configuration] = 'root=no_r...@domain.tld
#AuthUser=<USERNAME>
#AuthPass=<PASSWORD>
#UseSTARTTLS=YES
#RewriteDomain=domain.tld
#Hostname=no_r...@domain.tld
#FromLineOverride=YES'

Hopefully this will help anyone that has been struggling to implement with AWS SES or SendGrid.  These settings need to be added to your 'scalr-server.rb' then you must reconfigure.  "/opt/scalr-server/bin/scalr-server-ctl reconfigure"

If you need to look at your SSMTP logs while testing, you can run "tail -F /opt/scalr-server/var/log/ssmtp/ssmtp.log"


To wrap up a couple more items... you may want to customize the "Name" that shows up on the FROM... this is a configuration setting in the config.yml file located in "/opt/scalr-server/embedded/scalr/app/etc".  This file is dynamically created and can be modified in the 'scalr-server.rb' file.  The following is the configuration I used to modify the email and name:

app[:configuration] = {
:scalr => {
:email => {
:address => 'no_r...@domain.tld',
:name => 'PREFERRED NAME',}
}


Hope this helps anyone that might be struggling for a good solid example.  Also thank you to those who help guide me in getting this to all work.  Cheers.

-wf
Reply all
Reply to author
Forward
0 new messages