Watcher failing to send emails

Hi,

I am using elastic cloud.
I have just created a script and I am getting this error;

MessagingException[failed to send email with subject [Daily MNO Snapshot] via account [work]]; nested: SendFailedException[Invalid Addresses]; nested: SMTPAddressFailedException[554 5.7.1 mtarimo@aimgroup.co.tz: Recipient address rejected: Access denied\n];

Below is my configuration;

PUT _watcher/watch/report_mno_mngt
{
"trigger": {
"schedule": {
"interval": "1d"
}
},
"actions": {
"work": {
"email": {
"to": "'micahel tarimo mtarimo@aimgroup.co.tz'",
"subject": "Daily MNO Snapshot",
"body": "Please find attached the snapshot for today",
"attachments": {
"mno_report_mngt.pdf": {
"http": {
"content_type": "application/pdf",
"request": {
"method": "POST",
"headers": {
"kbn-xsrf": "reporting"
},
"auth": {
"basic": {
"username": "theuser",
"password": "dfdfdfd"
}
},
"read_timeout": "300s",
"url": "https://3463d22a13e96ssa5524567e1c30c2b5cd.tz-west-7.aws.found.io/api/reporting/generate/dashboard/MNO-Dashboard?_g=(refreshInterval:(display:Off,pause:!f,value:0),time:(from:now-15m,mode:quick,to:now))&_a=(filters:!(),options:(darkTheme:!f),panels:!((col:1,id:mno_performance,panelIndex:4,row:1,size_x:6,size_y:4,type:visualization),(col:7,id:mno_gender,panelIndex:5,row:1,size_x:3,size_y:2,type:visualization),(col:10,id:mno_idtypes,panelIndex:6,row:1,size_x:3,size_y:2,type:visualization),(col:7,id:mno_quality_check,panelIndex:7,row:3,size_x:3,size_y:2,type:visualization),(col:10,id:mno_region_registrations_pie,panelIndex:8,row:3,size_x:3,size_y:2,type:visualization),(col:1,id:mno_region_registrations_line,panelIndex:9,row:5,size_x:12,size_y:3,type:visualization)),query:(query_string:(analyze_wildcard:!t,query:%27*%27)),title:%MNO%20Dashboard%27,uiState:(P-5:(vis:(legendOpen:!f)),P-7:(vis:(legendOpen:!f))))&sync"
}
}
}
}
}
}
}
}

I have followed the steps to whitelist the email addresses.

Is there anything I am doing wrong?

Thanks,
Michael

Hey,

this looks like an invalid email address. Can you try either only the email addr like mtarimo@aimgroup... or use proper marking of the name like Michael Tarimo <foo@bar.org>.. see the docs for examples

--Alex

Hi Alex,

Thanks for your response.

I have tried these options;

"email": {
"to": "'Micahel Tarimo mtarimo@aimgroup.co.tz'",
"subject": "Daily MNO Snapshot",

"email": {
"to": "Micahel Tarimo mtarimo@aimgroup.co.tz",
"subject": "Daily MNO Snapshot",

"email": {
"to": "'Micahel Tarimo mtarimo@aimgroup.co.tz'",
"subject": "Daily MNO Snapshot",

"email": {
"to": "'mtarimo@aimgroup.co.tz'",
"subject": "Daily MNO Snapshot",

"email": {
"to": "mtarimo@aimgroup.co.tz",
"subject": "Daily MNO Snapshot",

Unfortunately, they all fail!

Could you please help me fill in what needs to go into the "to" field?
The email is mtarimo@aimgroup.co.tz, the name is Michael Tarimo.
I have also whitelisted michael.tarimo@gmail.com

Thanks,
Michael

Hey,

some of them contain a wrong email address, where as others contain correct ones. Either check the watcher history indices or use the execute watch API and paste the output here. Both will contain all the information what went wrong - maybe your watch execution failed somewhere else.

--Alex

The execution only fails on the sending email part.
Below is the output.

{
"_id": "report_mno_mngt_0-2016-10-05T13:48:08.087Z",
"watch_record": {
"watch_id": "report_mno_mngt",
"state": "executed",
"trigger_event": {
"type": "manual",
"triggered_time": "2016-10-05T13:48:08.087Z",
"manual": {
"schedule": {
"scheduled_time": "2016-10-05T13:48:08.087Z"
}
}
},
"input": {
"none": {}
},
"condition": {
"always": {}
},
"messages": [],
"result": {
"execution_time": "2016-10-05T13:48:08.087Z",
"execution_duration": 52304,
"input": {
"type": "none",
"status": "success",
"payload": {}
},
"condition": {
"type": "always",
"status": "success",
"met": true
},
"actions": [
{
"id": "work",
"type": "email",
"status": "failure",
"reason": "MessagingException[failed to send email with subject [Daily MNO Snapshot] via account [work]]; nested: SendFailedException[Invalid Addresses]; nested: SMTPAddressFailedException[554 5.7.1 mtarimo@aimgroup.co.tz: Recipient address rejected: Access denied\n]; "
}
]
}
}
}

Hey,

this is not a watcher error, but a misconfiguration of your mailserver, which rejects that incoming email. Or you may be missing credentials in your watcher configuration to be allowed to send email. The important part is

554 5.7.1 mtarimo@aimgroup.co.tz: Recipient address rejected: Access denied

which is a direct reply from your mail server.

--Alex

Hi Alex,

I am using the elastic cloud service. I have no access to the watcher configurations.
I have followed the steps to allow watcher to send out emails, which is to "whitelist" the emails from the elastic cloud console. I received the watcher whitelist request, which i accepted.
From the receiving part, we are using google email service.

Thanks,
Michael

I have seen this post as well, but no luck for me.

https://discuss.elastic.co/t/watcher-send-email-aand-kibana-version/32445/4?u=mtarimo&source_topic_id=62141

Hi Alex,

This has been fixed. There was a problem which was preventing watcher from sending emails out.

Thanks.

https://discuss.elastic.co/t/watcher-send-email-aand-kibana-version/32445/7?u=mtarimo&source_topic_id=62141

Awesome, thanks so much for the update, Michael!

--Alex