Simple async smtp sender with redis as broker.
$ git clone https://github.com/AHAPX/smtpush
$ cd smtpush
$ pip install -r requirements.txt$ python smtpush.py -c ~/config.cfg$ redis-cli
> PUBLISH smtp-channel '{"to": ["mail@host"], "subj": "test", "body": "hello"}'
Config has ini format, i.e.
[main]
debug = false
[smtp]
host = mail.host
port = 587
username = user
passwor = password
from = info@host
tls = true
ssl = true
[redis]
host = localhost
port = 6379
db = 1
channel = smtp-channel- config - path to config file
- host - smtp host
- port - smtp port, default=25
- username - smtp username
- password - smtp password
- from - sender email
- tls - using tls
- ssl - using ssl
- rhost - host of redis broker, default=locahost
- rport - port of redis broker, default=6379
- rdb - number of redis db, default=0
- rchannel - redis channel for subscription, default=ws-channel
- debug - debug mode
$ python -m unittestSMTPush server subscribes to channel and wait messages. Message must be valid JSON. It should consist keys:
- to - recipients (array, required)
- subj - subject (string, required)
- body - body (string, required)
- html - html body text (string)
- from - sender email (email)
- cc - CC (array)
- bcc - BCC (array)