I'm using the mailparse extensions, so it opens up the /var/mail/$user mail file then runs a regex search
the exact code in question is:
preg_match_all('/Phone:\s*(.*)/', $contents, $altphone);
preg_match_all('/Name:\s+(.+)/', $contents, $names);
I'd prefer not to pull it in line by line and to just let mailparse handle the input side of things.