# Watcher Email Action - Connection Refused!

**URL:** https://discuss.elastic.co/t/watcher-email-action-connection-refused/75546
**Category:** Elasticsearch
**Tags:** elastic-stack-alerting
**Created:** [February 17, 2017, 5:49pm UTC](https://discuss.elastic.co/t/watcher-email-action-connection-refused/75546 "2017-02-17T17:49:22Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![rlonberg](https://avatars.discourse-cdn.com/v4/letter/r/7ba0ec/32.png) [@rlonberg](https://discuss.elastic.co/u/rlonberg)
#### Post date: [February 17, 2017, 5:49pm UTC](https://discuss.elastic.co/t/watcher-email-action-connection-refused/75546/1 "2017-02-17T17:49:22Z")

</div>

I've been experimenting with elastic watcher over the past few days and have been pretty impressed with the alerting API so far. One thing I have had trouble with is configuring email action. We have a passwordless SMTP server "[testpool.companydev.com](http://testpool.companydev.com)" that I am having trouble configuring.

Receiving the following exception when I attempt to send an email:

> MailConnectException[Couldn't connect to host, port: [testpool.companydev.com](http://testpool.companydev.com), 587; timeout 120000]; nested: ConnectException[Connection refused]

I don't believe there is a firewall issue on our end, which is something I am looking into right now. But I do want to confirm that there are no red flags in our configuration..

elasticsearch.yml,

```
watcher.actions.email.service.account:
    work:
        email_defaults:
            from: alerts@testcompanydev.com
        smtp:
            auth: false
            starttls.enable: true
            host: testpool.companydev.com
            port: 587

```

watch settings,

```
{
  "trigger" : {
    "schedule" : { "interval" : "10m" } 
  },
  "input" : {
    "search" : {
      "request" : {
        "indices" : ["logstash-*"],
        "body" : {
          "query" : {
          	"bool" : {
          		"must" : {
            		"match" : { "message": "failure" }
            	},
            	"filter" : {
            		"range": {
            			"@timestamp" : {
            				"from": "now-1h",
            				"to": "now"
            			}
            		}
            	}
        	}
          }
        }
      }
    }
  },
  "actions" : {
  	"ses_account" : {
  		"email" : {
  			"from": "alerts@testcompanydev.com",
  			"to": "<destination_email>",
  			"subject": "Test Fail Alert",
  			"body": "This is a test alert."
  		}
  	}
  }
}

```

Thank you,  
Ravi

---

<div class="post-metadata">

### Author: ![rlonberg](https://avatars.discourse-cdn.com/v4/letter/r/7ba0ec/32.png) [@rlonberg](https://discuss.elastic.co/u/rlonberg)
#### Post date: [February 17, 2017, 10:14pm UTC](https://discuss.elastic.co/t/watcher-email-action-connection-refused/75546/2 "2017-02-17T22:14:01Z")

</div>

looks like it was a firewall issue on our side. Resolved! config is fine

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [March 17, 2017, 10:14pm UTC](https://discuss.elastic.co/t/watcher-email-action-connection-refused/75546/3 "2017-03-17T22:14:18Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
