aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--keyserver/ChangeLog6
-rwxr-xr-xkeyserver/gpgkeys_mailto.in27
2 files changed, 26 insertions, 7 deletions
diff --git a/keyserver/ChangeLog b/keyserver/ChangeLog
index 9b5dc1f33..881ba226c 100644
--- a/keyserver/ChangeLog
+++ b/keyserver/ChangeLog
@@ -1,3 +1,9 @@
+2002-07-09 David Shaw <[email protected]>
+
+ * gpgkeys_mailto.in: Use new OPAQUE tag for non net-path URIs.
+ Fail more elegantly if there is no email address to send to. Show
+ the GnuPG version in the message body.
+
2002-07-04 David Shaw <[email protected]>
* gpgkeys_ldap.c (get_key), gpgkeys_hkp.c (get_key): Display
diff --git a/keyserver/gpgkeys_mailto.in b/keyserver/gpgkeys_mailto.in
index c31048360..d2bde094d 100755
--- a/keyserver/gpgkeys_mailto.in
+++ b/keyserver/gpgkeys_mailto.in
@@ -47,9 +47,14 @@ while(<STDIN>)
$command=$1;
}
- if(/^HOST (\S+)/)
+ if(/^OPAQUE (\S+)/)
{
- $host=$1;
+ $address=$1;
+ }
+
+ if(/^PROGRAM (\S+)/)
+ {
+ $program=$1;
}
if(/^OPTION (\w+)/)
@@ -65,6 +70,14 @@ while(<STDIN>)
}
}
+$program="(unknown)" if(!defined($program));
+
+if(!defined($address))
+{
+ print STDERR "gpgkeys: no address provided\n";
+ exit(1);
+}
+
while(<STDIN>)
{
last if($_ eq "\n");
@@ -92,7 +105,7 @@ if($command=~/get/i || $command=~/search/i)
{
open(MAIL,"|$sendmail") || die "ERROR: Can't open $sendmail\n";
print MAIL "From: $name <$login>\n";
- print MAIL "To: $host\n";
+ print MAIL "To: $address\n";
if($command=~/get/i)
{
# mail keyservers don't like long-form keyids
@@ -113,7 +126,7 @@ if($command=~/get/i || $command=~/search/i)
{
print MAIL "Subject: GET $key\n\n";
}
- print MAIL "GnuPG keyserver request\n";
+ print MAIL "GnuPG $program email keyserver request\n";
close(MAIL);
# Tell GnuPG not to expect a key
@@ -121,7 +134,7 @@ if($command=~/get/i || $command=~/search/i)
if($verbose)
{
- print STDERR "gpgkeys: key $key requested from $host\n";
+ print STDERR "gpgkeys: key $key requested from $address\n";
}
}
}
@@ -132,7 +145,7 @@ if($command=~/send/i)
{
open(MAIL,"|$sendmail") || die "ERROR: Can't open $sendmail\n";
print MAIL "From: $name <$login>\n";
- print MAIL "To: $host\n";
+ print MAIL "To: $address\n";
print MAIL "Subject: ADD\n\n";
while(<STDIN>)
@@ -158,7 +171,7 @@ if($command=~/send/i)
if($verbose)
{
- print STDERR "gpgkeys: key $key sent to $host\n";
+ print STDERR "gpgkeys: key $key sent to $address\n";
}
}
}