Skip to content
Snippets Groups Projects
Commit 4c9c1680 authored by Yudai Kato's avatar Yudai Kato
Browse files

suport chgfrom() in TestMilter

see #3
parent ea84943f
Branches
No related tags found
No related merge requests found
...@@ -32,6 +32,8 @@ class TestBase(object): ...@@ -32,6 +32,8 @@ class TestBase(object):
self._bodyreplaced = False self._bodyreplaced = False
## True if the %milter changed any headers. ## True if the %milter changed any headers.
self._headerschanged = False self._headerschanged = False
## True if the %milter changed the envelope from.
self._envfromchanged = False
## Reply codes and messages set by the %milter ## Reply codes and messages set by the %milter
self._reply = None self._reply = None
## The rfc822 message object for the current email being fed to the %milter. ## The rfc822 message object for the current email being fed to the %milter.
...@@ -60,6 +62,12 @@ class TestBase(object): ...@@ -60,6 +62,12 @@ class TestBase(object):
else: else:
raise IOError,"replacebody not called from eom()" raise IOError,"replacebody not called from eom()"
def chgfrom(self,sender,params=None):
if not self._body:
raise IOError,"chgheader not called from eom()"
self.log('chgfrom: sender=%s' % (sender))
self._envfromchanged = True
# FIXME: rfc822 indexing does not really reflect the way chg/add header # FIXME: rfc822 indexing does not really reflect the way chg/add header
# work for a %milter # work for a %milter
def chgheader(self,field,idx,value): def chgheader(self,field,idx,value):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment