Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(220)

Unified Diff: third_party/twisted_8_1/twisted/mail/bounce.py

Issue 12261012: Remove third_party/twisted_8_1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/twisted_8_1/twisted/mail/alias.py ('k') | third_party/twisted_8_1/twisted/mail/imap4.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/twisted_8_1/twisted/mail/bounce.py
diff --git a/third_party/twisted_8_1/twisted/mail/bounce.py b/third_party/twisted_8_1/twisted/mail/bounce.py
deleted file mode 100644
index d57c495ec7f6842683c6cfefe1828754d9319e23..0000000000000000000000000000000000000000
--- a/third_party/twisted_8_1/twisted/mail/bounce.py
+++ /dev/null
@@ -1,61 +0,0 @@
-# -*- test-case-name: twisted.mail.test.test_bounce -*-
-#
-# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
-# See LICENSE for details.
-
-
-import StringIO
-import rfc822
-import string
-import time
-import os
-
-
-from twisted.mail import smtp
-
-BOUNCE_FORMAT = """\
-From: postmaster@%(failedDomain)s
-To: %(failedFrom)s
-Subject: Returned Mail: see transcript for details
-Message-ID: %(messageID)s
-Content-Type: multipart/report; report-type=delivery-status;
- boundary="%(boundary)s"
-
---%(boundary)s
-
-%(transcript)s
-
---%(boundary)s
-Content-Type: message/delivery-status
-Arrival-Date: %(ctime)s
-Final-Recipient: RFC822; %(failedTo)s
-"""
-
-def generateBounce(message, failedFrom, failedTo, transcript=''):
- if not transcript:
- transcript = '''\
-I'm sorry, the following address has permanent errors: %(failedTo)s.
-I've given up, and I will not retry the message again.
-''' % vars()
-
- boundary = "%s_%s_%s" % (time.time(), os.getpid(), 'XXXXX')
- failedAddress = rfc822.AddressList(failedTo)[0][1]
- failedDomain = string.split(failedAddress, '@', 1)[1]
- messageID = smtp.messageid(uniq='bounce')
- ctime = time.ctime(time.time())
-
- fp = StringIO.StringIO()
- fp.write(BOUNCE_FORMAT % vars())
- orig = message.tell()
- message.seek(2, 0)
- sz = message.tell()
- message.seek(0, orig)
- if sz > 10000:
- while 1:
- line = message.readline()
- if len(line)<=1:
- break
- fp.write(line)
- else:
- fp.write(message.read())
- return '', failedFrom, fp.getvalue()
« no previous file with comments | « third_party/twisted_8_1/twisted/mail/alias.py ('k') | third_party/twisted_8_1/twisted/mail/imap4.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698