Disable negotiate callback when runtime version < 1,0,1

This commit is contained in:
Stuart Gathman
2009-07-28 21:53:27 +00:00
parent c20e82e3d4
commit 25a02d9de2
+5 -1
View File
@@ -574,11 +574,15 @@ def runmilter(name,socketname,timeout = 0):
milter.setconn(socketname) milter.setconn(socketname)
if timeout > 0: milter.settimeout(timeout) if timeout > 0: milter.settimeout(timeout)
# disable negotiate callback if runtime version < (1,0,1)
ncb = negotiate_callback
if milter.getversion() < (1,0,1):
ncb = None
# The name *must* match the X line in sendmail.cf (supposedly) # The name *must* match the X line in sendmail.cf (supposedly)
milter.register(name, milter.register(name,
data=lambda ctx: ctx.getpriv().data(), data=lambda ctx: ctx.getpriv().data(),
unknown=lambda ctx,cmd: ctx.getpriv().unknown(cmd), unknown=lambda ctx,cmd: ctx.getpriv().unknown(cmd),
negotiate=negotiate_callback negotiate=ncb
) )
start_seq = _seq start_seq = _seq
try: try: