Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../opt/imh-pyth.../lib/python3....
File: poplib.py
"""A POP3 client class.
[0] Fix | Delete
[1] Fix | Delete
Based on the J. Myers POP3 draft, Jan. 96
[2] Fix | Delete
"""
[3] Fix | Delete
[4] Fix | Delete
# Author: David Ascher <david_ascher@brown.edu>
[5] Fix | Delete
# [heavily stealing from nntplib.py]
[6] Fix | Delete
# Updated: Piers Lauder <piers@cs.su.oz.au> [Jul '97]
[7] Fix | Delete
# String method conversion and test jig improvements by ESR, February 2001.
[8] Fix | Delete
# Added the POP3_SSL class. Methods loosely based on IMAP_SSL. Hector Urtubia <urtubia@mrbook.org> Aug 2003
[9] Fix | Delete
[10] Fix | Delete
# Example (see the test function at the end of this file)
[11] Fix | Delete
[12] Fix | Delete
# Imports
[13] Fix | Delete
[14] Fix | Delete
import errno
[15] Fix | Delete
import re
[16] Fix | Delete
import socket
[17] Fix | Delete
import sys
[18] Fix | Delete
[19] Fix | Delete
try:
[20] Fix | Delete
import ssl
[21] Fix | Delete
HAVE_SSL = True
[22] Fix | Delete
except ImportError:
[23] Fix | Delete
HAVE_SSL = False
[24] Fix | Delete
[25] Fix | Delete
__all__ = ["POP3","error_proto"]
[26] Fix | Delete
[27] Fix | Delete
# Exception raised when an error or invalid response is received:
[28] Fix | Delete
[29] Fix | Delete
class error_proto(Exception): pass
[30] Fix | Delete
[31] Fix | Delete
# Standard Port
[32] Fix | Delete
POP3_PORT = 110
[33] Fix | Delete
[34] Fix | Delete
# POP SSL PORT
[35] Fix | Delete
POP3_SSL_PORT = 995
[36] Fix | Delete
[37] Fix | Delete
# Line terminators (we always output CRLF, but accept any of CRLF, LFCR, LF)
[38] Fix | Delete
CR = b'\r'
[39] Fix | Delete
LF = b'\n'
[40] Fix | Delete
CRLF = CR+LF
[41] Fix | Delete
[42] Fix | Delete
# maximal line length when calling readline(). This is to prevent
[43] Fix | Delete
# reading arbitrary length lines. RFC 1939 limits POP3 line length to
[44] Fix | Delete
# 512 characters, including CRLF. We have selected 2048 just to be on
[45] Fix | Delete
# the safe side.
[46] Fix | Delete
_MAXLINE = 2048
[47] Fix | Delete
[48] Fix | Delete
[49] Fix | Delete
class POP3:
[50] Fix | Delete
[51] Fix | Delete
"""This class supports both the minimal and optional command sets.
[52] Fix | Delete
Arguments can be strings or integers (where appropriate)
[53] Fix | Delete
(e.g.: retr(1) and retr('1') both work equally well.
[54] Fix | Delete
[55] Fix | Delete
Minimal Command Set:
[56] Fix | Delete
USER name user(name)
[57] Fix | Delete
PASS string pass_(string)
[58] Fix | Delete
STAT stat()
[59] Fix | Delete
LIST [msg] list(msg = None)
[60] Fix | Delete
RETR msg retr(msg)
[61] Fix | Delete
DELE msg dele(msg)
[62] Fix | Delete
NOOP noop()
[63] Fix | Delete
RSET rset()
[64] Fix | Delete
QUIT quit()
[65] Fix | Delete
[66] Fix | Delete
Optional Commands (some servers support these):
[67] Fix | Delete
RPOP name rpop(name)
[68] Fix | Delete
APOP name digest apop(name, digest)
[69] Fix | Delete
TOP msg n top(msg, n)
[70] Fix | Delete
UIDL [msg] uidl(msg = None)
[71] Fix | Delete
CAPA capa()
[72] Fix | Delete
STLS stls()
[73] Fix | Delete
UTF8 utf8()
[74] Fix | Delete
[75] Fix | Delete
Raises one exception: 'error_proto'.
[76] Fix | Delete
[77] Fix | Delete
Instantiate with:
[78] Fix | Delete
POP3(hostname, port=110)
[79] Fix | Delete
[80] Fix | Delete
NB: the POP protocol locks the mailbox from user
[81] Fix | Delete
authorization until QUIT, so be sure to get in, suck
[82] Fix | Delete
the messages, and quit, each time you access the
[83] Fix | Delete
mailbox.
[84] Fix | Delete
[85] Fix | Delete
POP is a line-based protocol, which means large mail
[86] Fix | Delete
messages consume lots of python cycles reading them
[87] Fix | Delete
line-by-line.
[88] Fix | Delete
[89] Fix | Delete
If it's available on your mail server, use IMAP4
[90] Fix | Delete
instead, it doesn't suffer from the two problems
[91] Fix | Delete
above.
[92] Fix | Delete
"""
[93] Fix | Delete
[94] Fix | Delete
encoding = 'UTF-8'
[95] Fix | Delete
[96] Fix | Delete
def __init__(self, host, port=POP3_PORT,
[97] Fix | Delete
timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
[98] Fix | Delete
self.host = host
[99] Fix | Delete
self.port = port
[100] Fix | Delete
self._tls_established = False
[101] Fix | Delete
sys.audit("poplib.connect", self, host, port)
[102] Fix | Delete
self.sock = self._create_socket(timeout)
[103] Fix | Delete
self.file = self.sock.makefile('rb')
[104] Fix | Delete
self._debugging = 0
[105] Fix | Delete
self.welcome = self._getresp()
[106] Fix | Delete
[107] Fix | Delete
def _create_socket(self, timeout):
[108] Fix | Delete
if timeout is not None and not timeout:
[109] Fix | Delete
raise ValueError('Non-blocking socket (timeout=0) is not supported')
[110] Fix | Delete
return socket.create_connection((self.host, self.port), timeout)
[111] Fix | Delete
[112] Fix | Delete
def _putline(self, line):
[113] Fix | Delete
if self._debugging > 1: print('*put*', repr(line))
[114] Fix | Delete
sys.audit("poplib.putline", self, line)
[115] Fix | Delete
self.sock.sendall(line + CRLF)
[116] Fix | Delete
[117] Fix | Delete
[118] Fix | Delete
# Internal: send one command to the server (through _putline())
[119] Fix | Delete
[120] Fix | Delete
def _putcmd(self, line):
[121] Fix | Delete
if self._debugging: print('*cmd*', repr(line))
[122] Fix | Delete
line = bytes(line, self.encoding)
[123] Fix | Delete
self._putline(line)
[124] Fix | Delete
[125] Fix | Delete
[126] Fix | Delete
# Internal: return one line from the server, stripping CRLF.
[127] Fix | Delete
# This is where all the CPU time of this module is consumed.
[128] Fix | Delete
# Raise error_proto('-ERR EOF') if the connection is closed.
[129] Fix | Delete
[130] Fix | Delete
def _getline(self):
[131] Fix | Delete
line = self.file.readline(_MAXLINE + 1)
[132] Fix | Delete
if len(line) > _MAXLINE:
[133] Fix | Delete
raise error_proto('line too long')
[134] Fix | Delete
[135] Fix | Delete
if self._debugging > 1: print('*get*', repr(line))
[136] Fix | Delete
if not line: raise error_proto('-ERR EOF')
[137] Fix | Delete
octets = len(line)
[138] Fix | Delete
# server can send any combination of CR & LF
[139] Fix | Delete
# however, 'readline()' returns lines ending in LF
[140] Fix | Delete
# so only possibilities are ...LF, ...CRLF, CR...LF
[141] Fix | Delete
if line[-2:] == CRLF:
[142] Fix | Delete
return line[:-2], octets
[143] Fix | Delete
if line[:1] == CR:
[144] Fix | Delete
return line[1:-1], octets
[145] Fix | Delete
return line[:-1], octets
[146] Fix | Delete
[147] Fix | Delete
[148] Fix | Delete
# Internal: get a response from the server.
[149] Fix | Delete
# Raise 'error_proto' if the response doesn't start with '+'.
[150] Fix | Delete
[151] Fix | Delete
def _getresp(self):
[152] Fix | Delete
resp, o = self._getline()
[153] Fix | Delete
if self._debugging > 1: print('*resp*', repr(resp))
[154] Fix | Delete
if not resp.startswith(b'+'):
[155] Fix | Delete
raise error_proto(resp)
[156] Fix | Delete
return resp
[157] Fix | Delete
[158] Fix | Delete
[159] Fix | Delete
# Internal: get a response plus following text from the server.
[160] Fix | Delete
[161] Fix | Delete
def _getlongresp(self):
[162] Fix | Delete
resp = self._getresp()
[163] Fix | Delete
list = []; octets = 0
[164] Fix | Delete
line, o = self._getline()
[165] Fix | Delete
while line != b'.':
[166] Fix | Delete
if line.startswith(b'..'):
[167] Fix | Delete
o = o-1
[168] Fix | Delete
line = line[1:]
[169] Fix | Delete
octets = octets + o
[170] Fix | Delete
list.append(line)
[171] Fix | Delete
line, o = self._getline()
[172] Fix | Delete
return resp, list, octets
[173] Fix | Delete
[174] Fix | Delete
[175] Fix | Delete
# Internal: send a command and get the response
[176] Fix | Delete
[177] Fix | Delete
def _shortcmd(self, line):
[178] Fix | Delete
self._putcmd(line)
[179] Fix | Delete
return self._getresp()
[180] Fix | Delete
[181] Fix | Delete
[182] Fix | Delete
# Internal: send a command and get the response plus following text
[183] Fix | Delete
[184] Fix | Delete
def _longcmd(self, line):
[185] Fix | Delete
self._putcmd(line)
[186] Fix | Delete
return self._getlongresp()
[187] Fix | Delete
[188] Fix | Delete
[189] Fix | Delete
# These can be useful:
[190] Fix | Delete
[191] Fix | Delete
def getwelcome(self):
[192] Fix | Delete
return self.welcome
[193] Fix | Delete
[194] Fix | Delete
[195] Fix | Delete
def set_debuglevel(self, level):
[196] Fix | Delete
self._debugging = level
[197] Fix | Delete
[198] Fix | Delete
[199] Fix | Delete
# Here are all the POP commands:
[200] Fix | Delete
[201] Fix | Delete
def user(self, user):
[202] Fix | Delete
"""Send user name, return response
[203] Fix | Delete
[204] Fix | Delete
(should indicate password required).
[205] Fix | Delete
"""
[206] Fix | Delete
return self._shortcmd('USER %s' % user)
[207] Fix | Delete
[208] Fix | Delete
[209] Fix | Delete
def pass_(self, pswd):
[210] Fix | Delete
"""Send password, return response
[211] Fix | Delete
[212] Fix | Delete
(response includes message count, mailbox size).
[213] Fix | Delete
[214] Fix | Delete
NB: mailbox is locked by server from here to 'quit()'
[215] Fix | Delete
"""
[216] Fix | Delete
return self._shortcmd('PASS %s' % pswd)
[217] Fix | Delete
[218] Fix | Delete
[219] Fix | Delete
def stat(self):
[220] Fix | Delete
"""Get mailbox status.
[221] Fix | Delete
[222] Fix | Delete
Result is tuple of 2 ints (message count, mailbox size)
[223] Fix | Delete
"""
[224] Fix | Delete
retval = self._shortcmd('STAT')
[225] Fix | Delete
rets = retval.split()
[226] Fix | Delete
if self._debugging: print('*stat*', repr(rets))
[227] Fix | Delete
numMessages = int(rets[1])
[228] Fix | Delete
sizeMessages = int(rets[2])
[229] Fix | Delete
return (numMessages, sizeMessages)
[230] Fix | Delete
[231] Fix | Delete
[232] Fix | Delete
def list(self, which=None):
[233] Fix | Delete
"""Request listing, return result.
[234] Fix | Delete
[235] Fix | Delete
Result without a message number argument is in form
[236] Fix | Delete
['response', ['mesg_num octets', ...], octets].
[237] Fix | Delete
[238] Fix | Delete
Result when a message number argument is given is a
[239] Fix | Delete
single response: the "scan listing" for that message.
[240] Fix | Delete
"""
[241] Fix | Delete
if which is not None:
[242] Fix | Delete
return self._shortcmd('LIST %s' % which)
[243] Fix | Delete
return self._longcmd('LIST')
[244] Fix | Delete
[245] Fix | Delete
[246] Fix | Delete
def retr(self, which):
[247] Fix | Delete
"""Retrieve whole message number 'which'.
[248] Fix | Delete
[249] Fix | Delete
Result is in form ['response', ['line', ...], octets].
[250] Fix | Delete
"""
[251] Fix | Delete
return self._longcmd('RETR %s' % which)
[252] Fix | Delete
[253] Fix | Delete
[254] Fix | Delete
def dele(self, which):
[255] Fix | Delete
"""Delete message number 'which'.
[256] Fix | Delete
[257] Fix | Delete
Result is 'response'.
[258] Fix | Delete
"""
[259] Fix | Delete
return self._shortcmd('DELE %s' % which)
[260] Fix | Delete
[261] Fix | Delete
[262] Fix | Delete
def noop(self):
[263] Fix | Delete
"""Does nothing.
[264] Fix | Delete
[265] Fix | Delete
One supposes the response indicates the server is alive.
[266] Fix | Delete
"""
[267] Fix | Delete
return self._shortcmd('NOOP')
[268] Fix | Delete
[269] Fix | Delete
[270] Fix | Delete
def rset(self):
[271] Fix | Delete
"""Unmark all messages marked for deletion."""
[272] Fix | Delete
return self._shortcmd('RSET')
[273] Fix | Delete
[274] Fix | Delete
[275] Fix | Delete
def quit(self):
[276] Fix | Delete
"""Signoff: commit changes on server, unlock mailbox, close connection."""
[277] Fix | Delete
resp = self._shortcmd('QUIT')
[278] Fix | Delete
self.close()
[279] Fix | Delete
return resp
[280] Fix | Delete
[281] Fix | Delete
def close(self):
[282] Fix | Delete
"""Close the connection without assuming anything about it."""
[283] Fix | Delete
try:
[284] Fix | Delete
file = self.file
[285] Fix | Delete
self.file = None
[286] Fix | Delete
if file is not None:
[287] Fix | Delete
file.close()
[288] Fix | Delete
finally:
[289] Fix | Delete
sock = self.sock
[290] Fix | Delete
self.sock = None
[291] Fix | Delete
if sock is not None:
[292] Fix | Delete
try:
[293] Fix | Delete
sock.shutdown(socket.SHUT_RDWR)
[294] Fix | Delete
except OSError as exc:
[295] Fix | Delete
# The server might already have closed the connection.
[296] Fix | Delete
# On Windows, this may result in WSAEINVAL (error 10022):
[297] Fix | Delete
# An invalid operation was attempted.
[298] Fix | Delete
if (exc.errno != errno.ENOTCONN
[299] Fix | Delete
and getattr(exc, 'winerror', 0) != 10022):
[300] Fix | Delete
raise
[301] Fix | Delete
finally:
[302] Fix | Delete
sock.close()
[303] Fix | Delete
[304] Fix | Delete
#__del__ = quit
[305] Fix | Delete
[306] Fix | Delete
[307] Fix | Delete
# optional commands:
[308] Fix | Delete
[309] Fix | Delete
def rpop(self, user):
[310] Fix | Delete
"""Not sure what this does."""
[311] Fix | Delete
return self._shortcmd('RPOP %s' % user)
[312] Fix | Delete
[313] Fix | Delete
[314] Fix | Delete
timestamp = re.compile(br'\+OK.[^<]*(<.*>)')
[315] Fix | Delete
[316] Fix | Delete
def apop(self, user, password):
[317] Fix | Delete
"""Authorisation
[318] Fix | Delete
[319] Fix | Delete
- only possible if server has supplied a timestamp in initial greeting.
[320] Fix | Delete
[321] Fix | Delete
Args:
[322] Fix | Delete
user - mailbox user;
[323] Fix | Delete
password - mailbox password.
[324] Fix | Delete
[325] Fix | Delete
NB: mailbox is locked by server from here to 'quit()'
[326] Fix | Delete
"""
[327] Fix | Delete
secret = bytes(password, self.encoding)
[328] Fix | Delete
m = self.timestamp.match(self.welcome)
[329] Fix | Delete
if not m:
[330] Fix | Delete
raise error_proto('-ERR APOP not supported by server')
[331] Fix | Delete
import hashlib
[332] Fix | Delete
digest = m.group(1)+secret
[333] Fix | Delete
digest = hashlib.md5(digest).hexdigest()
[334] Fix | Delete
return self._shortcmd('APOP %s %s' % (user, digest))
[335] Fix | Delete
[336] Fix | Delete
[337] Fix | Delete
def top(self, which, howmuch):
[338] Fix | Delete
"""Retrieve message header of message number 'which'
[339] Fix | Delete
and first 'howmuch' lines of message body.
[340] Fix | Delete
[341] Fix | Delete
Result is in form ['response', ['line', ...], octets].
[342] Fix | Delete
"""
[343] Fix | Delete
return self._longcmd('TOP %s %s' % (which, howmuch))
[344] Fix | Delete
[345] Fix | Delete
[346] Fix | Delete
def uidl(self, which=None):
[347] Fix | Delete
"""Return message digest (unique id) list.
[348] Fix | Delete
[349] Fix | Delete
If 'which', result contains unique id for that message
[350] Fix | Delete
in the form 'response mesgnum uid', otherwise result is
[351] Fix | Delete
the list ['response', ['mesgnum uid', ...], octets]
[352] Fix | Delete
"""
[353] Fix | Delete
if which is not None:
[354] Fix | Delete
return self._shortcmd('UIDL %s' % which)
[355] Fix | Delete
return self._longcmd('UIDL')
[356] Fix | Delete
[357] Fix | Delete
[358] Fix | Delete
def utf8(self):
[359] Fix | Delete
"""Try to enter UTF-8 mode (see RFC 6856). Returns server response.
[360] Fix | Delete
"""
[361] Fix | Delete
return self._shortcmd('UTF8')
[362] Fix | Delete
[363] Fix | Delete
[364] Fix | Delete
def capa(self):
[365] Fix | Delete
"""Return server capabilities (RFC 2449) as a dictionary
[366] Fix | Delete
>>> c=poplib.POP3('localhost')
[367] Fix | Delete
>>> c.capa()
[368] Fix | Delete
{'IMPLEMENTATION': ['Cyrus', 'POP3', 'server', 'v2.2.12'],
[369] Fix | Delete
'TOP': [], 'LOGIN-DELAY': ['0'], 'AUTH-RESP-CODE': [],
[370] Fix | Delete
'EXPIRE': ['NEVER'], 'USER': [], 'STLS': [], 'PIPELINING': [],
[371] Fix | Delete
'UIDL': [], 'RESP-CODES': []}
[372] Fix | Delete
>>>
[373] Fix | Delete
[374] Fix | Delete
Really, according to RFC 2449, the cyrus folks should avoid
[375] Fix | Delete
having the implementation split into multiple arguments...
[376] Fix | Delete
"""
[377] Fix | Delete
def _parsecap(line):
[378] Fix | Delete
lst = line.decode('ascii').split()
[379] Fix | Delete
return lst[0], lst[1:]
[380] Fix | Delete
[381] Fix | Delete
caps = {}
[382] Fix | Delete
try:
[383] Fix | Delete
resp = self._longcmd('CAPA')
[384] Fix | Delete
rawcaps = resp[1]
[385] Fix | Delete
for capline in rawcaps:
[386] Fix | Delete
capnm, capargs = _parsecap(capline)
[387] Fix | Delete
caps[capnm] = capargs
[388] Fix | Delete
except error_proto:
[389] Fix | Delete
raise error_proto('-ERR CAPA not supported by server')
[390] Fix | Delete
return caps
[391] Fix | Delete
[392] Fix | Delete
[393] Fix | Delete
def stls(self, context=None):
[394] Fix | Delete
"""Start a TLS session on the active connection as specified in RFC 2595.
[395] Fix | Delete
[396] Fix | Delete
context - a ssl.SSLContext
[397] Fix | Delete
"""
[398] Fix | Delete
if not HAVE_SSL:
[399] Fix | Delete
raise error_proto('-ERR TLS support missing')
[400] Fix | Delete
if self._tls_established:
[401] Fix | Delete
raise error_proto('-ERR TLS session already established')
[402] Fix | Delete
caps = self.capa()
[403] Fix | Delete
if not 'STLS' in caps:
[404] Fix | Delete
raise error_proto('-ERR STLS not supported by server')
[405] Fix | Delete
if context is None:
[406] Fix | Delete
context = ssl._create_stdlib_context()
[407] Fix | Delete
resp = self._shortcmd('STLS')
[408] Fix | Delete
self.sock = context.wrap_socket(self.sock,
[409] Fix | Delete
server_hostname=self.host)
[410] Fix | Delete
self.file = self.sock.makefile('rb')
[411] Fix | Delete
self._tls_established = True
[412] Fix | Delete
return resp
[413] Fix | Delete
[414] Fix | Delete
[415] Fix | Delete
if HAVE_SSL:
[416] Fix | Delete
[417] Fix | Delete
class POP3_SSL(POP3):
[418] Fix | Delete
"""POP3 client class over SSL connection
[419] Fix | Delete
[420] Fix | Delete
Instantiate with: POP3_SSL(hostname, port=995, keyfile=None, certfile=None,
[421] Fix | Delete
context=None)
[422] Fix | Delete
[423] Fix | Delete
hostname - the hostname of the pop3 over ssl server
[424] Fix | Delete
port - port number
[425] Fix | Delete
keyfile - PEM formatted file that contains your private key
[426] Fix | Delete
certfile - PEM formatted certificate chain file
[427] Fix | Delete
context - a ssl.SSLContext
[428] Fix | Delete
[429] Fix | Delete
See the methods of the parent class POP3 for more documentation.
[430] Fix | Delete
"""
[431] Fix | Delete
[432] Fix | Delete
def __init__(self, host, port=POP3_SSL_PORT, keyfile=None, certfile=None,
[433] Fix | Delete
timeout=socket._GLOBAL_DEFAULT_TIMEOUT, context=None):
[434] Fix | Delete
if context is not None and keyfile is not None:
[435] Fix | Delete
raise ValueError("context and keyfile arguments are mutually "
[436] Fix | Delete
"exclusive")
[437] Fix | Delete
if context is not None and certfile is not None:
[438] Fix | Delete
raise ValueError("context and certfile arguments are mutually "
[439] Fix | Delete
"exclusive")
[440] Fix | Delete
if keyfile is not None or certfile is not None:
[441] Fix | Delete
import warnings
[442] Fix | Delete
warnings.warn("keyfile and certfile are deprecated, use a "
[443] Fix | Delete
"custom context instead", DeprecationWarning, 2)
[444] Fix | Delete
self.keyfile = keyfile
[445] Fix | Delete
self.certfile = certfile
[446] Fix | Delete
if context is None:
[447] Fix | Delete
context = ssl._create_stdlib_context(certfile=certfile,
[448] Fix | Delete
keyfile=keyfile)
[449] Fix | Delete
self.context = context
[450] Fix | Delete
POP3.__init__(self, host, port, timeout)
[451] Fix | Delete
[452] Fix | Delete
def _create_socket(self, timeout):
[453] Fix | Delete
sock = POP3._create_socket(self, timeout)
[454] Fix | Delete
sock = self.context.wrap_socket(sock,
[455] Fix | Delete
server_hostname=self.host)
[456] Fix | Delete
return sock
[457] Fix | Delete
[458] Fix | Delete
def stls(self, keyfile=None, certfile=None, context=None):
[459] Fix | Delete
"""The method unconditionally raises an exception since the
[460] Fix | Delete
STLS command doesn't make any sense on an already established
[461] Fix | Delete
SSL/TLS session.
[462] Fix | Delete
"""
[463] Fix | Delete
raise error_proto('-ERR TLS session already established')
[464] Fix | Delete
[465] Fix | Delete
__all__.append("POP3_SSL")
[466] Fix | Delete
[467] Fix | Delete
if __name__ == "__main__":
[468] Fix | Delete
import sys
[469] Fix | Delete
a = POP3(sys.argv[1])
[470] Fix | Delete
print(a.getwelcome())
[471] Fix | Delete
a.user(sys.argv[2])
[472] Fix | Delete
a.pass_(sys.argv[3])
[473] Fix | Delete
a.list()
[474] Fix | Delete
(numMsgs, totalSize) = a.stat()
[475] Fix | Delete
for i in range(1, numMsgs + 1):
[476] Fix | Delete
(header, msg, octets) = a.retr(i)
[477] Fix | Delete
print("Message %d:" % i)
[478] Fix | Delete
for line in msg:
[479] Fix | Delete
print(' ' + line)
[480] Fix | Delete
print('-----------------------')
[481] Fix | Delete
a.quit()
[482] Fix | Delete
[483] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function