# Password reset email should send IP info

**URL:** https://meta.discourse.org/t/password-reset-email-should-send-ip-info/67492
**Category:** Feature
**Created:** [8월 4, 2017, 11:58오후 UTC](https://meta.discourse.org/t/password-reset-email-should-send-ip-info/67492 "2017-08-04T23:58:22Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [8월 21, 2017, 1:37오전 UTC](https://meta.discourse.org/t/password-reset-email-should-send-ip-info/67492/21 "2017-08-21T01:37:08Z")

</div>

Yes in admin, ip there is a button next to the ip. It is actually broken at the moment and @tgxworld was looking at it.

---

<div class="post-metadata">

### Author: ![elijah](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elijah/32/104055_2.png) [@elijah](https://meta.discourse.org/u/elijah)
#### Post date: [8월 21, 2017, 1:49오전 UTC](https://meta.discourse.org/t/password-reset-email-should-send-ip-info/67492/22 "2017-08-21T01:49:42Z")

</div>

Okay, I’ll figure out how to integrate that, too, then.

---

<div class="post-metadata">

### Author: ![elijah](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elijah/32/104055_2.png) [@elijah](https://meta.discourse.org/u/elijah)
#### Post date: [8월 21, 2017, 6:19오후 UTC](https://meta.discourse.org/t/password-reset-email-should-send-ip-info/67492/23 "2017-08-21T18:19:54Z")

</div>

> [@codinghorror](#):
>
> Only on admin click, so I view this as a complete non-issue, especially since locating the IP is quite critical to some admin actions.

And on password request emails if I implement that with the suggestions from yesterday.

Would it be better to not do so and leave that as a template action?

```markdown
The request came from %{remote_ip} ([lookup %{remote_ip}](https://geoipsite.example/ip=%{remote_ip})).

```

If nothing else, it would allow picking a lookup tool that’s localized.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [8월 21, 2017, 6:28오후 UTC](https://meta.discourse.org/t/password-reset-email-should-send-ip-info/67492/24 "2017-08-21T18:28:22Z")

</div>

I would just use whatever default service. Nobody complains when the default search is Google, for example. If someone wants to change it they can edit the text like anywhere else.

---

<div class="post-metadata">

### Author: ![elijah](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elijah/32/104055_2.png) [@elijah](https://meta.discourse.org/u/elijah)
#### Post date: [8월 21, 2017, 6:37오후 UTC](https://meta.discourse.org/t/password-reset-email-should-send-ip-info/67492/25 "2017-08-21T18:37:45Z")

</div>

I think my question was not clear enough.

1. Should I use the possibly a security concern API (per Sam in linked topic) that’s on the admin interface
2. Or should I just include a link to an online service that people can edit if they like, just like text anywhere else.

I’m leaning towards 2 myself now.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [8월 21, 2017, 6:38오후 UTC](https://meta.discourse.org/t/password-reset-email-should-send-ip-info/67492/26 "2017-08-21T18:38:28Z")

</div>

I am not following this at all, you are putting a link in an email, people can see where the link goes and click or not click. What is the problem here?

---

<div class="post-metadata">

### Author: ![elijah](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elijah/32/104055_2.png) [@elijah](https://meta.discourse.org/u/elijah)
#### Post date: [8월 21, 2017, 6:41오후 UTC](https://meta.discourse.org/t/password-reset-email-should-send-ip-info/67492/27 "2017-08-21T18:41:43Z")

</div>

Yesterday the request was to use the geo-ip library used elsewhere in Discourse already, which I read as “do the lookup before composing email message”:

> [@elijah](#):
>
> Is Discourse using a geo-ip library already? I didn’t want to add one just for this.

> [@codinghorror](#):
>
> Yes in admin, ip there is a button next to the ip. It is actually broken at the moment and @tgxworld was looking at it.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [8월 21, 2017, 6:44오후 UTC](https://meta.discourse.org/t/password-reset-email-should-send-ip-info/67492/28 "2017-08-21T18:44:48Z")

</div>

Oh I understand now, apologies. Let’s belay that order, server side geolocation of the IP would make things hairier and further cement this dependency plus a whole lot more “IP leakage” to some random IP lookup service. Your concern is 100% warranted.

A simple link in email is best versus server side geolocation.

---

<div class="post-metadata">

### Author: ![pain](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pain/32/89202_2.png) [@pain](https://meta.discourse.org/u/pain)
#### Post date: [8월 23, 2017, 5:49오전 UTC](https://meta.discourse.org/t/password-reset-email-should-send-ip-info/67492/29 "2017-08-23T05:49:20Z")

</div>

i see its on the discourse github, i tested it and it well didnt work, even though i had updated it

---

<div class="post-metadata">

### Author: ![elijah](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elijah/32/104055_2.png) [@elijah](https://meta.discourse.org/u/elijah)
#### Post date: [8월 23, 2017, 5:07오후 UTC](https://meta.discourse.org/t/password-reset-email-should-send-ip-info/67492/30 "2017-08-23T17:07:38Z")

</div>

My changes have not been folded in yet. I have some additional modifications to do and then to resubmit. Soon.

---

<div class="post-metadata">

### Author: ![elijah](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elijah/32/104055_2.png) [@elijah](https://meta.discourse.org/u/elijah)
#### Post date: [8월 25, 2017, 2:41오전 UTC](https://meta.discourse.org/t/password-reset-email-should-send-ip-info/67492/31 "2017-08-25T02:41:45Z")

</div>

New commit, _now with passing tests!_

And the suggested I18n plus a link to an IP lookup in the message.

```plaintext
Somebody asked to reset your password on [Discourse](https://example.com).

The request came from [142.100.20.200](https://ipinfo.io/142.100.20.200) using
"`Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0`".
If it was not you, you can safely ignore this email.

Click the following link to choose a new password:
https://example.com/u/password-reset/8d9b1570c28f1c8ac1c16d008923e337

```

---

<div class="post-metadata">

### Author: ![Sailsman63](https://avatars.discourse-cdn.com/v4/letter/s/b5ac83/32.png) [@Sailsman63](https://meta.discourse.org/u/Sailsman63)
#### Post date: [8월 25, 2017, 3:39오전 UTC](https://meta.discourse.org/t/password-reset-email-should-send-ip-info/67492/32 "2017-08-25T03:39:28Z")

</div>

Might want to make the following text more explicit, as shown:

> [@elijah](#):
>
> ```
> If this activity was you, please click the following link to choose a new password:
> https://example.com/u/password-reset/8d9b1570c28f1c8ac1c16d008923e337
> 
> ```

(I work Customer Service, and deal with non-technical people all the time.) Your original copy would cause many to wonder if they should click the link _Even If_ they had not tried to access the account. Yes, the original message is completely unambiguous. Yes, native English speakers will _still_ misunderstand it.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [8월 25, 2017, 3:46오전 UTC](https://meta.discourse.org/t/password-reset-email-should-send-ip-info/67492/33 "2017-08-25T03:46:55Z")

</div>

I can edit the copy later, thanks for the suggestion.

---

<div class="post-metadata">

### Author: ![pain](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pain/32/89202_2.png) [@pain](https://meta.discourse.org/u/pain)
#### Post date: [8월 31, 2017, 6:47오후 UTC](https://meta.discourse.org/t/password-reset-email-should-send-ip-info/67492/34 "2017-08-31T18:47:09Z")

</div>

> [@elijah](#):
>
> New commit, now with passing tests!
> 
> And the suggested I18n plus a link to an IP lookup in the message.
> 
> Somebody asked to reset your password on [Discourse](https://example.com).
> 
> The request came from [142.100.20.200](https://ipinfo.io/142.100.20.200) using  
> “`Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0`”.  
> If it was not you, you can safely ignore this email.
> 
> Click the following link to choose a new password:  
> [https://example.com/u/password-reset/8d9b1570c28f1c8ac1c16d008923e337](https://example.com/u/password-reset/8d9b1570c28f1c8ac1c16d008923e337)

you said it has passing tests, i’ve updated multiple times for the past few days and havent seen changes

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [8월 31, 2017, 6:49오후 UTC](https://meta.discourse.org/t/password-reset-email-should-send-ip-info/67492/35 "2017-08-31T18:49:12Z")

</div>

@pain, it hasn’t been merged yet. You can track it at [Password mail with IP addresses. by begrif · Pull Request #5069 · discourse/discourse · GitHub](https://github.com/discourse/discourse/pull/5069)

---

<div class="post-metadata">

### Author: ![pain](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pain/32/89202_2.png) [@pain](https://meta.discourse.org/u/pain)
#### Post date: [8월 31, 2017, 6:54오후 UTC](https://meta.discourse.org/t/password-reset-email-should-send-ip-info/67492/36 "2017-08-31T18:54:34Z")

</div>

ah i didnt check it on github, had just thought since he said it has passing tests it had just been added

---

<div class="post-metadata">

### Author: ![koski23](https://avatars.discourse-cdn.com/v4/letter/k/b782af/32.png) [@koski23](https://meta.discourse.org/u/koski23)
#### Post date: [2월 27, 2018, 2:36오전 UTC](https://meta.discourse.org/t/password-reset-email-should-send-ip-info/67492/37 "2018-02-27T02:36:12Z")

</div>

> [@elijah](#):
>
> The request came from `%{remote_ip} ([lookup %{remote_ip}](https://geoipsite.example/ip=%{remote_ip}))`.

can i just put this on my email templates directly?

How ever when i copied this code its popup an error as well.

Body: The following interpolation key(s) are invalid: “remote\_ip”

Im very novice on how to pull from the github. please guide me through

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [2월 27, 2018, 2:41오전 UTC](https://meta.discourse.org/t/password-reset-email-should-send-ip-info/67492/38 "2018-02-27T02:41:08Z")

</div>

If you examine [the pull request at issue](https://github.com/discourse/discourse/pull/5069), it was closed without being merged. Therefore the example template is not expected to work.

---

<div class="post-metadata">

### Author: ![pain](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pain/32/89202_2.png) [@pain](https://meta.discourse.org/u/pain)
#### Post date: [2월 27, 2018, 2:46오전 UTC](https://meta.discourse.org/t/password-reset-email-should-send-ip-info/67492/39 "2018-02-27T02:46:31Z")

</div>

so i guess it was just forgotten about and canceled?  
even forgot i requested this -.-

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [2월 27, 2018, 2:47오전 UTC](https://meta.discourse.org/t/password-reset-email-should-send-ip-info/67492/40 "2018-02-27T02:47:54Z")

</div>

Yes, it looks like the PR submitter either forgot about it or lost interest, so it was closed because leaving every incomplete PR open would quickly turn into a logistical nightmare.

[Previous page](https://meta.discourse.org/t/password-reset-email-should-send-ip-info/67492.md?page=1)

[Next page](https://meta.discourse.org/t/password-reset-email-should-send-ip-info/67492.md?page=3)
