Index: quilt/mail.in =================================================================== RCS file: /cvsroot/quilt/quilt/quilt/mail.in,v retrieving revision 1.20 diff -u -r1.20 mail.in --- quilt/mail.in 1 Feb 2006 12:50:31 -0000 1.20 +++ quilt/mail.in 3 Feb 2006 09:39:51 -0000 @@ -220,15 +220,26 @@ fi # Does the first paragraph look like a mail header? + # Valid mail header lines start with a keyword followed by + # a colon itself followed by a blank space (or tab). The + # keyword must be at least 4 characters long except for To, Cc + # and Bcc. This additional rule is required to differenciate + # subject lines starting with "Re:" or "Fwd:" from mail header + # lines. if [ address@hidden -eq 0 ] then if echo "$header" | awk ' - /^$/ { exit (!mh || not_mh) } - END { exit (!mh || not_mh) } - { if ($0 ~ /^[a-z]+:[ \t]/i) - mh = 1 - else - not_mh = 1 + /^$/ { exit } + END { exit (not_mh) } + /^[A-Za-z-]+:[ \t]/ { + if (length($1) >= 5 || + tolower($1) == "to:" || + tolower($1) == "cc:" || + tolower($1) == "bcc:") + next; + } + { not_mh = 1 + exit }' then return 1