3 our @digits=split "","ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-";
13 $str = $digits[$remainder].$str;
18 sub strict_rfc2822_escape($){
19 # according to rfc 2822, the following non-alphanumerics are OK for
20 # the local part of an address: "!#$%&'*+-/=?^_`{|}~". On the other
21 # hand, a fairly common exim configuration, for example, blocks
22 # addresses having "@%!/|`#&?" in the local part. '+' and '-' are
23 # pretty widely used to attach suffixes (although usually only one
24 # works on a given mail host). It seems ok to use '+-', since the first
25 # marks the beginning of a suffix, and then is a regular character.
26 # '.' also seems mostly permissable
29 # "=" we use as an escape, and '_' for space
30 $str=~ s/([^a-zA-Z0-9+\-~. ])/"=".encode_num(ord($1))."="/ge;
38 print strict_rfc2822_escape($_);