# Logstash output to multiple e-mail addresses

**URL:** <https://discuss.elastic.co/t/logstash-output-to-multiple-e-mail-addresses/100559>\
**Category:** Logstash\
**Created:** [September 14, 2017, 2:31pm UTC](https://discuss.elastic.co/t/logstash-output-to-multiple-e-mail-addresses/100559 "2017-09-14T14:31:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![eds](https://avatars.discourse-cdn.com/v4/letter/e/bc79bd/32.png) [@eds](https://discuss.elastic.co/u/eds)\
**Post date:** [September 14, 2017, 2:31pm UTC](https://discuss.elastic.co/t/logstash-output-to-multiple-e-mail-addresses/100559/1 "2017-09-14T14:31:44Z")

</div>

Hi Magnus.

My ELK version 5.5.2  
For some events i use email output plugin, and send events to local exchange, works fine.  
But then i add new email output block with different email and server i get error:

```
[root@logstash ~]# tail -f /var/log/logstash/logstash-plain.log
[2017-09-14T14:18:40,468][ERROR][logstash.outputs.email] Something happen while delivering an email {:exception=>#<Net::SMTPFatalError: 550 5.7.1 Unable to relay
>}

```

Logstash output conf:

```
#this block ok
if [event_id] == 18502 {
  email {
    to => "admin@exchange.local"
    address => "192.168.1.5"
    from => "logstash@exchange.local"
    subject => "sudj"
    htmlbody => "body"
  }
}

#this blok not work
if [event_id] == 18502 {
  email {
    to => "admin@my_mail.com"
    address => "smtp.my_mail.com"
    port => 25
    username => "logstash@my_mail.com"
    password => "pass"
    from => "logstash@my_mail.com"
    subject => "subj"
    htmlbody => "body"
   }
 }

```

Wireshark show local exchange ip (192.168.1.5) for second block (not smtp.my\_mail.com) :

```
44	7.859411600	192.168.1.9	192.168.1.5	TCP	74	39624>25 [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=322351535 TSecr=0 WS=128 45	7.860537500	192.168.1.9	192.168.1.5	TCP	66	39624>25 [ACK] Seq=1 Ack=1 Win=29312 Len=0 TSval=322351536 TSecr=32265825
46	7.862588900	192.168.1.9	192.168.1.5	TCP	66	39624>25 [ACK] Seq=1 Ack=90 Win=29312 Len=0 TSval=322351538 TSecr=32265826
47	7.864838100	192.168.1.9	192.168.1.5	SMTP	82	C: EHLO localhost
48	7.866743100	192.168.1.39	192.168.1.5	SMTP	98	C: MAIL FROM:<logstash@my_mail.com>
49	7.869035000	192.168.1.9	192.168.1.5	SMTP	91	C: RCPT TO:<admin@my_mail.com>
50	12.880061400	192.168.1.9	192.168.1.5	SMTP	72	C: QUIT

```

Telnet to smtp.my\_mail.com 25 work fine

What's wrong with my conf?

---

<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:** [September 14, 2017, 4:06pm UTC](https://discuss.elastic.co/t/logstash-output-to-multiple-e-mail-addresses/100559/2 "2017-09-14T16:06:17Z")

</div>

The SMTP server used doesn't allow relaying, i.e. accepting a message from you and sending it to a recipient on another server.

---

<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:** [October 12, 2017, 4:06pm UTC](https://discuss.elastic.co/t/logstash-output-to-multiple-e-mail-addresses/100559/3 "2017-10-12T16:06:31Z")

</div>

Closed on October 12, 2017, 4:06pm UTC

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