When spamgourmet forwards messages it sets the Subject: header of the message to the Subject: of the original message, plus additional text. But it only recognizes the Subject: header in exactly that case. It should be matching headers case-independently, according to RFC 822. Here's an excerpt:
When matching any other syntactic unit, case is to be ignored.
For example, the field-names "From", "FROM", "from", and even
"FroM" are semantically equal and should all be treated ident-
ically.
compusa.com, for one, sends email with SUBJECT: headers. Spamgourmet ignores and leaves the header there, but puts it's own Subject: header in front of other headers.
Subject: is probably not the only header that spamgourmet isn't interpreting correctly when strangely-cased.
So, I think you ought to add "i" options to all those pattern matching operators.