]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 662883: email_in.pl should ignore "out of the office" auto-reply emails
authorFrédéric Buclin <LpSolit@gmail.com>
Mon, 18 Jul 2011 00:24:08 +0000 (02:24 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Mon, 18 Jul 2011 00:24:08 +0000 (02:24 +0200)
r/a=mkanat

email_in.pl

index 393061cd556a1bca1faf02712916a06c9e6d5df6..55e7b119af19c9573edcd88988f7c4091fdf4fed 100755 (executable)
@@ -86,6 +86,14 @@ sub parse_mail {
         $summary = trim($2);
     }
 
+    # Ignore automatic replies.
+    # XXX - Improve the way to detect such subjects in different languages.
+    my $auto_submitted = $input_email->header('Auto-Submitted') || '';
+    if ($summary =~ /out of( the)? office/i || $auto_submitted eq 'auto-replied') {
+        debug_print("Automatic reply detected: $summary");
+        exit;
+    }
+
     my ($body, $attachments) = get_body_and_attachments($input_email);
     if (@$attachments) {
         $fields{'attachments'} = $attachments;