# 发布无效电子邮件地址时出错

**URL:** https://meta.discourse.org/t/error-when-posting-invalid-email-address/85631
**Category:** Bug
**Created:** [2018年四月18日 15:10 UTC](https://meta.discourse.org/t/error-when-posting-invalid-email-address/85631 "2018-04-18T15:10:20Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ixeft](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ixeft/32/115485_2.png) [@ixeft](https://meta.discourse.org/u/ixeft)
#### Post date: [2018年四月18日 15:10 UTC](https://meta.discourse.org/t/error-when-posting-invalid-email-address/85631/1 "2018-04-18T15:10:20Z")

</div>

When creating a subject containing a quote block with an email address, user get an «internal server error»,

 ![image](https://global.discourse-cdn.com/meta/original/3X/3/b/3ba602ea673bda5b3b5d0e1ca40a3fa36608d5df.jpg)

The problem appeared since upgrade to last version of discourse.

---

<div class="post-metadata">

### Author: ![ixeft](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ixeft/32/115485_2.png) [@ixeft](https://meta.discourse.org/u/ixeft)
#### Post date: [2018年四月18日 15:34 UTC](https://meta.discourse.org/t/error-when-posting-invalid-email-address/85631/2 "2018-04-18T15:34:30Z")

</div>

i can reproduce trying to create a discussion«citing» this message on our instance :

NB : it also fail on [meta.discourse.org](http://meta.discourse.org)…

```
> 
> This message was created automatically by mail delivery software.
> 
> A message that you sent could not be delivered to one or more of its
> recipients. This is a permanent error. The following address(es) failed:
> 
> some-email@gmail.com
> host smtp.someprovider.com [00.225.33.366]
> SMTP error from remote mail server after end of data:
> 550 5.7.1 Unconfigured Sending Domain <somedomain.com>
> 
> Action: failed
> Final-Recipient: rfc822;name@domain.com
> Status: 5.0.0
> Remote-MTA: dns; smtp.someprovider.com
> Diagnostic-Code: smtp; 550 5.7.1 Unconfigured Sending Domain <somedomain.com>

```

Log :

```
URI::InvalidComponentError (unrecognised opaque part for mailtoURL: rfc822;name@domain.com)
/usr/local/lib/ruby/2.4.0/uri/mailto.rb:150:in `initialize'

```

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [2018年四月18日 20:58 UTC](https://meta.discourse.org/t/error-when-posting-invalid-email-address/85631/3 "2018-04-18T20:58:49Z")

</div>

It doesn’t have to be inside a quote block. Trying to post an invalid email address like `rfc822;name@domain.com` is enough to trigger the error.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [2018年四月19日 10:30 UTC](https://meta.discourse.org/t/error-when-posting-invalid-email-address/85631/5 "2018-04-19T10:30:08Z")

</div>

Thanks @ixeft for reporting this issue. It’s now fixed 🍕

[https://github.com/discourse/discourse/commit/45850a0cd63b29ea29941665f656459750c86367](https://github.com/discourse/discourse/commit/45850a0cd63b29ea29941665f656459750c86367)

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [2018年四月19日 10:30 UTC](https://meta.discourse.org/t/error-when-posting-invalid-email-address/85631/6 "2018-04-19T10:30:13Z")

</div>


