def __init__(self, *args, **kwargs): SMTPServer.__init__(self, *args, **kwargs) sys.stdout = codecs.getwriter('utf8')(sys.stdout) sys.stderr = codecs.getwriter('utf8')(sys.stderr) print( 'Debug email server is running. Now you can send emails to SMTP localhost:10250.' )
def __init__(self, laddr, raddr, uilogger): SMTPServer.__init__(self, laddr, raddr) self.uilogger = uilogger self.ib_clients = dict() # a dict to reference different client by account id self.em_clients = list() # list of emails only clients self.ems = None # email sender object self.slack = None # slack client # Retrieve application config from app.yml to initialize emailsender and slack with open('conf/app.yml', 'r') as cf: conf = yaml.load(cf, Loader=yaml.FullLoader) if "email_sender" in conf: self.ems = EmailSender( conf["email_sender"]["smtp_server"], conf["email_sender"]["smtp_port"], conf["email_sender"]["sender"], self.uilogger ) if "slack" in conf: self.slack = Slack( conf['slack']['webhook_path'], url=conf['slack']['webhook_url'], channel=conf['slack']['channel'], username=conf['slack']['username'], icon=conf['slack']['icon'] )
def __init__(self, localaddr, db_config, drop_publisher, cf_options): SMTPServer.__init__(self, localaddr, None) self.drop_publisher = drop_publisher self.db_config = db_config self.db = None self.cf_options = cf_options
def __init__(self, localaddr, db_config, api_url, api_key): SMTPServer.__init__(self, localaddr, None) self.db_config = db_config self.api_url = api_url self.api_key = api_key self.h = Http() self.db = None
def __init__(self, *args, **kwargs): SMTPServer.__init__(self, *args, **kwargs) self.set_reuse_addr() fcntl.fcntl( self.socket.fileno(), fcntl.F_SETFD, fcntl.fcntl(self.socket.fileno(), fcntl.F_GETFD) | fcntl.FD_CLOEXEC) self.data = []
def __init__(self, localaddr, remoteaddr, outputdir, debug=False): '''Initialise''' self.outputdir = outputdir self.debug = debug if not (os.path.exists(outputdir) and os.path.isdir(outputdir)): raise ValueError( 'Provided output dir does not exist or is not a directory') SMTPServer.__init__(self, localaddr, remoteaddr)
def __init__(self, address_or_socket, authenticator=SMTPAuth()): if callable(getattr(address_or_socket, 'listen', None)): asyncore.dispatcher.__init__(self) address_or_socket.setblocking(0) self.set_socket(address_or_socket) else: BaseSMTPServer.__init__(self, address_or_socket, None) self.authenticator = authenticator self.parser = Parser()
def __init__(self, localaddr, remoteaddr): SMTPServer.__init__(self, localaddr, remoteaddr) with open('sendgrid_key', 'r+') as content_file: data = content_file.read().strip() if data is None or data == '': print('No API key set in the file: sendgrid_key') exit(1) print('Sendgrid API key read from storage') self.apikey = data
def __init__(self, localaddr, remoteaddr, output_dir=None, convert=False, log_via=None): SMTPServer.__init__(self, localaddr, None) if not output_dir: output_dir = '.' self.output_dir = output_dir self.convert = convert if not log_via: log_via = 'stdio' self.log_via = log_via
def __init__(self, host='127.0.0.1', port=2526): # Initialize the SMTP component. # My face that asyncore doesn't use new style classes! SMTPServer.__init__(self, (host, port), None) # Retrieve the actually-bound socket address. May, in some circumstances, use a reverse DNS name. if self._localaddr[1] == 0: self.address = self.socket.getsockname() else: self.address = (host, port) # Create a place to store messages. self.messages = deque() # Setup threading. self._stop = Event() self._lock = RLock() Thread.__init__(self, name=self.__class__.__name__)
def __init__(self, localaddr, remoteaddr): SMTPServer.__init__(self, localaddr, remoteaddr) self.mboxes = defaultdict(Mailbox)
def __init__(self, localaddr, remoteaddr, queue): self._localaddr = localaddr self._remoteaddr = remoteaddr self._queue = queue SMTPServer.__init__(self, localaddr, remoteaddr)
def __init__(self, *args, **kwargs): threading.Thread.__init__(self) SMTPServer.__init__(self, *args, **kwargs) self.active_lock = threading.Lock() self.active = False self.daemon = True
def __init__(self, output_connection): SMTPServer.__init__(self, ('localhost', 8001), None) self.output_connection = output_connection
def __init__(self): SMTPServer.__init__(self, ('0.0.0.0', 25), None)
def __init__(self, localaddr, queue): SMTPServer.__init__(self, localaddr, None) self.queue = queue
def __init__(self, *args, **kwargs): SMTPServer.__init__(self, *args, **kwargs) self.callbacks = []
def __init__(self, logger, localaddr, remoteaddr): self.logger = logger SMTPServer.__init__(self, localaddr, remoteaddr)
def __init__(self): localaddr = (settings['lmtpd_host'], settings['lmtpd_port']) SMTPServer.__init__(self, localaddr, None) self.db_connect()
def __init__(self, outgoing, *args, **kwargs): SMTPServer.__init__(self, *args, **kwargs) self.outgoing = outgoing self.log = open("IncomingServer.log", "w")
def __init__(self, localaddr, remoteaddr): SMTPServer.__init__(self, localaddr, remoteaddr) self.number = 0
def __init__(self, *args, **kwargs): self.store = kwargs.pop('store') SMTPServer.__init__(self, *args, **kwargs)
def __init__(self, *args, **kwargs): SMTPServer.__init__(self, *args, **kwargs) #TODO: lock self._messages? self._messages = []
def __init__(self, localaddr, remoteaddr, saveobj, logobj): self.capture = saveobj self.message = logobj SMTPServer.__init__(self, localaddr, remoteaddr)
def __init__(self, laddr, raddr, uilogger): SMTPServer.__init__(self, laddr, raddr) self.uilogger = uilogger
def __init__(self, path, *args, **kwargs): self.path = path self.counter = count(1) # smtpd.SMTPServer is still on old-school class on 2.7 SMTPServer.__init__(self, *args, **kwargs)
def __init__(self, localaddr, remoteaddr, maildir): SMTPServer.__init__(self, localaddr, remoteaddr) self.maildir = maildir
def run(self): SMTPServer.__init__(self, (self.host, self.port), None) try: asyncore.loop() except KeyboardInterrupt: pass
def __init__(self, host, port): self.msgs = [] SMTPServer.__init__(self, (host, port), None)
def __init__(self, localaddr, remoteaddr, fail, channel): SMTPServer.__init__(self, localaddr, remoteaddr) self.fail = fail self.channel = channel
def __init__(self, localaddr, remoteaddr, logger): SMTPServer.__init__(self, localaddr, remoteaddr) self.log = logger
def __init__(self, localaddr, remoteaddr): SMTPServer.__init__(self, localaddr, remoteaddr) self.processor = RaindropEmailProcessor() self.hbase = RaindropHBaseClient()
def __init__(self, localaddr, remoteaddr): SMTPServer.__init__(self, localaddr, remoteaddr)
def __init__(self, localaddr, remoteaddr, queue): SMTPServer.__init__(self, localaddr, remoteaddr) self.queue = queue
def __init__(self, app, bindaddr, port): SMTPServer.__init__(self, (bindaddr, port), None) self.app = app
def __init__(self, *args, **kwargs): SMTPServer.__init__(self, *args, **kwargs) sys.stdout = codecs.getwriter('utf8')(sys.stdout) sys.stderr = codecs.getwriter('utf8')(sys.stderr) print 'Debug email server is running. Now you can send emails to SMTP localhost:10250.'
def __init__(self, localaddr, handler): SMTPServer.__init__(self, localaddr, None) self.handler = handler
def __init__(self, call_back_function=None): SMTPServer.__init__(self, ('localhost', 8025), (None, 0)) self.call_back_function = call_back_function
def __init__(self, localaddr, queue): SMTPServer.__init__(self, localaddr, None, decode_data=True) self.queue = queue