Subject: | transliteration obliterates dashes |
I had to pick up the Camel book to figure out how /c interacts with tr
("complemented" is a term of art? is that from sed?), but once there, I
realized that the idiomatic email address sanitization:
$to =~ tr/A-Za-z:,.-@//cd;
is either accidentally trying to take a range from "." to "@" and left
out a lot of important characters (like the numbers), or is deliberately
creating that character range but neglects to include a dash in the
searchlist. Dash is ascii 45, period is ascii 46.
Either way, it's weeding out dashes, a particularly qmail-unfriendly
thing to do.
If the range was created intentionally, then the colon is already in it
(ascii 58, while the range goes up to 64 before the letters take over). I
peeked at RFC2822 to find a nice concise rule about what characters are
permitted, but so far it's just making me feel slightly queasy.