# Ignore\_by\_title should be matched case-insensitive

**URL:** <https://meta.discourse.org/t/ignore-by-title-should-be-matched-case-insensitive/70623>\
**Category:** Bug\
**Created:** [2017年九月23日 04:35 UTC](https://meta.discourse.org/t/ignore-by-title-should-be-matched-case-insensitive/70623 "2017-09-23T04:35:52Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![schungx](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/schungx/32/70989_2.png) [@schungx](https://meta.discourse.org/u/schungx)\
**Post date:** [2017年九月23日 04:35 UTC](https://meta.discourse.org/t/ignore-by-title-should-be-matched-case-insensitive/70623/1 "2017-09-23T04:35:52Z")

</div>

The `ignore_by_title` feature is to filter off unwanted (SPAM? auto-mailers? auto-replies?) emails before they create topics that must then be removed by hand.

It takes regex expressions and will block the email if matched:

```plaintext
lib/email/receiver.rb:

def is_blacklisted?
           :
      Regexp.new(SiteSetting.ignore_by_title) =~ @mail.subject
end

```

I believe Ruby does a case-_sensitive_ match. It would be much more useful to do a case-_insensitive_ search here just to catch people sending in unwanted emails with different casing.

Otherwise, say, in order to block the word `happy`, I’d have to do at least the following:

`\bhappy\b|\bHappy\b|\bHAPPY\b`

---

<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:** [2017年九月23日 05:55 UTC](https://meta.discourse.org/t/ignore-by-title-should-be-matched-case-insensitive/70623/2 "2017-09-23T05:55:47Z")

</div>

Sure @zogstrip what do you think?

---

<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:** [2017年九月23日 13:07 UTC](https://meta.discourse.org/t/ignore-by-title-should-be-matched-case-insensitive/70623/4 "2017-09-23T13:07:54Z")

</div>

Sure, I’ll fix it next week unless someone beats me to it 😉

---

<div class="post-metadata">

**Author:** ![schungx](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/schungx/32/70989_2.png) [@schungx](https://meta.discourse.org/u/schungx)\
**Post date:** [2017年九月23日 13:50 UTC](https://meta.discourse.org/t/ignore-by-title-should-be-matched-case-insensitive/70623/5 "2017-09-23T13:50:22Z")

</div>

In fact, I suppose all emails and domain URL’s should always be compared case-insensitive? Case doesn’t seem to matter in those.

---

<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:** [2017年十一月11日 10:29 UTC](https://meta.discourse.org/t/ignore-by-title-should-be-matched-case-insensitive/70623/6 "2017-11-11T10:29:11Z")

</div>

Did this get fixed quite yet?

---

<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:** [2017年十一月12日 00:48 UTC](https://meta.discourse.org/t/ignore-by-title-should-be-matched-case-insensitive/70623/7 "2017-11-12T00:48:23Z")

</div>

> [@zogstrip](#):
>
> someone beats me to it

consider yourself beaten 🏆

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

---

<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:** [2017年十一月14日 00:48 UTC](https://meta.discourse.org/t/ignore-by-title-should-be-matched-case-insensitive/70623/8 "2017-11-14T00:48:36Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
