Both the Pattern filter and the Content Filter allow you to use Regular Expression to match variable text. 

The Pattern Filter basically allows you to create custom spam rules.  You can enter Regular Expression patterns and mail containing text that matches the pattern has its spam score modified (+100 for blacklisted patterns and -100 for whitelisted patterns).  You can add patter filters in Filter Rules > Pattern Filtering.  For the specific case you have mentioned the following pattern should work:


If added as follows it will block mail containing a From or Return-Path header ending with e.g. From:

The Content Filter was added it v6.01.  It allows you to delete, redirect, whitelist, quarantine or bounce mail that matches the rule.  You can add content filter rules in Content Filtering > Content Filtering.  It is easier to use than the pattern filter as it allows you to test to see if the Regular Expression matches a specific piece of text.

The green test filter indicated that the text in the filter matched the Regular Expression.

Note, you should be very careful when adding new patterns.  A typo or incorrect pattern can lead to legitimate mail being blocked.  If you are unfamiliar with Regular Expression there is a good tutorial here: