X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fuserdir-ldap.git;a=blobdiff_plain;f=ud-mailgate;h=a3a21a829d8a95fd68c1f6ef5cfd146625449578;hp=1c9f998fc3612c3345a23138b4fcded9ab6f6e70;hb=00994f78b1ff7fcd9481a3fd1559f1a77157adbb;hpb=b7bd5e0fd1dd4eb6a8f6f8b79f53dae09720f109 diff --git a/ud-mailgate b/ud-mailgate index 1c9f998..a3a21a8 100755 --- a/ud-mailgate +++ b/ud-mailgate @@ -668,8 +668,6 @@ try: # Startup the replay cache ErrType = EX_TEMPFAIL; ErrMsg = "Failed to initialize the replay cache:"; - RC = ReplayCache(ReplayCacheFile); - RC.Clean(); # Get the email ErrType = EX_PERMFAIL; @@ -704,12 +702,6 @@ try: else: PlainText = Res[3]; - # Check the signature against the replay cache - ErrMsg = "The replay cache rejected your message. Check your clock!"; - Rply = RC.Check(Res[1]); - if Rply != None: - raise Error, Rply; - # Connect to the ldap server ErrType = EX_TEMPFAIL; ErrMsg = "An error occured while performing the LDAP lookup"; @@ -726,7 +718,17 @@ try: if len(Attrs) != 1: raise Error, "Oddly your key fingerprint is assigned to more than one account.." + + # Check the signature against the replay cache + RC = ReplayCache(ReplayCacheFile); + RC.Clean(); + ErrMsg = "The replay cache rejected your message. Check your clock!"; + Rply = RC.Check(Res[1]); + if Rply != None: + RC.close() + raise Error, Rply; RC.Add(Res[1]); + RC.close() # Determine the sender address ErrMsg = "A problem occured while trying to formulate the reply";