try:
# Startup the replay cache
ErrType = EX_TEMPFAIL;
- if ReplayCacheFile != None:
+ if ReplayCacheFile is not None:
ErrMsg = "Failed to initialize the replay cache:";
RC = ReplayCache(ReplayCacheFile);
RC.Clean();
ErrMsg = "Unable to check the signature or the signature was invalid:";
Res = GPGCheckSig(Msg[0]);
- if Res[0] != None:
+ if Res[0] is not None:
raise Error, Res[0];
- if Res[3] == None:
+ if Res[3] is None:
raise Error, "Null signature text";
# Extract the plain message text in the event of mime encoding
PlainText = Res[3];
# Check the signature against the replay cache
- if ReplayCacheFile != None:
+ if ReplayCacheFile is not None:
ErrMsg = "The replay cache rejected your message. Check your clock!";
Rply = RC.Check(Res[1]);
- if Rply != None:
+ if Rply is not None:
raise Error, Rply;
RC.Add(Res[1]);
# Do LDAP stuff
- if LDAPDn != None:
+ if LDAPDn is not None:
CheckLDAP(Res[2][1]);
# Determine the sender address
ErrType = EX_PERMFAIL;
ErrMsg = "A problem occured while trying to formulate the reply";
Sender = Email.getheader("Reply-To");
- if Sender == None:
+ if Sender is None:
Sender = Email.getheader("From");
- if Sender == None:
+ if Sender is None:
raise Error, "Unable to determine the sender's address";
# Setup the environment
# Invoke the child
Child = os.popen(" ".join(arguments),"w");
Child.write(PlainText);
- if Child.close() != None:
+ if Child.close() is not None:
raise Error, "Child gave a non-zero return code";
except:
# Try to send the bounce
try:
- if ErrorTemplate != None:
+ if ErrorTemplate is not None:
ErrReply = TemplateSubst(Subst,open(ErrorTemplate,"r").read());
else:
ErrReply = "\n"+str(Subst)+"\n";
Child = os.popen("/usr/sbin/sendmail -t","w");
Child.write(ErrReplyHead);
Child.write(ErrReply);
- if Child.close() != None:
+ if Child.close() is not None:
raise Error, "Sendmail gave a non-zero return code";
except:
sys.exit(EX_TEMPFAIL);