bc70099d05e549ea2cd85689d7eaeac3d62bef3e lrnassar Fri Mar 27 15:05:41 2026 -0700 Fix mlqAutomate quote stripping for Apple Mail/Outlook Mac format. refs #37297 The From:/Date:/To: multi-line quote header used by Apple Mail and Outlook for Mac was not being detected, only From:/Sent:/To: (Windows Outlook). This caused quoted thread history to remain in the email body, triggering false-positive duplicate detection and skipping legitimate new replies. diff --git src/utils/qa/mlqAutomate.py src/utils/qa/mlqAutomate.py index 30d93b7f1bd..1141f648b45 100755 --- src/utils/qa/mlqAutomate.py +++ src/utils/qa/mlqAutomate.py @@ -900,40 +900,40 @@ # Reset cleaned — anything before the quote header was blank/trivial cleaned = [] continue else: # Top-posted reply: we already have real content above, stop here break if re.match(r'^-{4,}\s*Original Message\s*-{4,}', line_stripped, re.IGNORECASE): break # Gmail forwarded message format: "---------- Forwarded message ---------" if re.match(r'^-{4,}\s*Forwarded message\s*-{4,}', line_stripped, re.IGNORECASE): break # Outlook single-line forward format if re.match(r'^From:.*Sent:.*To:', line_stripped, re.IGNORECASE): break - # Outlook multi-line forward format: + # Outlook/Apple Mail multi-line forward format: # From: Name - # Sent: Date + # Sent:/Date: Date # To: Recipients if re.match(r'^From:\s*.+', line_stripped, re.IGNORECASE): - # Look ahead for Sent: and To: on subsequent lines + # Look ahead for Sent:/Date: and To: on subsequent lines if i + 2 < len(lines): next1 = unicode_control_pattern.sub('', lines[i + 1]) next2 = unicode_control_pattern.sub('', lines[i + 2]) - if re.match(r'^Sent:\s*.+', next1, re.IGNORECASE) and re.match(r'^To:\s*.+', next2, re.IGNORECASE): + if re.match(r'^(Sent|Date):\s*.+', next1, re.IGNORECASE) and re.match(r'^To:\s*.+', next2, re.IGNORECASE): break # Stop at Google Groups footer if 'You received this message because you are subscribed to the Google Groups' in line: break # Skip Google Groups unsubscribe line if 'To unsubscribe from this group and stop receiving emails from it' in line: i += 1 continue if line.strip() == '---' and len(cleaned) > 0: i += 1 continue # Handle quoted lines (starting with >) # Keep quoted lines for inline reply context - they provide important context # The "On ... wrote:" and other patterns above will stop at the full original message