I was trying to come up with a pattern that would do that but it is surprisingly difficult as there is a lot of variation in the text after From: and To:
abc@xyz.comabc-def@xyz.comabc-def+tag@ghi.xyz.comFred Bloggs
fred@somedomain.com<abc@xyz.com>
Jane Doe <jane@doe.com>
If one wants to be sure of getting just the actual address and not any of the extra junk it's quite hard using the current capabilities in Hazel (unless I am missing a trick or two, which is quite possible). I have a custom shell script that uses things like sed, awk etc. and which does a pretty reasonable job but it would be nice to move this processing into Hazel rules at some point.
Of course none of this deals with the fact that nowadays you can have almost any national character in an e-mail address, especially if quoted, so if one wants to handle any possible address it is a big challenge. Luckily, my requirements are not quite that stringent.