Created
August 26, 2013 02:21
-
-
Save puentesarrin/6337614 to your computer and use it in GitHub Desktop.
Bonzo sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tornado.ioloop | |
import email | |
from bonzo.smtpserver import SMTPServer | |
def receive_message(message): | |
print "New received message: " | |
print "From: " + message['from'] | |
print "Subject: " + message['subject'] | |
for line in email.iterators.body_line_iterator(message): | |
print line | |
SMTPServer(receive_message).listen(25) | |
tornado.ioloop.IOLoop.instance().start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment