summaryrefslogtreecommitdiff
path: root/packages/cern-scripts/resources/bin/smtp-server.py
diff options
context:
space:
mode:
authorYves Fischer <yvesf-git@xapek.org>2016-02-27 15:58:12 +0100
committerYves Fischer <yvesf-git@xapek.org>2016-02-27 15:58:12 +0100
commita307e0474e78c51590aeac95dbc5587a87ef6501 (patch)
treec5c7ca86b0b86704a4c1adc588e7ce249826e98f /packages/cern-scripts/resources/bin/smtp-server.py
parent77955935e9549a847ae7e0d78819f090d429fdb6 (diff)
downloaddebian-packages-a307e0474e78c51590aeac95dbc5587a87ef6501.tar.gz
debian-packages-a307e0474e78c51590aeac95dbc5587a87ef6501.zip
refactor scripts packages
Diffstat (limited to 'packages/cern-scripts/resources/bin/smtp-server.py')
-rwxr-xr-xpackages/cern-scripts/resources/bin/smtp-server.py20
1 files changed, 0 insertions, 20 deletions
diff --git a/packages/cern-scripts/resources/bin/smtp-server.py b/packages/cern-scripts/resources/bin/smtp-server.py
deleted file mode 100755
index 1cfef81..0000000
--- a/packages/cern-scripts/resources/bin/smtp-server.py
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env python
-import sys, os, mailbox, email, smtpd, asyncore
-
-class MaildirServer(smtpd.PureProxy):
- def __init__(self, localaddr, remoteaddr):
- smtpd.SMTPServer.__init__(self, localaddr, remoteaddr)
- self.maildir = mailbox.Maildir("./Maildir", create=True)
- def _deliver(self, mailfrom, rcpttos, data):
- mail = email.message_from_string(data)
- maildirMail = Message(mail)
- self.maildir.add(maildirMail)
-
-if __name__ == '__main__':
- muttrc = os.path.join(os.path.dirname(__file__), "muttrc")
- print("Use `mutt -F {}' to read mails".format(muttrc))
- smtpd.DEBUGSTREAM = sys.stderr
- server = MaildirServer(("0.0.0.0", 8025), (None, None))
- asyncore.loop()
-
-# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4