[JB] Bonus: if the function extracted all addresses in the header, (instead of just the first one) that would help me improve another part of the program. (specifically, the new list heuristics)
[AL] Suggest using code from one of the freely available MTA's or other mail processing software since they would need to have got this functionality working right.
