Skip to content

Commit 9d7eb4f

Browse files
committed
air-email-review: fix occasionally missing CCs
We occasionally miss the CC field of the original email when sending the reply (most notably that usually means we don't CC the ML). Turns out Patchwork returns headers with "CC" or "Cc". Check for all sensible capitalization. Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent bc3b883 commit 9d7eb4f

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

air-email-review.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,12 +340,16 @@ def extract_recipients(patch_info_list: List[Dict]) -> Tuple[List[str], List[str
340340
headers = patch_info.get('headers', {})
341341
if isinstance(headers, dict):
342342
# Parse To header
343-
to_header = headers.get('To', '')
343+
to_header = headers.get('to', '') or \
344+
headers.get('To', '') or \
345+
headers.get('TO', '')
344346
for addr in parse_email_list(to_header):
345347
cc_set.add(addr)
346348

347-
# Parse Cc header
348-
cc_header = headers.get('Cc', '')
349+
# Parse Cc header (API may return 'Cc' or 'CC')
350+
cc_header = headers.get('cc', '') or \
351+
headers.get('Cc', '') or \
352+
headers.get('CC', '')
349353
for addr in parse_email_list(cc_header):
350354
cc_set.add(addr)
351355

0 commit comments

Comments
 (0)