4 # onak-mail.pl - Mail processing interface for onak, an OpenPGP Keyserver.
6 # Written by Jonathan McDowell <noodles@earth.li>
7 # Copyright 2002 Project Purple
8 # Released under the GPL.
19 # Reads in our config file. Ignores any command it doesn't understand rather
20 # than having to list all the ones that are of no interest to us.
24 open(CONFIG, "/home/noodles/projects/onak/onak.conf") or
25 die "Can't read config file: $!";
29 # Ignore; comment line.
30 } elsif (/^this_site (.*)/) {
31 $config{'thissite'} = $1;
32 } elsif (/^maintainer_email (.*)/) {
33 $config{'adminemail'} = $1;
34 } elsif (/^mail_delivery_client (.*)/) {
36 } elsif (/^syncsite (.*)/) {
37 push @{$config{'syncsites'}}, $1;
49 # Takes an armored OpenPGP stream and submits it to the keyserver. Returns the
50 # difference between what we just added and what we had before (ie the least
51 # data need to get from what we had to what we have).
55 my (@errors, @mergedata);
57 open3(\*MERGEIN, \*MERGEOUT, \*MERGEERR,
58 "/home/noodles/onak-0.0.3/onak", "add");
63 @mergedata = <MERGEOUT>;
65 open (LOG, ">>/home/noodles/onak-0.0.3/keyadd.log");
72 my ($inheader, %syncsites, $subject, $from, $replyto, @body, @syncmail);
80 if (/^Subject:\s*(.*)\s*$/i) {
82 } elsif (/^X-KeyServer-Sent:\s*(.*)\s*$/i) {
84 } elsif (/^From:\s*(.*)\s*$/i) {
86 } elsif (/^Reply-To:\s*(.*)\s*$/i) {
97 # HELP, ADD, INCREMENTAL, VERBOSE INDEX <keyid>, INDEX <keyid>, GET <keyid>,
100 if ($subject =~ /^INCREMENTAL$/i) {