Skip to content
Browse files

implement chgheader and quarantine methods

  • Loading branch information...
1 parent 2b4205a commit b0cdaf533a07bb1467766212590d4f14359bae44 @flaviogrossi committed May 8, 2014
Showing with 7 additions and 5 deletions.
  1. +7 −5 txmilter/protocol.py
View
12 txmilter/protocol.py
@@ -112,9 +112,10 @@ def addheader(self, msg):
""" Add a mail header field. """
return CONTINUE
- def chgheader(self, msg):
+ def chgHeader(self, index, name, value):
""" Change the value of a mail header field. """
- return CONTINUE
+ data = {'name': name, 'value': value, 'index': index}
+ return self._send(MilterMessage('SMFIR_CHGHEADER', data))
def addrcpt(self, msg):
""" Add a recipient to the message. """
@@ -132,9 +133,10 @@ def chgfrom(self, msg):
""" Change the SMTP sender address. """
return CONTINUE
- def quarantine(self, msg):
- """ Quarantine the message. """
- return CONTINUE
+ def quarantine(self, reason):
+ """ Quarantine the message with the given reason. """
+ message = MilterMessage('SMFIR_QUARANTINE', {'reason': reason})
+ return self._send(message)
def progress(self, msg):
""" Tell the MTA to wait a bit longer. """

0 comments on commit b0cdaf5

Please sign in to comment.
Something went wrong with that request. Please try again.