Escaping of - starting lines
[mirror/userdir-ldap.git] / userdir_gpg.py
index 21bc138..e0f3feb 100644 (file)
@@ -88,7 +88,7 @@ def GetClearSig(Msg):
       if Msg.getparam('micalg') != None:
           Output = Output + "Hash: %s\r\n"%(string.upper(Msg.getparam('micalg')[4:]));
       Output = Output + "\r\n";
-      Output = Output + Signed.getvalue() + Signature;
+      Output = Output +  string.replace(Signed.getvalue(),"\n---","\n- ---") + Signature;
       return (Output,1);
    else:
       # Just return the message body
@@ -342,6 +342,7 @@ def GPGKeySearch(SearchCriteria):
    Result = [];
    Owner = "";
    KeyID = "";
+   Hits = {};
    try:
       Strm = os.popen(string.join(Args," "),"r");
       
@@ -360,6 +361,9 @@ def GPGKeySearch(SearchCriteria):
 
          # Output the key
          if Split[0] == 'fpr':
+            if Hits.has_key(Split[9]):
+               continue;
+            Hits[Split[9]] = None;
             Result.append( (KeyID,Split[9],Owner,Length) );
    finally:
       if Strm != None: