When sending a message, I might have something like this to set the To: field (in Perl)
To: "$name" <$email>
In Perl, I can check the $ email part with Email :: Valid, but how can I make sure the $ name part accepts Unicode characters, but cannot be tricked by sending to multiple addresses or some other nasty thing? for example This
$email = ' bar@me.com '; $name = 'Foo" < foo@other.com >, "Bar';
seems to create a To field like this:
To: "Foo" < foo@other.com >, "Bar" < bar@me.com >
sending email to two addresses.
source share