# Unsubscribe from emails without login

**URL:** <https://meta.discourse.org/t/unsubscribe-from-emails-without-login/35389>\
**Category:** Feature\
**Tags:** email\
**Created:** [Novembre 9, 2015, 6:08 UTC](https://meta.discourse.org/t/unsubscribe-from-emails-without-login/35389 "2015-11-09T18:08:44Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![thomaspurchas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thomaspurchas/32/115664_2.png) [@thomaspurchas](https://meta.discourse.org/u/thomaspurchas)\
**Post date:** [Novembre 11, 2015, 12:45 UTC](https://meta.discourse.org/t/unsubscribe-from-emails-without-login/35389/17 "2015-11-11T00:45:49Z")

</div>

> [@codinghorror](#):
>
> The problem with your proposal is that we would need to maintain a database table with a unique unsubscribe key for every single email we ever send (do they ever expire?)

This could be solved by using the URL as a payload, and including a signature made up of part of the URL and a site secret.

i.e. `/c/features/unsubscribe/<user>/<sig>/` then the topic/category and user can be checked against the generated signature.

Where the signature can be `sha(concat(<name>,<category/topic>,<secret>))`

This removes the need to store any state server side, additionally an expiry and/or nonce could be encoded.

> [@codinghorror](#):
>
> And it still doesn’t solve the problem that anybody could unsubscribe you at will.

I agree this is true. But I would question how much of an issue what would be. As long as the emails aren’t made public (i.e. raw email view for email responses) then it’s unlikely that anyone would ever be able to get hold of the URL signature.

I don’t think forwarding emails to other people is a very common thing, especially on public forums where you can just send a link to the thread.

I’m hoping that others in the community could help us gauge how much of an issue this might be.

I could be that when you unsubscribe using the email link, you get sent a message saying that you have unsubscribed. But I feel like this is adding a lot of complexity for little benefit.

> [@codinghorror](#):
>
> Ok then we should definitely fix that, might be hard to have arbitrary params survive a SSO login through an external login provider, though.

If I’m not mistake, the SSO nonce is stored in the DB with an expiry. Could that be used to keep these params stored in Discourse? then it can redirect as appropriate when the user is returned (using the nonce as a session token or similar).

---

_[View the full topic](https://meta.discourse.org/t/unsubscribe-from-emails-without-login/35389)._
