]> the.earth.li Git - autodns.git/blobdiff - autodns.pl
Ensure we split commands for MIME signed mail.
[autodns.git] / autodns.pl
index fa4e09b6a337cb4005e18f1a2b62d126ad5e3571..04d0d514a660d9edf847268375d051b3a4c36261 100755 (executable)
@@ -252,7 +252,7 @@ if ($entity->parts) {
 } else {
        # Clear text.
 
-       my $pid = open3(\*GPGIN, \*GPGOUT, \*GPGERR, "gpg --batch");
+       my $pid = open3(\*GPGIN, \*GPGOUT, \*GPGERR, "gpg --batch --verify");
 
        # Feed it the mail.
        print GPGIN $entity->bodyhandle->as_string;
@@ -261,6 +261,7 @@ if ($entity->parts) {
        # And grab what it has to say.
        @GPGERROR=<GPGERR>;
        @COMMANDS=<GPGOUT>;
+       @COMMANDS = split /\n/,$entity->bodyhandle->as_string;
        close GPGERR;
        close GPGOUT;
        waitpid $pid, 0;
@@ -273,7 +274,7 @@ foreach (@GPGERROR) {
        chomp;
        if (/Signature made (.*) using.*ID (.*)$/) {
                $sigtime = str2time($1);
-               $gpguser=$2; 
+               $gpguser=$2;
        } elsif (/error/) {
                $gpggood = 0;
                print REPLY "Some errors ocurred\n";