/snap/core20/2769/usr/lib/python3.8/__pycache__
NameSizeModeActions
abc.cpython-38.pyc53340644editdlrm
aifc.cpython-38.pyc254740644editdlrm
antigravity.cpython-38.pyc7970644editdlrm
argparse.cpython-38.pyc625910644editdlrm
ast.cpython-38.pyc167630644editdlrm
asynchat.cpython-38.pyc68510644editdlrm
asyncore.cpython-38.pyc160280644editdlrm
base64.cpython-38.pyc170710644editdlrm
bdb.cpython-38.pyc249210644editdlrm
binhex.cpython-38.pyc121340644editdlrm
bisect.cpython-38.pyc23540644editdlrm
bz2.cpython-38.pyc114450644editdlrm
calendar.cpython-38.pyc270640644editdlrm
cgi.cpython-38.pyc265440644editdlrm
cgitb.cpython-38.pyc101500644editdlrm
chunk.cpython-38.pyc48390644editdlrm
cmd.cpython-38.pyc126260644editdlrm
code.cpython-38.pyc99130644editdlrm
codecs.cpython-38.pyc339560644editdlrm
codeop.cpython-38.pyc64170644editdlrm
colorsys.cpython-38.pyc32400644editdlrm
compileall.cpython-38.pyc94100644editdlrm
configparser.cpython-38.pyc457180644editdlrm
contextlib.cpython-38.pyc202290644editdlrm
contextvars.cpython-38.pyc2430644editdlrm
copy.cpython-38.pyc69870644editdlrm
copyreg.cpython-38.pyc43180644editdlrm
cProfile.cpython-38.pyc54800644editdlrm
crypt.cpython-38.pyc33870644editdlrm
csv.cpython-38.pyc119100644editdlrm
dataclasses.cpython-38.pyc236530644editdlrm
datetime.cpython-38.pyc571730644editdlrm
decimal.cpython-38.pyc3590644editdlrm
difflib.cpython-38.pyc594380644editdlrm
dis.cpython-38.pyc158080644editdlrm
doctest.cpython-38.pyc759740644editdlrm
dummy_threading.cpython-38.pyc11100644editdlrm
enum.cpython-38.pyc259620644editdlrm
filecmp.cpython-38.pyc84270644editdlrm
fileinput.cpython-38.pyc133730644editdlrm
fnmatch.cpython-38.pyc33550644editdlrm
formatter.cpython-38.pyc175450644editdlrm
fractions.cpython-38.pyc187390644editdlrm
ftplib.cpython-38.pyc280070644editdlrm
functools.cpython-38.pyc279010644editdlrm
genericpath.cpython-38.pyc40010644editdlrm
getopt.cpython-38.pyc62710644editdlrm
getpass.cpython-38.pyc41780644editdlrm
gettext.cpython-38.pyc180000644editdlrm
glob.cpython-38.pyc43430644editdlrm
gzip.cpython-38.pyc181840644editdlrm
hashlib.cpython-38.pyc67270644editdlrm
heapq.cpython-38.pyc140700644editdlrm
hmac.cpython-38.pyc63880644editdlrm
imaplib.cpython-38.pyc414640644editdlrm
imghdr.cpython-38.pyc41180644editdlrm
imp.cpython-38.pyc98090644editdlrm
inspect.cpython-38.pyc805930644editdlrm
io.cpython-38.pyc34540644editdlrm
ipaddress.cpython-38.pyc628290644editdlrm
keyword.cpython-38.pyc9980644editdlrm
linecache.cpython-38.pyc38670644editdlrm
locale.cpython-38.pyc346740644editdlrm
lzma.cpython-38.pyc120180644editdlrm
mailbox.cpython-38.pyc602640644editdlrm
mailcap.cpython-38.pyc72060644editdlrm
mimetypes.cpython-38.pyc160310644editdlrm
modulefinder.cpython-38.pyc161150644editdlrm
netrc.cpython-38.pyc37770644editdlrm
nntplib.cpython-38.pyc339740644editdlrm
ntpath.cpython-38.pyc140910644editdlrm
nturl2path.cpython-38.pyc17440644editdlrm
numbers.cpython-38.pyc122020644editdlrm
opcode.cpython-38.pyc54200644editdlrm
operator.cpython-38.pyc136910644editdlrm
optparse.cpython-38.pyc480570644editdlrm
os.cpython-38.pyc313970644editdlrm
pathlib.cpython-38.pyc442090644editdlrm
pdb.cpython-38.pyc472260644editdlrm
pickle.cpython-38.pyc469080644editdlrm
pickletools.cpython-38.pyc672040644editdlrm
pipes.cpython-38.pyc77950644editdlrm
pkgutil.cpython-38.pyc163090644editdlrm
platform.cpython-38.pyc243260644editdlrm
plistlib.cpython-38.pyc273740644editdlrm
poplib.cpython-38.pyc135560644editdlrm
posixpath.cpython-38.pyc104610644editdlrm
pprint.cpython-38.pyc162810644editdlrm
profile.cpython-38.pyc147580644editdlrm
pstats.cpython-38.pyc220660644editdlrm
pty.cpython-38.pyc39550644editdlrm
pyclbr.cpython-38.pyc104510644editdlrm
pydoc.cpython-38.pyc836460644editdlrm
py_compile.cpython-38.pyc73520644editdlrm
queue.cpython-38.pyc106260644editdlrm
quopri.cpython-38.pyc57480644editdlrm
random.cpython-38.pyc201080644editdlrm
re.cpython-38.pyc144220644editdlrm
reprlib.cpython-38.pyc53030644editdlrm
rlcompleter.cpython-38.pyc57550644editdlrm
runpy.cpython-38.pyc81810644editdlrm
sched.cpython-38.pyc65320644editdlrm
secrets.cpython-38.pyc21900644editdlrm
selectors.cpython-38.pyc169350644editdlrm
shelve.cpython-38.pyc94900644editdlrm
shlex.cpython-38.pyc75360644editdlrm
shutil.cpython-38.pyc372190644editdlrm
signal.cpython-38.pyc28430644editdlrm
site.cpython-38.pyc171680644editdlrm
sitecustomize.cpython-38.pyc2200644editdlrm
smtpd.cpython-38.pyc264630644editdlrm
smtplib.cpython-38.pyc355320644editdlrm
sndhdr.cpython-38.pyc69890644editdlrm
socket.cpython-38.pyc277870644editdlrm
socketserver.cpython-38.pyc253610644editdlrm
sre_compile.cpython-38.pyc151420644editdlrm
sre_constants.cpython-38.pyc63590644editdlrm
sre_parse.cpython-38.pyc216470644editdlrm
ssl.cpython-38.pyc450370644editdlrm
stat.cpython-38.pyc43720644editdlrm
statistics.cpython-38.pyc336530644editdlrm
string.cpython-38.pyc73000644editdlrm
stringprep.cpython-38.pyc110170644editdlrm
struct.cpython-38.pyc3300644editdlrm
subprocess.cpython-38.pyc419670644editdlrm
sunau.cpython-38.pyc170800644editdlrm
symbol.cpython-38.pyc24040644editdlrm
symtable.cpython-38.pyc113220644editdlrm
sysconfig.cpython-38.pyc158370644editdlrm
tabnanny.cpython-38.pyc70300644editdlrm
tarfile.cpython-38.pyc630430644editdlrm
telnetlib.cpython-38.pyc182370644editdlrm
tempfile.cpython-38.pyc266530644editdlrm
textwrap.cpython-38.pyc135190644editdlrm
this.cpython-38.pyc12610644editdlrm
threading.cpython-38.pyc399760644editdlrm
timeit.cpython-38.pyc117770644editdlrm
token.cpython-38.pyc24850644editdlrm
tokenize.cpython-38.pyc171600644editdlrm
trace.cpython-38.pyc200260644editdlrm
traceback.cpython-38.pyc199380644editdlrm
tracemalloc.cpython-38.pyc173630644editdlrm
tty.cpython-38.pyc10760644editdlrm
turtle.cpython-38.pyc1300220644editdlrm
types.cpython-38.pyc91770644editdlrm
typing.cpython-38.pyc624200644editdlrm
uu.cpython-38.pyc36050644editdlrm
uuid.cpython-38.pyc236830644editdlrm
warnings.cpython-38.pyc136520644editdlrm
wave.cpython-38.pyc181490644editdlrm
weakref.cpython-38.pyc195180644editdlrm
webbrowser.cpython-38.pyc171200644editdlrm
xdrlib.cpython-38.pyc82210644editdlrm
zipapp.cpython-38.pyc58540644editdlrm
zipfile.cpython-38.pyc593360644editdlrm
zipimport.cpython-38.pyc172750644editdlrm
_bootlocale.cpython-38.pyc12430644editdlrm
_collections_abc.cpython-38.pyc287410644editdlrm
_compat_pickle.cpython-38.pyc55010644editdlrm
_compression.cpython-38.pyc41460644editdlrm
_dummy_thread.cpython-38.pyc60370644editdlrm
_markupbase.cpython-38.pyc77900644editdlrm
_osx_support.cpython-38.pyc115930644editdlrm
_pydecimal.cpython-38.pyc1607350644editdlrm
_pyio.cpython-38.pyc740790644editdlrm
_py_abc.cpython-38.pyc46700644editdlrm
_sitebuiltins.cpython-38.pyc34810644editdlrm
_strptime.cpython-38.pyc160440644editdlrm
_sysconfigdata__linux_x86_64-linux-gnu.cpython-38.pyc211210644editdlrm
_sysconfigdata__x86_64-linux-gnu.cpython-38.pyc211150644editdlrm
_threading_local.cpython-38.pyc64460644editdlrm
_weakrefset.cpython-38.pyc76000644editdlrm
__future__.cpython-38.pyc41580644editdlrm
__phello__.foo.cpython-38.pyc1270644editdlrm
Edit: /snap/core20/2769/usr/lib/python3.8/__pycache__/smtpd.cpython-38.pyc (26463B)
U yi@s^dZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl m Z ddl m Z mZddddd gZejdZd ZGd d d Zead ZdZdZd%ddZGdddejZGdddejZGdddeZGdddeZGdd d eZGdddZ ddZ!e"dkrZe!Z#e#j$Z$de$krpe$%dZ&e'e$de&e(e)dgZ*e$e&ddZ$nddl+Z*e,e*e$Z-e-e#j.e#j/fe#j0e#j1fe#j2e#j3dZ4e#j5r6z ddl6Z6Wn.e7k re8d ej9d!e:dYnXe6;d"d#ZWne?k rXYnXdS)&aAn RFC 5321 smtp proxy with optional RFC 1870 and RFC 6531 extensions. Usage: %(program)s [options] [localhost:localport [remotehost:remoteport]] Options: --nosetuid -n This program generally tries to setuid `nobody', unless this flag is set. The setuid call will fail if this program is not run as root (in which case, use this flag). --version -V Print the version number and exit. --class classname -c classname Use `classname' as the concrete SMTP proxy class. Uses `PureProxy' by default. --size limit -s limit Restrict the total size of the incoming message to "limit" number of bytes via the RFC 1870 SIZE extension. Defaults to 33554432 bytes. --smtputf8 -u Enable the SMTPUTF8 extension and behave as an RFC 6531 smtp proxy. --debug -d Turn on debugging prints. --help -h Print this message and exit. Version: %(__version__)s If localhost is not given then `localhost' is used, and if localport is not given then 8025 is used. If remotehost is not given then `localhost' is used, and if remoteport is not given, then 25 is used. N)warn) get_addr_specget_angle_addr SMTPChannel SMTPServerDebuggingServer PureProxy MailmanProxyzPython SMTP proxy version 0.3c@seZdZddZddZdS)DevnullcCsdSNselfmsgr r /usr/lib/python3.8/smtpd.pywritefz Devnull.writecCsdSr r rr r rflushgrz Devnull.flushN)__name__ __module__ __qualname__rrr r r rr esr  z, icCs4ttttjd|r&t|tjdt|dS)Nfile)print__doc__globalssysstderrexit)coderr r rusagepsr#c@seZdZdZdZdZeefddZe ddZ e dd d fd d Z d d Z ddZe ddZejddZe ddZejddZe ddZejddZe ddZejddZe ddZejddZe dd Zejd!d Ze d"d#Zejd$d#Ze d%d&Zejd'd&Ze d(d)Zejd*d)Ze d+d,Zejd-d,Ze d.d/Zejd0d/Zd1d2Zd3d4Zd5d6Zd7d8Zd9d:Zd;d<Z d=d>Z!d?d@Z"dAdBZ#dCdDZ$dEdFZ%dGdHZ&dIdJZ'dKdLZ(dMdNZ)dOdPZ*dQdRZ+dS)SrricCs|Sr r )xr r r|rzSMTPChannel.cCs0zt|jWStk r*|jYSXdSr )maxcommand_size_limitsvalues ValueErrorcommand_size_limitrr r rmax_command_size_limit~sz"SMTPChannel.max_command_size_limitNFc Cs&tjj|||d||_||_||_||_||_||_|rF|rFt d|rdd|_ d|_ d|_ t |_nd|_ d|_ td|_ d |_|d|_d |_|jt|_z||_WnBtk r}z$||jd tjkrWYdSd}~XYnXtd t |jt!d |"d|jt#fdS)NmapFdecode_data and enable_SMTPUTF8 cannot be set to True at the same timer .r . FrzPeer:rz 220 %s %s)$asynchat async_chat__init__ smtp_serverconnaddrdata_size_limitenable_SMTPUTF8 _decode_datar* _emptystring_linesep_dotsepNEWLINE_newlineord_set_rset_state seen_greeting extended_smtpr(clearsocketZgetfqdnfqdnZ getpeernamepeerOSErrorcloseargserrnoZENOTCONNrrepr DEBUGSTREAMpush __version__) rZserverr9r:r;r.r< decode_dataerrr r rr7s@   zSMTPChannel.__init__cCs.|j|_d|_g|_d|_d|_|ddS)z/Reset state variables to their post-DATA state.NFrr2)COMMAND smtp_statemailfromrcpttosrequire_SMTPUTF8 num_bytesset_terminatorrr r r_set_post_data_states z SMTPChannel._set_post_data_statecCs|d|_g|_dS)z.Reset all state variables except the greeting.rN)r\ received_datareceived_linesrr r rrDszSMTPChannel._set_rset_statecCstdtd|jS)NzTAccess to __server attribute on SMTPChannel is deprecated, use 'smtp_server' insteadrDeprecationWarningr8rr r r__servers zSMTPChannel.__servercCstdtd||_dS)NzRSetting __server attribute on SMTPChannel is deprecated, set 'smtp_server' insteadr_r`rvaluer r rrbs cCstdtd|jS)NzUAccess to __line attribute on SMTPChannel is deprecated, use 'received_lines' insteadr_rrar^rr r r__lines zSMTPChannel.__linecCstdtd||_dS)NzSSetting __line attribute on SMTPChannel is deprecated, set 'received_lines' insteadr_rercr r rrfs cCstdtd|jS)NzRAccess to __state attribute on SMTPChannel is deprecated, use 'smtp_state' insteadr_rrarVrr r r__states zSMTPChannel.__statecCstdtd||_dS)NzPSetting __state attribute on SMTPChannel is deprecated, set 'smtp_state' insteadr_rgrcr r rrhs cCstdtd|jS)NzXAccess to __greeting attribute on SMTPChannel is deprecated, use 'seen_greeting' insteadr_rrarErr r r __greetings zSMTPChannel.__greetingcCstdtd||_dS)NzVSetting __greeting attribute on SMTPChannel is deprecated, set 'seen_greeting' insteadr_rircr r rrjs cCstdtd|jS)NzSAccess to __mailfrom attribute on SMTPChannel is deprecated, use 'mailfrom' insteadr_rrarWrr r r __mailfroms zSMTPChannel.__mailfromcCstdtd||_dS)NzQSetting __mailfrom attribute on SMTPChannel is deprecated, set 'mailfrom' insteadr_rkrcr r rrls cCstdtd|jS)NzQAccess to __rcpttos attribute on SMTPChannel is deprecated, use 'rcpttos' insteadr_rrarXrr r r __rcpttoss zSMTPChannel.__rcpttoscCstdtd||_dS)NzOSetting __rcpttos attribute on SMTPChannel is deprecated, set 'rcpttos' insteadr_rmrcr r rrns cCstdtd|jS)NzTAccess to __data attribute on SMTPChannel is deprecated, use 'received_data' insteadr_rrar]rr r r__datas zSMTPChannel.__datacCstdtd||_dS)NzRSetting __data attribute on SMTPChannel is deprecated, set 'received_data' insteadr_rorcr r rrps cCstdtd|jS)NzKAccess to __fqdn attribute on SMTPChannel is deprecated, use 'fqdn' insteadr_rrarIrr r r__fqdn s zSMTPChannel.__fqdncCstdtd||_dS)NzISetting __fqdn attribute on SMTPChannel is deprecated, set 'fqdn' insteadr_rqrcr r rrrs cCstdtd|jS)NzKAccess to __peer attribute on SMTPChannel is deprecated, use 'peer' insteadr_rrarJrr r r__peers zSMTPChannel.__peercCstdtd||_dS)NzISetting __peer attribute on SMTPChannel is deprecated, set 'peer' insteadr_rsrcr r rrts cCstdtd|jS)NzKAccess to __conn attribute on SMTPChannel is deprecated, use 'conn' insteadr_rrar9rr r r__conn s zSMTPChannel.__conncCstdtd||_dS)NzISetting __conn attribute on SMTPChannel is deprecated, set 'conn' insteadr_rurcr r rrv%s cCstdtd|jS)NzKAccess to __addr attribute on SMTPChannel is deprecated, use 'addr' insteadr_rrar:rr r r__addr+s zSMTPChannel.__addrcCstdtd||_dS)NzISetting __addr attribute on SMTPChannel is deprecated, set 'addr' insteadr_rwrcr r rrx0s cCs&tj|t|d|jrdnddS)Nr0utf-8ascii)r5r6rQbytesrYr r r rrQ7s  zSMTPChannel.pushcCs|d}|j|jkr|j}n|j|jkr*|j}|r<|j|krjoinr^rrOrPrVrUrZrQr=rfindupperstriprFr(r+getattrr|r;splitr?r@r~rBr]rJrWrXrrr8process_messager\) rlineZszicommandargZmax_szmethodrtextrMkwargsZstatusr r rfound_terminatorLsl        zSMTPChannel.found_terminatorcCsH|s|ddS|jr&|ddS|||_|d|jdS)Nz501 Syntax: HELO hostname503 Duplicate HELO/EHLOz250 %s)rQrErDrIrrr r r smtp_HELOs  zSMTPChannel.smtp_HELOcCs|s|ddS|jr&|ddS|||_d|_|d|j|jrr|d|j|jdd7<|js|d|jr|d |jdd 7<|d dS) Nz501 Syntax: EHLO hostnamerTz250-%sz 250-SIZE %sMAILz 250-8BITMIMEz 250-SMTPUTF8 z250 HELP) rQrErDrFrIr;r(r=r<rr r r smtp_EHLOs&    zSMTPChannel.smtp_EHLOcCs|r|dn |ddS)Nz501 Syntax: NOOPrrQrr r r smtp_NOOPs zSMTPChannel.smtp_NOOPcCs|d|dS)Nz221 Bye)rQZclose_when_donerr r r smtp_QUITs zSMTPChannel.smtp_QUITcCs0t|}|d||kr,||dSdS)Nr)r}rr)rkeywordrZkeylenr r r_strip_command_keywordsz"SMTPChannel._strip_command_keywordcCsF|sdS|dr$t|\}}n t|\}}|s<||fS|j|fS)N)rr<)lstrip startswithrrZ addr_spec)rraddressrestr r r_getaddrs zSMTPChannel._getaddrcCsHi}|D]:}|d\}}}|r,|r2|s2dS|r:|nd||<q|S)N=T) partitionisalnum)rparamsresultZparameqrdr r r _getparamsszSMTPChannel._getparamscCs|rd}|}|dkr$|dq|dkr8|dq|dkr^d}|jrR||7}||q|dkrd }|jrx||7}||q|d kr|d q|d kr|d q|dkr|dq|dkr|dq|dkr|dq|dn |ddS)N [SP ]ZEHLOz250 Syntax: EHLO hostnameZHELOz250 Syntax: HELO hostnamerz 250 Syntax: MAIL FROM:
ZRCPTz250 Syntax: RCPT TO:
r|z250 Syntax: DATAZRSETz250 Syntax: RSETZNOOPz250 Syntax: NOOPZQUITz250 Syntax: QUITZVRFYz250 Syntax: VRFY
zD501 Supported commands: EHLO HELO MAIL RCPT DATA RSET NOOP QUIT VRFYzD250 Supported commands: EHLO HELO MAIL RCPT DATA RSET NOOP QUIT VRFY)rrQrF)rrZextendedZlc_argrr r r smtp_HELPs:          zSMTPChannel.smtp_HELPcCs@|r2||\}}|r"|dq<|d|n |ddS)NzB252 Cannot VRFY user, but will accept message and attempt deliveryz502 Could not VRFY %sz501 Syntax: VRFY
)rrQ)rrrrr r r smtp_VRFYs  zSMTPChannel.smtp_VRFYcCs|js|ddStd|tdd}|jr4|d7}|dkrJ||dS|d|}||\}}|sv||dS|js|r||dS|jr|ddS| |_ | |j }|dkr||dS|j s| dd }|d kr|d dS|jr8| d d }|dkr d|_n|d k r8|ddS| dd}|r|sb||dS|jrt||jkr|ddSt|dkr|ddS||_td|jtd|ddS)N503 Error: send HELO firstz ===> MAILrz 501 Syntax: MAIL FROM:
rzFROM:z503 Error: nested MAIL commandZBODY7BIT)rZ8BITMIMEz1501 Error: BODY can only be one of 7BIT, 8BITMIMEZSMTPUTF8FTz&501 Error: SMTPUTF8 takes no argumentsZSIZEz:552 Error: message size exceeds fixed maximum message sizerz:555 MAIL FROM parameters not recognized or not implementedzsender:r)rErQrrPrFrrrWrrrrr=popr<rYisdigitr;intr}keys)rr syntaxerrrrZbodysmtputf8sizer r r smtp_MAILsh                    zSMTPChannel.smtp_MAILcCs|js|ddStd|td|js6|ddSd}|jrH|d7}|dkr^||dS|d|}||\}}|s||dS|js|r||dS| |_ | |j }|dkr||dSt | dkr|d dS|j|td |jtd|d dS) Nrz ===> RCPTrz503 Error: need MAIL commandz501 Syntax: RCPT TO:
rzTO:rz8555 RCPT TO parameters not recognized or not implementedzrecips:r)rErQrrPrWrFrrrrrrr}rrXr~)rrrrrr r r smtp_RCPT7s@           zSMTPChannel.smtp_RCPTcCs(|r|ddS||ddS)Nz501 Syntax: RSETr)rQrDrr r r smtp_RSETZs  zSMTPChannel.smtp_RSETcCsZ|js|ddS|js(|ddS|r:|ddS|j|_|d|ddS)Nrz503 Error: need RCPT commandz501 Syntax: DATAs . z#354 End data with .)rErQrXr|rVr[rr r r smtp_DATAas    zSMTPChannel.smtp_DATAcCs|ddS)Nz502 EXPN not implementedrrr r r smtp_EXPNpszSMTPChannel.smtp_EXPN),rrrrUr|r+ collections defaultdictr(propertyr,DATA_SIZE_DEFAULTr7r\rDZ_SMTPChannel__serversetterZ_SMTPChannel__lineZ_SMTPChannel__stateZ_SMTPChannel__greetingZ_SMTPChannel__mailfromZ_SMTPChannel__rcpttosZ_SMTPChannel__dataZ_SMTPChannel__fqdnZ_SMTPChannel__peerZ_SMTPChannel__connZ_SMTPChannel__addrrQrrrrrrrrrrrrrrrrr r r rrws  '                       >   # 6#c@s2eZdZeZedddfddZddZddZdS) rNFcCs||_||_||_||_||_|r.|r.tdtjj||dzNt j |dt j i}| |dd|dd| |||dWn|Yn(Xtd|jjtt||ftddS) Nr/r-typerr$z0%s started at %s Local addr: %s Remote addr:%sr)Z _localaddr _remoteaddrr;r<r=r*asyncore dispatcherr7rHZ getaddrinfoZ SOCK_STREAMZ create_socketZset_reuse_addrZbindZlistenrLr __class__rtimectimerP)rZ localaddrZ remoteaddrr;r.r<rSZ gai_resultsr r rr7xs6  zSMTPServer.__init__c Cs6tdt|td|||||j|j|j|j}dS)NzIncoming connection from %sr)rrOrP channel_classr;_mapr<r=)rr9r:Zchannelr r rhandle_acceptedszSMTPServer.handle_acceptedcKstdS)aOverride this abstract method to handle messages from the client. peer is a tuple containing (ipaddr, port) of the client that made the socket connection to our smtp port. mailfrom is the raw address the client claims the message is coming from. rcpttos is a list of raw addresses the client wishes to deliver the message to. data is a string containing the entire full text of the message, headers (if supplied) and all. It has been `de-transparencied' according to RFC 821, Section 4.5.2. In other words, a line containing a `.' followed by other text has had the leading dot removed. kwargs is a dictionary containing additional information. It is empty if decode_data=True was given as init parameter, otherwise it will contain the following keys: 'mail_options': list of parameters to the mail command. All elements are uppercase strings. Example: ['BODY=8BITMIME', 'SMTPUTF8']. 'rcpt_options': same, for the rcpt command. This function should return None for a normal `250 Ok' response; otherwise, it should return the desired response string in RFC 821 format. N)NotImplementedErrorrrJrWrXrrr r rrszSMTPServer.process_message) rrrrrrr7rrr r r rrts  c@seZdZddZddZdS)rcCsld}|}|D]V}|rL|sLd|d}t|ts@t|d}t|d}t|ts^t|}t|qdS)Nr$zX-Peer: rry) splitlines isinstancerrOencoder)rrJrZ inheaderslinesrZ peerheaderr r r_print_message_contents   z&DebuggingServer._print_message_contentcKsXtd|r@|dr&td|d|dr@td|d|||tddS)Nz%---------- MESSAGE FOLLOWS ----------rzmail options: %srzrcpt options: %s z%------------ END MESSAGE ------------)rgetrrr r rrs   zDebuggingServer.process_messageN)rrrrrr r r rrscs,eZdZfddZddZddZZS)rcs.d|kr|drtdtt|j||dS)Nr<z$PureProxy does not support SMTPUTF8.r*superrr7rrMrrr rr7szPureProxy.__init__c Csf|d}d}|D]}|sq(|d7}q||d|dt|}||||}td|tddS)Nrrr$z X-Peer: %szwe got some refusals:r)rinsertrAr_deliverrrP) rrJrWrXrrrrrefusedr r rrs   zPureProxy.process_messagec Csddl}i}zB|}||jd|jdz||||}W5|XWn|jk r}ztdtd|j }W5d}~XYnft |j fk r}zBtd|j tdt |dd}t |dd } |D]} || f|| <qW5d}~XYnX|S) Nrr$zgot SMTPRecipientsRefusedrZgotZ smtp_codeZ smtp_errorignore)smtplibZSMTPZconnectrZquitZsendmailZSMTPRecipientsRefusedrrPZ recipientsrKZ SMTPExceptionrr) rrWrXrrrseZerrcodeerrmsgrr r rrs$    zPureProxy._deliver)rrrr7rr __classcell__r r rrrs cs$eZdZfddZddZZS)r cs.d|kr|drtdtt|j||dS)Nr<z'MailmanProxy does not support SMTPUTF8.rrrr rr7 szMailmanProxy.__init__cCs*ddlm}ddlm}ddlm}ddlm}g} |D]t} | dd} | d} t| dkrfq8| d} t| dkr| d }nd }| | r8|d krq8| | | |fq8| D]\} } }| | qt d d |td|r||||}t d|tdi}||}||}|ds&||d<|dsDtt|d<| D]\} } }t d| td|| }|s|j| dd}||| <|d kr|j|d dn|dkr|j|d dnh|dkr|j|d dnN|dkr|j|d dn4|dkrH|dkr d|d <nd!|d <|j|d dqHdS)"Nr)StringIO)Utils)Message)MailList@-r_r$r)radminownerrequestrleavezforwarding recips:rrzwe got refusals:fromZFromdateZDatezsending message to)lock)tolistr)Ztoadminr)Ztoownerr)Z torequest)rrrZ subscribeZSubjectZ unsubscribe)iorZMailmanrrrlowerrr}Z list_existsr~removerrrPrrrrZEnqueue)rrJrWrXrrrrrZ listnamesZrcptZlocalpartsZlistnamerrZmlistsrrZmlistr r rrsb                    zMailmanProxy.process_message)rrrr7rrr r rrr s c@seZdZdZdZdZdZdS)OptionsTrNF)rrrsetuid classname size_limitr<r r r rr_src Cspz.ttjdddddddddd g\}}Wn.tjk r\}ztd|W5d}~XYnXt}|D]\}}|d krtd qh|d krtttd qh|d krd|_ qh|dkr||_ qh|dkrtj a qh|dkrd|_ qh|dkrhzt|}||_Wqhtd|tj dtdYqhXqht|dkrsN   M-SB