Example #1
0
File: nits.py Project: jeansch/nits
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()
Example #2
0
 def buildProtocol(self, addr):
     p = SMTPFactory.buildProtocol(self, addr)
     p.delivery = SwiftSMTPUserDelivery(self.connectToSwift, self.rabbitmq_cluster, self.queue_name)
     return p
Example #3
0
 def __init__(self, connectToSwift, rabbitmq_cluster, queue_name):
     SMTPFactory.__init__(self)
     self.connectToSwift = connectToSwift
     self.rabbitmq_cluster = rabbitmq_cluster
     self.queue_name = queue_name
Example #4
0
 def buildProtocol(self, addr):
     p = SMTPFactory.buildProtocol(self, addr)
     p.delivery = SwiftSMTPUserDelivery(self.connectToSwift,
                                        self.rabbitmq_cluster,
                                        self.queue_name)
     return p
Example #5
0
 def __init__(self, connectToSwift, rabbitmq_cluster, queue_name):
     SMTPFactory.__init__(self)
     self.connectToSwift = connectToSwift
     self.rabbitmq_cluster = rabbitmq_cluster
     self.queue_name = queue_name
Example #6
0
 def buildProtocol(self, addr):
     p = SMTPFactory.buildProtocol(self, addr)
     p.challengers = {"LOGIN": LOGINCredentials, "PLAIN": PLAINCredentials}
     return p