def main_process(port_number, spool_file, verbose, notify): factory = SMTPFactory() factory.protocol = Server factory.protocol.spool_file = spool_file factory.protocol.verbose = verbose factory.protocol.notify = notify factory.timeout = 200 reactor.listenTCP(port_number, factory) print "Listening on port %s, spooling on %s" % (port_number, spool_file) if notify: print "Will notify on the desktop" if verbose: print "Will notify on the console" reactor.run()
def buildProtocol(self, addr): p = SMTPFactory.buildProtocol(self, addr) p.delivery = SwiftSMTPUserDelivery(self.connectToSwift, self.rabbitmq_cluster, self.queue_name) return p
def __init__(self, connectToSwift, rabbitmq_cluster, queue_name): SMTPFactory.__init__(self) self.connectToSwift = connectToSwift self.rabbitmq_cluster = rabbitmq_cluster self.queue_name = queue_name
def buildProtocol(self, addr): p = SMTPFactory.buildProtocol(self, addr) p.challengers = {"LOGIN": LOGINCredentials, "PLAIN": PLAINCredentials} return p