Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 22 lines (18 sloc) 0.649 kB
8a65dcb @obscurerichard Add sample conf files, use env python in listener
obscurerichard authored
1 #!/usr/bin/env python
54c0763 @obscurerichard Integrate upstream changes from tantalor
obscurerichard authored
2
3 import smtplib
4 import yaml
5 import sys
6 from supervisor.childutils import listener
7 import os
8
9 localdir = os.path.dirname(__file__)
10 config_file = os.path.join(localdir, 'conf', 'listener.yaml')
11 config = yaml.load(file(config_file, 'r'))
12
13 while 1:
14 (header, payload) = listener.wait()
15 if "processname:gogogon-consumer" in payload:
16 server = smtplib.SMTP(config['server']['host'])
17 server.starttls()
18 server.login(config['server']['username'], config['server']['password'])
19 server.sendmail(config['message']['from_addr'], config['message']['to_addrs'], config['message']['body'])
20 server.quit()
21 listener.ok()
Something went wrong with that request. Please try again.