Anton Shestakov <av6@dwimlabs.net>, Fri, 23 Aug 2019 22:27:47 +0700
use TLS 1.2 because it's modern, and that's what clients should use
xmpp-headline.py
Permissions: -rw-r--r--
from __future__ import print_function class SendMsgBot(sleekxmpp.ClientXMPP): def __init__(self, jid, password, recipient, efrom, esubject): super(SendMsgBot, self).__init__(jid, password) self.recipient = recipient self.add_event_handler('session_start', self.start) self.ssl_version = ssl.PROTOCOL_TLSv1_2 print('sending message...') msubject='New email: %s' % self.esubject, mbody='%s from %s' % (self.esubject, self.efrom)) print('disconnecting...') self.disconnect(wait=True) jid = 'emailbot@example.com' efrom = sys.argv[1] or '(unknown)' esubject = sys.argv[2] or '(no subject)' xmpp = SendMsgBot(jid, password, to, efrom, esubject) print('connection failed.') if __name__ == '__main__':