# Unable to post email address

**URL:** <https://meta.discourse.org/t/unable-to-post-email-address/42030>\
**Category:** Bug\
**Created:** [2016年四月4日 22:05 UTC](https://meta.discourse.org/t/unable-to-post-email-address/42030 "2016-04-04T22:05:00Z")\
**Posts on this page:** 5\
**Page:** 1

<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:** [2016年四月4日 22:05 UTC](https://meta.discourse.org/t/unable-to-post-email-address/42030/1 "2016-04-04T22:05:00Z")

</div>

It’s not possible to post an email address anymore. The following produces an Error 500:

- `[foo@example.com](http://foo@example.com)`
- `[email]bar@example.com[/email]`

This seems to be related to [PR 4138](https://github.com/discourse/discourse/pull/4138).

`parsed.path` seems to be `nil` for email addresses. Does it even make sense to parse URIs with a scheme other than `http` and `https`?

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2016年四月4日 22:08 UTC](https://meta.discourse.org/t/unable-to-post-email-address/42030/2 "2016-04-04T22:08:43Z")

</div>

Nahh not that, its a regression in extract links

```plaintext
NoMethodError (undefined method `slice!' for nil:NilClass)

/var/www/discourse/app/models/topic_link.rb:129:in `block (2 levels) in extract_from'
/var/www/discourse/app/models/topic_link.rb:116:in `each'
/var/www/discourse/app/models/topic_link.rb:116:in `block in extract_from'
/var/www/discourse/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract/database_statements.rb:211:in `transaction'
/var/www/discourse/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.6/lib/active_record/transactions.rb:220:in `transaction'
/var/www/discourse/app/models/topic_link.rb:106:in `extract_from'
/var/www/discourse/lib/post_creator.rb:385:in `extract_links'

```

_I think_ @eviltrout fixed some bugs there recently … not sure.

---

<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:** [2016年四月4日 22:11 UTC](https://meta.discourse.org/t/unable-to-post-email-address/42030/3 "2016-04-04T22:11:52Z")

</div>

Actually, I might have introduced that bug. Having a look.

---

<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:** [2016年四月4日 22:43 UTC](https://meta.discourse.org/t/unable-to-post-email-address/42030/4 "2016-04-04T22:43:38Z")

</div>

@gerhard was right after all 😉

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

---

<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:** [2016年四月4日 22:43 UTC](https://meta.discourse.org/t/unable-to-post-email-address/42030/5 "2016-04-04T22:43:41Z")

</div>


