Skip to content

Commit

Permalink
implement IHalfCloseableProtocol so exim can do its shutdown(fd, SHUT…
Browse files Browse the repository at this point in the history
…_WR)

closes #5
  • Loading branch information
evgeni committed Dec 5, 2010
1 parent 87b2fbb commit b948b6b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions postfix.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,14 @@

from twisted.protocols.basic import LineOnlyReceiver
from twisted.internet.protocol import Factory
from twisted.internet.interfaces import IHalfCloseableProtocol
from zope.interface import implements

class PostfixPolicy(LineOnlyReceiver):
'''Basic implementation of a Postfix policy service.'''

implements(IHalfCloseableProtocol)

def __init__(self):
self.params = {}
self.delimiter = '\n'
Expand Down Expand Up @@ -70,5 +74,12 @@ def send_action (self, action='DUNNO'):
'''
self.sendLine('action=%s\n' % action)

def readConnectionLost(self):
pass

def writeConnectionLost(self):
self.transport.loseConnection()


class PostfixPolicyFactory(Factory):
protocol = PostfixPolicy

0 comments on commit b948b6b

Please sign in to comment.