# Email Authentication error

**URL:** <https://discuss.elastic.co/t/email-authentication-error/74420>\
**Category:** Logstash\
**Created:** [February 8, 2017, 6:10pm UTC](https://discuss.elastic.co/t/email-authentication-error/74420 "2017-02-08T18:10:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![amitkashyap](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@amitkashyap](https://discuss.elastic.co/u/amitkashyap)\
**Post date:** [February 8, 2017, 6:10pm UTC](https://discuss.elastic.co/t/email-authentication-error/74420/1 "2017-02-08T18:10:40Z")

</div>

I am getting authentication error while sending mail throug logstash.  
below is my Email configuration I set

```
	email {
	  debug => true
	  authentication => "login"
	  address => " **my mail server IP**"
	  port => 25
	  username => " **service account name**"
	  password => " **service account password**"
	  body => "text mail to check notification"
	  from => " **my mail id**"
	  subject => "Test mail to check notification"
	  to => " **my mail id**"
	}

```

I am getting below error

[2017-02-08T09:39:02,129][ERROR][logstash.outputs.email] Something happen while delivering an email {:exception=\>#\<Net::SMTPSyntaxError: 504 5.7.4 Unrecognized authentication type

> }

am I missing any mail parameter which is causing this error or I have to set different value for authentication?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [February 9, 2017, 6:56am UTC](https://discuss.elastic.co/t/email-authentication-error/74420/2 "2017-02-09T06:56:16Z")

</div>

Try setting `authentication` to "plain". If that doesn't help, please telnet to port 25 of your email server, type `EHLO yourhostname` (insert your hostname) and report the response. It should look similar to this but hopefully with an AUTH line:

```nohighlight
250-PIPELINING
250-SIZE 25067520
250-VRFY
250-ETRN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN

```

---

<div class="post-metadata">

**Author:** ![amitkashyap](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@amitkashyap](https://discuss.elastic.co/u/amitkashyap)\
**Post date:** [February 10, 2017, 6:06pm UTC](https://discuss.elastic.co/t/email-authentication-error/74420/3 "2017-02-10T18:06:50Z")

</div>

> [@magnusbaeck](#):
>
> yourhostname

Thank you Magnus. but setting authentication to "plain" did not work. here is the response after running EHLO hostname:

EHLO **host name**  
250- **host name** Hello [**IP**]  
250-SIZE 36700160  
250-PIPELINING  
250-DSN  
250-ENHANCEDSTATUSCODES  
250-STARTTLS  
250-8BITMIME  
250-BINARYMIME  
250 CHUNKING

I have removed server specific detals for privacy..

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [February 13, 2017, 6:56am UTC](https://discuss.elastic.co/t/email-authentication-error/74420/4 "2017-02-13T06:56:29Z")

</div>

That server doesn't offer SMTP authentication. Switch to one that does or disable authentication on the Logstash side.

---

<div class="post-metadata">

**Author:** ![amitkashyap](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@amitkashyap](https://discuss.elastic.co/u/amitkashyap)\
**Post date:** [February 15, 2017, 2:22am UTC](https://discuss.elastic.co/t/email-authentication-error/74420/5 "2017-02-15T02:22:45Z")

</div>

Thank you. in our email server, authentication was not enabled and after removing the authentication entry, I was able to generate the mail.

---

<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 15, 2017, 2:22am UTC](https://discuss.elastic.co/t/email-authentication-error/74420/6 "2017-03-15T02:22:51Z")

</div>

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