From ca4c939e9a2d6c202ab84841d255f00570f02f45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Tue, 2 Aug 2016 00:04:59 +0200 Subject: [PATCH] incoming mail is considered autogenerated when the subject match a list of 'out of office' keywords --- lib/email/receiver.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/email/receiver.rb b/lib/email/receiver.rb index dc8fbd2ffae..9cad693184c 100644 --- a/lib/email/receiver.rb +++ b/lib/email/receiver.rb @@ -195,7 +195,8 @@ module Email def is_auto_generated? return false if SiteSetting.auto_generated_whitelist.split('|').include?(@from_email) @mail[:precedence].to_s[/list|junk|bulk|auto_reply/i] || - @mail[:from].to_s[/(mailer-?daemon|postmaster|noreply)@/i] || + @mail[:from].to_s[/(mailer[\-_]?daemon|post[\-_]?master|no[\-_]?reply)@/i] || + @mail[:subject].to_s[/^\s*(Auto:|Automatic reply|Autosvar|Automatisk svar|Automatisch antwoord|Abwesenheitsnotiz|Risposta Non al computer|Automatisch antwoord|Auto Response|Respuesta automática|Fuori sede|Out of Office|Frånvaro|Réponse automatique)/i] || @mail.header.to_s[/auto[\-_]?(response|submitted|replied|reply|generated|respond)|holidayreply|machinegenerated/i] end