sensu-plugins/sensu-plugins-mailer

Is it possible to send email to >1 recipients?

AGovorukha opened this issue · 5 comments

Hello,

Could you help me to configure mailer for sending notification to list of recipients.
Is it possible?

Since you closed this I assume you figured it out, I sure as hell can't since it isn't accepting any known form of multiple recipients I've ever used in SMTP

looking at the plugin the mail_to field needs to be an array and by default it treats it as a string.
If using the settings you should be able to give it an array.
If any of the subscriptions also contain a mail_to object it will append it as a string.

https://github.com/sensu-plugins/sensu-plugins-mailer/blob/master/bin/handler-mailer.rb#L112

I have been using an array, unfortunately it seems the plugin isn't using multiple RCPT TO calls as RCPT TO can only accept one email address at a time and won't accept lists (based on the error I am receiving which is 550 #5.1.0)

I'm not wrapping my head around the mail_to array, I don't understand how an array and not a list would make sense

Ok, seems it was being extremely sensitive with indentation & layout.

This does not work:

mail_to: ["mail1", "mail2"]

this does work:

mail_to: [
    "mail1",
    "mail2"
],

imho this should be in the documentation