# O Discourse está enviando e-mails mesmo com o envio de e-mails desativado

**URL:** <https://meta.discourse.org/t/discourse-is-sending-emails-even-though-emailing-is-disabled/112231>\
**Category:** Bug\
**Created:** [Março 21, 2019, 8:58am UTC](https://meta.discourse.org/t/discourse-is-sending-emails-even-though-emailing-is-disabled/112231 "2019-03-21T08:58:36Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [Março 21, 2019, 8:29pm UTC](https://meta.discourse.org/t/discourse-is-sending-emails-even-though-emailing-is-disabled/112231/4 "2019-03-21T20:29:24Z")

</div>

I don’t pretend to understand how things work at this level (maybe there are tests elsewhere that I don’t know about), but I don’t see how this code would skip sending if `disable_emails` was `staff_only`. Also, if I remember correctly, the old value used to be `true/false`, so it looks like if it had been set to `true` it would fail matching the `yes` in the test below (or maybe that would have been fixed in a migration somehow or Rails magically thinks that `true` and `yes` are the same?).

> <https://github.com/discourse/discourse/blob/main/lib/email/sender.rb#L24-L30>

---

_[View the full topic](https://meta.discourse.org/t/discourse-is-sending-emails-even-though-emailing-is-disabled/112231)._
