Ignore_by_title should be matched case-insensitive


(Stephen Chung) #1

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


(Jeff Atwood) #2

Sure @zogstrip what do you think?


(Régis Hanol) #4

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


(Stephen Chung) #5

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


(Jeff Atwood) #6

Did this get fixed quite yet?


(Gerhard Schlager) #7

consider yourself beaten :trophy:


(Gerhard Schlager) #8

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