#!/usr/bin/perl # # Generates a VERP (Variable Envelope Return Path) address in response # to a request from an end user. The address in question will only # be honored for a short period (say, three hours); after that, it # gets considered spam. # # We can also filter out requests from known spam robots, and use the # results to discover new ones. # # 6 Feb 04 Erich Rickheit KSC Created use Fcntl ':flock'; # import LOCK_* constants # where do our last couple of keys live? $keyfile = "/home/rickheit/public_html/verpkey"; # some User-Agents known to be robots @known_robots = ( 'Email', 'ExtractorPro', 'Mozilla.*NEWT', 'Crescent', 'CherryPicker', '[Ww]eb[Bb]andit', 'WebEMailExtrac', 'NICErsPRO', 'Telesoft', 'Zeus.*Webster', 'Microsoft.URL', 'Mozilla/3.Mozilla/2.01', 'wget', ); # end of configuration # check for one of those robots for $p (@known_robots) { if ($ENV{HTTP_USER_AGENT} =~ /$p/) { print <Robot? Are you a robot? Go here with a more usual browser to get an address. EOF exit 0; } } # go fetch the key, or die uselessly exit 0 unless open(KEY, "+<$keyfile"); exit 0 unless flock(KEY, LOCK_EX); # read all the keys while () { push @keys, [ split ' ' ]; } # maybe update the key file $ftime = (stat($keyfile))[9]; if (time() - $ftime > 24*60*60) { # construct a new key if (open(RND, "/dev/urandom")) { read RND, $buf, 6; push @keys, [ unpack 'CCCCCC', $buf ]; } else { for (1..6) { push @list, int rand 256; } push @keys, [ @list ]; } # we only want two keys in the list shift @keys while @keys > 2; # write those out truncate KEY, 0; # empty out the key file seek KEY, 0, 0; for $k (@keys) { print KEY join ' ', @$k; print KEY "\n"; } } # done with that key file, others can use it. flock(KEY, LOCK_UN); close(KEY); # construct a timestamp and xor it with that key @stamp = (0x4e, unpack('C4', pack('V', time())), 0x42); for $i (0..5) { $stamp[$i] ^= $keys[$#keys][$i]; } # convert to a base-32 string $a = unpack('b48', pack('C6', @stamp)); $a .= '00'; # pad to 50 bits while (length($a)) { $w = substr $a, 0, 5, ''; $n = unpack 'C', pack('b5', $w); $ext .= chr($n < 10? $n + 48: $n + 87); } # Show them a contect page print <Contact

Contacting Erich Rickheit KSC

If you're emailing me about the Digital Tradition Mirror, you should know: I did not do the work; I'm merely mirroring the data in what I believe to be a more congenial form. I don't have any extra information about these songs; I'm not in a position to research them for you. You should go to Mudcat with questions or comment like this

To reduce spam, I've gone to a whitelist - only people I already know can send me email. The rest of you can try sending mail with this address, which will probably get through to me if you use it to send mail within the next hour or two. (Try refreshing this page if you're unsure)

Mail to this address won't bounce on failure, so there's no way to tell if the address is too old, or I just haven't yet answered. Please be patient.

EOF