#!/usr/bin/perl use Mail::Sendmail; open KEYS, ') { my @sigs = `gpg --list-sigs $_`; my $key = $sigs[0]; $key =~ s/^.*?\d\d\d\d-\d\d-\d\d//; if (grep /Bowen/, @sigs) { print " $key Signed\n"; my @export = `gpg --export --armor $_`; my $export = join '', @export; my $email = $key; $email =~ s/.*?<([^>]*)>.*/$1/; print "Email address is $email\n"; my $body = qq~ Thanks for participating in the key signing at ApacheCon. Attached is your signed key, if my script works correctly. :-) Please let me know if there are any difficulties with this. And sorry of you're getting this twice. Occasionally my laziness doesn't actually save me anything. $export Rich Bowen rbowen@apache.org ~; # print "I'm going to try to send this message:\n\n$body\n"; print "Attempting to send signed key to $email\n"; my %mail = ( To => $email, Subject => 'Your signed key from ApacheCon', From => 'rbowen@apache.org', Message => $body, ); sendmail(%mail); } else { print "$key Not signed. Skipping\n\n"; } }