sensu-plugins / sensu-plugins-mailer

This plugin is an email handler for Sensu.
http://sensu-plugins.io
MIT License
17 stars 37 forks source link

Use SMTP authentication with mailer? #29

Closed pslobo closed 8 years ago

pslobo commented 8 years ago

HI,

I'd like to know if it's possible (and if not, request that feature) to implement SMTP authentication when sending email with mailer.

Currently, we use Google Apps and unfortunately, when using unauthenticated SMTP, we can only send to gmail and google apps users and not groups.

Ideally it'd be something along the lines of:

{
  "mailer": {
    "mail_from": "sensu@example.com",
    "mail_to": "group1@example.com",
    "smtp_address": "smtp.example.org",
    "smtp_password":"superstrongpassword",
    "smtp_port": "465",
    "smtp_domain": "example.org",
    "template": "/optional/path/to/template.erb",
    "subscriptions": {
      "subscription_name": {
        "mail_to": "group2@example.com"
      }
    }
  }
}
pslobo commented 8 years ago

Nevermind... Figured it out. I was assuming that it would use mail_to as username. I was obviously missing a definition. For those searching, this is possible using:

{
  "mailer": {
    "mail_from": "sensu@example.com",
    "mail_to": "group1@example.com",
    "smtp_address": "smtp.example.org",
    "smtp_username":"sensu@example.com",
    "smtp_password":"superstrongpassword",
    "smtp_port": "465",
    "smtp_domain": "example.org",
    "template": "/optional/path/to/template.erb",
    "subscriptions": {
      "subscription_name": {
        "mail_to": "group2@example.com"
      }
    }
  }
}