From 050226e7f81d6eb588de1762fdc034f5f96e13be Mon Sep 17 00:00:00 2001 From: Adam Bard Date: Tue, 8 May 2012 13:38:47 -0700 Subject: [PATCH 1/6] Added argparse to requirements and setup.py for the benefit of those unfortunates with python 2.6 --- requirements.txt | 3 ++- setup.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 1366d4f..ca066b3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ gevent -logbook \ No newline at end of file +logbook +argparse diff --git a/setup.py b/setup.py index 223aa2b..6b56d12 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ author_email='me@kennethreitz.com', url='https://github.com/kennethreitz/inbox.py', py_modules= ['inbox',], - install_requires=['gevent', 'logbook'], + install_requires=['gevent', 'logbook', 'argparse'], license='BSD', classifiers=( # 'Development Status :: 5 - Production/Stable', From 4b1c76955f798601c3f7d43bf2ad51521e731bc7 Mon Sep 17 00:00:00 2001 From: waawal Date: Sat, 12 May 2012 00:29:30 +0200 Subject: [PATCH 2/6] Added subject argument to callated --- README.rst | 4 ++-- inbox.py | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 010dcc4..b40140d 100644 --- a/README.rst +++ b/README.rst @@ -16,7 +16,7 @@ Give your app an inbox easily:: inbox = Inbox() @inbox.collate - def handle(to, sender, body): + def handle(to, sender, subject, body): ... # Bind directly. @@ -39,4 +39,4 @@ Installation Installing Inbox.py is simple:: - $ pip install inbox \ No newline at end of file + $ pip install inbox diff --git a/inbox.py b/inbox.py index f5eae47..17cf790 100644 --- a/inbox.py +++ b/inbox.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- import argparse +from email.parser import Parser import gevent import gevent.monkey @@ -25,8 +26,9 @@ def __init__(self, handler, *args, **kwargs): def process_message(self, peer, mailfrom, rcpttos, data): log.info('Collating message from {0}'.format(mailfrom)) - log.debug(dict(to=rcpttos, sender=mailfrom, body=data)) - return self._handler(to=rcpttos, sender=mailfrom, body=data) + subject = Parser().parsestr(data)['subject'] + log.debug(dict(to=rcpttos, sender=mailfrom, subject=subject, body=data)) + return self._handler(to=rcpttos, sender=mailfrom, subject=subject, body=data) class Inbox(object): From 91e2f2f9941af9a97ded2d094d545770819d24bc Mon Sep 17 00:00:00 2001 From: Daniel Waardal Date: Wed, 3 Jul 2013 09:10:59 +0200 Subject: [PATCH 3/6] removing gevent, this fixes #9 --- README.rst | 4 ++-- inbox.py | 10 ++-------- requirements.txt | 1 - setup.py | 2 +- 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/README.rst b/README.rst index b40140d..eecc798 100644 --- a/README.rst +++ b/README.rst @@ -1,9 +1,9 @@ Inbox.py: SMTP Server for Humans ================================ -This is simplest SMTP server you'll ever see. It's asynchronous. +This is the simplest SMTP server you'll ever see. It's asynchronous. -One instance should handle over one thousand emails per second, thanks to Gevent. +One instance should handle over one thousand emails per second. Usage diff --git a/inbox.py b/inbox.py index 17cf790..0fecba7 100644 --- a/inbox.py +++ b/inbox.py @@ -1,18 +1,12 @@ # -*- coding: utf-8 -*- +import smtpd +import asyncore import argparse from email.parser import Parser -import gevent -import gevent.monkey - from logbook import Logger -gevent.monkey.patch_select() - -import smtpd -import asyncore - log = Logger(__name__) diff --git a/requirements.txt b/requirements.txt index ca066b3..36efcbc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,2 @@ -gevent logbook argparse diff --git a/setup.py b/setup.py index 6b56d12..3602a3d 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ author_email='me@kennethreitz.com', url='https://github.com/kennethreitz/inbox.py', py_modules= ['inbox',], - install_requires=['gevent', 'logbook', 'argparse'], + install_requires=['logbook', 'argparse'], license='BSD', classifiers=( # 'Development Status :: 5 - Production/Stable', From cb2253847d20fccb282c07d1c864929a5f01f448 Mon Sep 17 00:00:00 2001 From: Daniel Waardal Date: Wed, 3 Jul 2013 09:17:51 +0200 Subject: [PATCH 4/6] upping version for new pypi release, fixes #8 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 3602a3d..84868f7 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ settings.update( name='inbox', - version='0.0.5', + version='0.0.6', description='SMTP for Humans.', long_description=open('README.rst').read(), author='Kenneth Reitz', From c1320257e5ffd4ac8df1898e5db7d024ef951ba8 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 4 Feb 2016 06:21:48 -0500 Subject: [PATCH 5/6] i should have said no --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 84868f7..ea578e7 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ sys.exit() settings.update( - name='inbox', + name='inbox.py', version='0.0.6', description='SMTP for Humans.', long_description=open('README.rst').read(), From 48a4ed8beb59347c467865acb1cc10041dabf3c6 Mon Sep 17 00:00:00 2001 From: carloshanson Date: Mon, 11 Jul 2016 10:10:57 -0700 Subject: [PATCH 6/6] Change pip install instructions Project name is now inbox.py, not inbox. --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index eecc798..6c9d88d 100644 --- a/README.rst +++ b/README.rst @@ -39,4 +39,4 @@ Installation Installing Inbox.py is simple:: - $ pip install inbox + $ pip install inbox.py