1: #!/usr/bin/perl -wT 2: 3: # E-mail Redirect (for protecting addresses from E-mail-Address-Collecting Bots) 4: # by David Glick [davisagli], 6/25/2001 5: 6: # when given an e-mail address in the form "[user],[domain]", 7: # this script returns an HTTP redirect to "mailto:[user]@[domain]" 8: 9: # This can be used to prevent spam-bots from finding e-mail 10: # addresses in HTML links; for example, instead of linking to 11: # "mailto:me@mydomain", you can link to "this_script.pl?me,mydomain" 12: 13: # Comments/improvements welcome; I don't have much experience with CGI. 14: 15: # Update 6/25/2001: The security risk that [bikeNomad] pointed out 16: # shouldn't be an issue now. Also implemented his other suggestions. 17: # Thanks much, bikeNomad! 18: 19: use strict; 20: use warnings; 21: use CGI qw/:standard/; 22: 23: $_ = param('keywords'); 24: my ($user, $domain) = m{^([\w!$'*+-/=^.]+),([\w!$'*+-/=^.]+)$}; 25: print redirect( -uri => "mailto:$user\@$domain" ) 26: if defined($user) && defined($domain);
|
---|
Back to
Craft