Ignore_by_title should be matched case-insensitive

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:

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

4 Curtiram

Sure @zogstrip what do you think?

1 Curtiu

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

2 Curtiram

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

1 Curtiu

Did this get fixed quite yet?

consider yourself beaten :trophy:

https://github.com/discourse/discourse/commit/4dc4bc70c805548458ee4c50749dda7b7bd40523

6 Curtiram

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