X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fuserdir-ldap.git;a=blobdiff_plain;f=ud-mailgate;h=fdf9d713967e4c29efb7f91c6505e3af80e376ff;hp=16f6a59ea2c1128d6672ba0c50f618baddc691d7;hb=03bfe6ae8eff37dc249b92f4b1323423b9b06d27;hpb=bfb0c6a2273f10ebffd6dfa15a45ae7f5671b467 diff --git a/ud-mailgate b/ud-mailgate index 16f6a59..fdf9d71 100755 --- a/ud-mailgate +++ b/ud-mailgate @@ -454,6 +454,7 @@ def HandleChange(Reply,DnRecord,Key): Result = ""; Attrs = []; Show = 0; + CommitChanges = 1 for Line in Lines: Line = Line.strip() if Line == "": @@ -477,7 +478,8 @@ def HandleChange(Reply,DnRecord,Key): # Fail, if someone tries to send someone elses signed email to the # daemon then we want to abort ASAP. if Res == None: - Result = Result + "Command is not understood. Halted\n"; + CommitChanges = 0 + Result = Result + "Command is not understood. Halted - no changes committed\n"; break; Result = Result + Res + "\n"; @@ -494,7 +496,8 @@ def HandleChange(Reply,DnRecord,Key): or GetAttr(oldAttrs[0],"userPassword").startswith("!")): raise Error, "This account is locked"; Dn = "uid=" + GetAttr(DnRecord,"uid") + "," + BaseDn; - l.modify_s(Dn,Attrs); + if CommitChanges == 1: + l.modify_s(Dn,Attrs); Attribs = ""; if Show == 1: