Linux tsuru-no-tsurugi 5.15.0-186-generic #196-Ubuntu SMP Sat Jun 20 16:09:34 UTC 2026 x86_64
Apache/2.4.52 (Ubuntu)
Server IP : 192.168.0.18 & Your IP : 216.73.216.68
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
lib /
python3 /
dist-packages /
twisted /
mail /
Delete
Unzip
Name
Size
Permission
Date
Action
__pycache__
[ DIR ]
drwxr-xr-x
2026-06-05 06:15
scripts
[ DIR ]
drwxr-xr-x
2026-06-05 06:15
test
[ DIR ]
drwxr-xr-x
2026-06-05 06:15
__init__.py
142
B
-rw-r--r--
2022-02-07 22:12
_cred.py
2.68
KB
-rw-r--r--
2022-02-07 22:12
_except.py
8.52
KB
-rw-r--r--
2022-02-07 22:12
_pop3client.py
45.64
KB
-rw-r--r--
2022-02-07 22:12
alias.py
23.43
KB
-rw-r--r--
2022-02-07 22:12
bounce.py
3.1
KB
-rw-r--r--
2022-02-07 22:12
imap4.py
206.58
KB
-rw-r--r--
2022-02-07 22:12
interfaces.py
31.32
KB
-rw-r--r--
2022-02-07 22:12
mail.py
20.09
KB
-rw-r--r--
2022-02-07 22:12
maildir.py
27.08
KB
-rw-r--r--
2022-02-07 22:12
pb.py
3.62
KB
-rw-r--r--
2022-02-07 22:12
pop3.py
53.6
KB
-rw-r--r--
2022-02-07 22:12
pop3client.py
487
B
-rw-r--r--
2022-02-07 22:12
protocols.py
12.04
KB
-rw-r--r--
2022-02-07 22:12
relay.py
5.14
KB
-rw-r--r--
2022-02-07 22:12
relaymanager.py
37.6
KB
-rw-r--r--
2022-02-07 22:12
smtp.py
70.61
KB
-rw-r--r--
2022-02-07 22:12
tap.py
12.5
KB
-rw-r--r--
2022-02-07 22:12
Save
Rename
# -*- test-case-name: twisted.mail.test.test_bounce -*- # # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Support for bounce message generation. """ import email.utils import os import time from io import SEEK_END, SEEK_SET, StringIO from twisted.mail import smtp BOUNCE_FORMAT = """\ From: postmaster@{failedDomain} To: {failedFrom} Subject: Returned Mail: see transcript for details Message-ID: {messageID} Content-Type: multipart/report; report-type=delivery-status; boundary="{boundary}" --{boundary} {transcript} --{boundary} Content-Type: message/delivery-status Arrival-Date: {ctime} Final-Recipient: RFC822; {failedTo} """ def generateBounce(message, failedFrom, failedTo, transcript="", encoding="utf-8"): """ Generate a bounce message for an undeliverable email message. @type message: a file-like object @param message: The undeliverable message. @type failedFrom: L{bytes} or L{unicode} @param failedFrom: The originator of the undeliverable message. @type failedTo: L{bytes} or L{unicode} @param failedTo: The destination of the undeliverable message. @type transcript: L{bytes} or L{unicode} @param transcript: An error message to include in the bounce message. @type encoding: L{str} or L{unicode} @param encoding: Encoding to use, default: utf-8 @rtype: 3-L{tuple} of (E{1}) L{bytes}, (E{2}) L{bytes}, (E{3}) L{bytes} @return: The originator, the destination and the contents of the bounce message. The destination of the bounce message is the originator of the undeliverable message. """ if isinstance(failedFrom, bytes): failedFrom = failedFrom.decode(encoding) if isinstance(failedTo, bytes): failedTo = failedTo.decode(encoding) if not transcript: transcript = """\ I'm sorry, the following address has permanent errors: {failedTo}. I've given up, and I will not retry the message again. """.format( failedTo=failedTo ) failedAddress = email.utils.parseaddr(failedTo)[1] data = { "boundary": "{}_{}_{}".format(time.time(), os.getpid(), "XXXXX"), "ctime": time.ctime(time.time()), "failedAddress": failedAddress, "failedDomain": failedAddress.split("@", 1)[1], "failedFrom": failedFrom, "failedTo": failedTo, "messageID": smtp.messageid(uniq="bounce"), "message": message, "transcript": transcript, } fp = StringIO() fp.write(BOUNCE_FORMAT.format(**data)) orig = message.tell() message.seek(0, SEEK_END) sz = message.tell() message.seek(orig, SEEK_SET) if sz > 10000: while 1: line = message.readline() if isinstance(line, bytes): line = line.decode(encoding) if len(line) <= 0: break fp.write(line) else: messageContent = message.read() if isinstance(messageContent, bytes): messageContent = messageContent.decode(encoding) fp.write(messageContent) return b"", failedFrom.encode(encoding), fp.getvalue().encode(encoding)