From 4845f6a8b29e77c5d829f9aa49048fd4b2a87e41 Mon Sep 17 00:00:00 2001
From: Jonathan McDowell <noodles@earth.li>
Date: Sun, 18 Sep 2005 10:41:51 +0000
Subject: [PATCH 1/1] Enable ADD support for email interface. onak-mail.pl
 didn't support ADD; this is still in use by some people, so has now been
 added. Thanks to Ian Jackson for reporting, I'd forgotten it didn't support
 this yet.

---
 onak-mail.pl.in | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/onak-mail.pl.in b/onak-mail.pl.in
index 263b727..5c1ce53 100644
--- a/onak-mail.pl.in
+++ b/onak-mail.pl.in
@@ -88,7 +88,7 @@ sub processmail($$$$$) {
 	# HELP, ADD, INCREMENTAL, VERBOSE INDEX <keyid>, INDEX <keyid>,
 	# GET <keyid>, LAST <days>
 	
-	if ($subject =~ /^INCREMENTAL$/i) {
+	if ($subject =~ /^(INCREMENTAL|ADD)$/i) {
 		my $site;
 		my $count;
 		my $i;
@@ -110,6 +110,21 @@ sub processmail($$$$$) {
 			$time[2], $time[1], $time[0];
 		print LOG "] onak-mail[$$]: Syncing with $count sites.\n";
 		close LOG;
+
+		if ($subject =~ /ADD/i) {
+			open(MAIL, "|$config{mta}");
+			print MAIL "From: $config{adminemail}\n";
+			print MAIL "To: $replyto\n";
+			print MAIL "Subject: Reply to ADD\n";
+			print MAIL "Precedence: list\n";
+			print MAIL "MIME-Version: 1.0\n";
+			print MAIL "Content-Type: text/plain\n";
+			print MAIL "\n";
+			print MAIL "Thank you for your recent key submission.",
+				" It has been processed and synced\n",
+				"with ", $count, " other keyservers.\n";
+			close MAIL;
+		}
 	
 		if ((! defined($newupdate[0])) || $newupdate[0] eq '') {
 			open (LOG, ">>$config{'logfile'}");
-- 
2.39.5