Locked accounts
[mirror/userdir-ldap.git] / ud-mailgate
index 1e42f4f..91dcf40 100755 (executable)
@@ -190,8 +190,8 @@ def HandleChange(Reply,DnRecord,Key):
            Show = 1;
           Res = "OK";
          else:
-            Res = DoPosition(Line,Attrs) or DoDNS(Line,Attrs,DnRecord) or \ 
-                  DoArbChange(Line,Attrs) or DoSSH(Line,Attrs);
+           Res = DoPosition(Line,Attrs) or DoDNS(Line,Attrs,DnRecord) or \
+                 DoArbChange(Line,Attrs) or DoSSH(Line,Attrs);
       except:
          Res = None;
          Result = Result + "==> %s: %s\n" %(sys.exc_type,sys.exc_value);
@@ -352,6 +352,9 @@ try:
    if Sender == None:
       raise Error, "Unable to determine the sender's address";
 
+   if (string.find(GetAttr(Attrs[0],"userPassword"),"*LK*")  != -1):
+      raise Error, "This account is locked";
+
    # Formulate a reply
    Date = time.strftime("%a, %d %b %Y %H:%M:%S +0000",time.gmtime(time.time()));
    Reply = "To: %s\nReply-To: %s\nDate: %s\n" % (Sender,ReplyTo,Date);