/snap/core22/2437/usr/lib/python3.10/__pycache__
NameSizeModeActions
abc.cpython-310.pyc67510644editdlrm
aifc.cpython-310.pyc246850644editdlrm
antigravity.cpython-310.pyc8220644editdlrm
argparse.cpython-310.pyc635390644editdlrm
ast.cpython-310.pyc557390644editdlrm
asynchat.cpython-310.pyc70250644editdlrm
asyncore.cpython-310.pyc160020644editdlrm
base64.cpython-310.pyc171620644editdlrm
bdb.cpython-310.pyc258320644editdlrm
binhex.cpython-310.pyc128700644editdlrm
bisect.cpython-310.pyc25880644editdlrm
bz2.cpython-310.pyc108700644editdlrm
calendar.cpython-310.pyc263030644editdlrm
cgi.cpython-310.pyc267230644editdlrm
cgitb.cpython-310.pyc99980644editdlrm
chunk.cpython-310.pyc48600644editdlrm
cmd.cpython-310.pyc127070644editdlrm
code.cpython-310.pyc99570644editdlrm
codecs.cpython-310.pyc332190644editdlrm
codeop.cpython-310.pyc55950644editdlrm
colorsys.cpython-310.pyc32650644editdlrm
compileall.cpython-310.pyc127330644editdlrm
configparser.cpython-310.pyc454580644editdlrm
contextlib.cpython-310.pyc208950644editdlrm
contextvars.cpython-310.pyc2460644editdlrm
copy.cpython-310.pyc69960644editdlrm
copyreg.cpython-310.pyc46830644editdlrm
cProfile.cpython-310.pyc51130644editdlrm
crypt.cpython-310.pyc35500644editdlrm
csv.cpython-310.pyc117980644editdlrm
dataclasses.cpython-310.pyc265780644editdlrm
datetime.cpython-310.pyc565330644editdlrm
decimal.cpython-310.pyc3620644editdlrm
difflib.cpython-310.pyc589050644editdlrm
dis.cpython-310.pyc156560644editdlrm
doctest.cpython-310.pyc761750644editdlrm
enum.cpython-310.pyc260630644editdlrm
filecmp.cpython-310.pyc87490644editdlrm
fileinput.cpython-310.pyc140720644editdlrm
fnmatch.cpython-310.pyc42440644editdlrm
fractions.cpython-310.pyc186000644editdlrm
ftplib.cpython-310.pyc289770644editdlrm
functools.cpython-310.pyc283350644editdlrm
genericpath.cpython-310.pyc39070644editdlrm
getopt.cpython-310.pyc63390644editdlrm
getpass.cpython-310.pyc42100644editdlrm
gettext.cpython-310.pyc182210644editdlrm
glob.cpython-310.pyc58520644editdlrm
graphlib.cpython-310.pyc76160644editdlrm
gzip.cpython-310.pyc185460644editdlrm
hashlib.cpython-310.pyc68450644editdlrm
heapq.cpython-310.pyc138650644editdlrm
hmac.cpython-310.pyc69730644editdlrm
imaplib.cpython-310.pyc423120644editdlrm
imghdr.cpython-310.pyc39050644editdlrm
imp.cpython-310.pyc97860644editdlrm
inspect.cpython-310.pyc851530644editdlrm
io.cpython-310.pyc36630644editdlrm
ipaddress.cpython-310.pyc626700644editdlrm
keyword.cpython-310.pyc9270644editdlrm
linecache.cpython-310.pyc41420644editdlrm
locale.cpython-310.pyc461540644editdlrm
lzma.cpython-310.pyc121000644editdlrm
mailbox.cpython-310.pyc600910644editdlrm
mailcap.cpython-310.pyc73200644editdlrm
mimetypes.cpython-310.pyc176190644editdlrm
modulefinder.cpython-310.pyc161660644editdlrm
netrc.cpython-310.pyc39330644editdlrm
nntplib.cpython-310.pyc316230644editdlrm
ntpath.cpython-310.pyc147040644editdlrm
nturl2path.cpython-310.pyc17470644editdlrm
numbers.cpython-310.pyc118660644editdlrm
opcode.cpython-310.pyc54470644editdlrm
operator.cpython-310.pyc135080644editdlrm
optparse.cpython-310.pyc477540644editdlrm
os.cpython-310.pyc315990644editdlrm
pathlib.cpython-310.pyc420520644editdlrm
pdb.cpython-310.pyc474400644editdlrm
pickle.cpython-310.pyc468820644editdlrm
pickletools.cpython-310.pyc677600644editdlrm
pipes.cpython-310.pyc77690644editdlrm
pkgutil.cpython-310.pyc183610644editdlrm
platform.cpython-310.pyc274290644editdlrm
plistlib.cpython-310.pyc237650644editdlrm
poplib.cpython-310.pyc135730644editdlrm
posixpath.cpython-310.pyc105600644editdlrm
pprint.cpython-310.pyc178750644editdlrm
profile.cpython-310.pyc143910644editdlrm
pstats.cpython-310.pyc236210644editdlrm
pty.cpython-310.pyc41430644editdlrm
pyclbr.cpython-310.pyc97750644editdlrm
pydoc.cpython-310.pyc856450644editdlrm
py_compile.cpython-310.pyc73390644editdlrm
queue.cpython-310.pyc107920644editdlrm
quopri.cpython-310.pyc57940644editdlrm
random.cpython-310.pyc227480644editdlrm
re.cpython-310.pyc142270644editdlrm
reprlib.cpython-310.pyc52500644editdlrm
rlcompleter.cpython-310.pyc59540644editdlrm
runpy.cpython-310.pyc94110644editdlrm
sched.cpython-310.pyc61150644editdlrm
secrets.cpython-310.pyc21750644editdlrm
selectors.cpython-310.pyc171050644editdlrm
shelve.cpython-310.pyc94920644editdlrm
shlex.cpython-310.pyc77820644editdlrm
shutil.cpython-310.pyc385360644editdlrm
signal.cpython-310.pyc29350644editdlrm
site.cpython-310.pyc179220644editdlrm
sitecustomize.cpython-310.pyc2250644editdlrm
smtpd.cpython-310.pyc261470644editdlrm
smtplib.cpython-310.pyc357660644editdlrm
sndhdr.cpython-310.pyc69620644editdlrm
socket.cpython-310.pyc289630644editdlrm
socketserver.cpython-310.pyc253470644editdlrm
sre_compile.cpython-310.pyc151940644editdlrm
sre_constants.cpython-310.pyc63570644editdlrm
sre_parse.cpython-310.pyc217550644editdlrm
ssl.cpython-310.pyc452710644editdlrm
stat.cpython-310.pyc42730644editdlrm
statistics.cpython-310.pyc370510644editdlrm
string.cpython-310.pyc71020644editdlrm
stringprep.cpython-310.pyc170750644editdlrm
struct.cpython-310.pyc3070644editdlrm
subprocess.cpython-310.pyc447410644editdlrm
sunau.cpython-310.pyc164820644editdlrm
symtable.cpython-310.pyc128350644editdlrm
sysconfig.cpython-310.pyc181510644editdlrm
tabnanny.cpython-310.pyc69500644editdlrm
tarfile.cpython-310.pyc706740644editdlrm
telnetlib.cpython-310.pyc185060644editdlrm
tempfile.cpython-310.pyc273390644editdlrm
textwrap.cpython-310.pyc138120644editdlrm
this.cpython-310.pyc12640644editdlrm
threading.cpython-310.pyc449690644editdlrm
timeit.cpython-310.pyc117690644editdlrm
token.cpython-310.pyc27380644editdlrm
tokenize.cpython-310.pyc171940644editdlrm
trace.cpython-310.pyc198700644editdlrm
traceback.cpython-310.pyc217120644editdlrm
tracemalloc.cpython-310.pyc175250644editdlrm
tty.cpython-310.pyc10790644editdlrm
turtle.cpython-310.pyc1288570644editdlrm
types.cpython-310.pyc95250644editdlrm
typing.cpython-310.pyc852770644editdlrm
uu.cpython-310.pyc38670644editdlrm
uuid.cpython-310.pyc224980644editdlrm
warnings.cpython-310.pyc136460644editdlrm
wave.cpython-310.pyc175940644editdlrm
weakref.cpython-310.pyc203430644editdlrm
webbrowser.cpython-310.pyc170000644editdlrm
xdrlib.cpython-310.pyc78800644editdlrm
zipapp.cpython-310.pyc60130644editdlrm
zipfile.cpython-310.pyc618450644editdlrm
zipimport.cpython-310.pyc170330644editdlrm
_aix_support.cpython-310.pyc28790644editdlrm
_bootsubprocess.cpython-310.pyc22940644editdlrm
_collections_abc.cpython-310.pyc329250644editdlrm
_compat_pickle.cpython-310.pyc58720644editdlrm
_compression.cpython-310.pyc45120644editdlrm
_distutils_system_mod.cpython-310.pyc54220644editdlrm
_markupbase.cpython-310.pyc75720644editdlrm
_osx_support.cpython-310.pyc115350644editdlrm
_pydecimal.cpython-310.pyc1577360644editdlrm
_pyio.cpython-310.pyc736540644editdlrm
_py_abc.cpython-310.pyc46830644editdlrm
_sitebuiltins.cpython-310.pyc35470644editdlrm
_strptime.cpython-310.pyc159450644editdlrm
_sysconfigdata__linux_x86_64-linux-gnu.cpython-310.pyc353850644editdlrm
_sysconfigdata__x86_64-linux-gnu.cpython-310.pyc353790644editdlrm
_threading_local.cpython-310.pyc65390644editdlrm
_weakrefset.cpython-310.pyc76080644editdlrm
__future__.cpython-310.pyc41310644editdlrm
__phello__.foo.cpython-310.pyc1300644editdlrm
Edit: /snap/core22/2437/usr/lib/python3.10/__pycache__/smtpd.cpython-310.pyc (26147B)
o p̦i]@s`dZddlZddlZddlZddlZddlZddlZddlZddlm Z ddl m Z m Z gdZ e deddddlZddlZejdZd ZGd d d Zead Zd ZdZd(ddZGdddejZGdddejZGdddeZGdddeZGdddeZ GdddZ!ddZ"e#d kr.e"Z$e$j%Z%d!e%vre%&d!Z'e(e%de'e)e*dgZ+e%e'd"dZ%nddl,Z+e-e+e%Z.e.e$j/e$j0fe$j1e$j2fe$j3e$j4d#Z5e$j6rzddl7Z7Wne8ye9d$ej:d%e;d"Ynwe7ye9d'ej:d%e;d"Ynwze?WdSe@y-YdSwdS))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 MailmanProxyzThe smtpd module is deprecated and unmaintained and will be removed in Python 3.12. Please see aiosmtpd (https://aiosmtpd.readthedocs.io/) for the recommended replacement.) stacklevelzPython SMTP proxy version 0.3c@eZdZddZddZdS)DevnullcCdSNselfmsgrr/usr/lib/python3.10/smtpd.pywriterz Devnull.writecCrrrrrrrflushsrz Devnull.flushN)__name__ __module__ __qualname__rrrrrrr qs r  z, icCs4ttttjd|rt|tjdt|dS)Nfile)print__doc__globalssysstderrexit)coderrrrusage|sr'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|Srr)xrrrrzSMTPChannel.cCs*zt|jWSty|jYSwr)maxcommand_size_limitsvalues ValueErrorcommand_size_limitrrrrmax_command_size_limits   z"SMTPChannel.max_command_size_limitNFc Cs tjj|||d||_||_||_||_||_||_|r#|r#t d|r2d|_ d|_ d|_ t |_nd|_ d|_ td|_ d |_|d|_d |_|jt|_z||_Wntyy}z||jtjkrnWYd}~dSd}~wwtd t|jt d |!d |jt"fdS)NmapFdecode_data and enable_SMTPUTF8 cannot be set to True at the same timer . . FzPeer: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,clearsocketgetfqdnfqdn getpeernamepeerOSErrorcloseerrnoENOTCONNr repr DEBUGSTREAMpush __version__) rserverr>r?r@r2rA decode_dataerrrrrr<sD    zSMTPChannel.__init__cCs.|j|_d|_g|_d|_d|_|ddS)z/Reset state variables to their post-DATA state.NFrr7)COMMAND smtp_statemailfromrcpttosrequire_SMTPUTF8 num_bytesset_terminatorrrrr_set_post_data_states z SMTPChannel._set_post_data_statecCs|d|_g|_dS)z.Reset all state variables except the greeting.rN)rd received_datareceived_linesrrrrrIs zSMTPChannel._set_rset_statecCtdtd|jS)NzTAccess to __server attribute on SMTPChannel is deprecated, use 'smtp_server' insteadr rDeprecationWarningr=rrrr__serverzSMTPChannel.__servercCtdtd||_dS)NzRSetting __server attribute on SMTPChannel is deprecated, set 'smtp_server' insteadr rhrvaluerrrrj cCrg)NzUAccess to __line attribute on SMTPChannel is deprecated, use 'received_lines' insteadr rrirfrrrr__linerkzSMTPChannel.__linecCrl)NzSSetting __line attribute on SMTPChannel is deprecated, set 'received_lines' insteadr rprmrrrrqrocCrg)NzRAccess to __state attribute on SMTPChannel is deprecated, use 'smtp_state' insteadr rrir^rrrr__staterkzSMTPChannel.__statecCrl)NzPSetting __state attribute on SMTPChannel is deprecated, set 'smtp_state' insteadr rrrmrrrrsrocCrg)NzXAccess to __greeting attribute on SMTPChannel is deprecated, use 'seen_greeting' insteadr rrirJrrrr __greetingrkzSMTPChannel.__greetingcCrl)NzVSetting __greeting attribute on SMTPChannel is deprecated, set 'seen_greeting' insteadr rtrmrrrrurocCrg)NzSAccess to __mailfrom attribute on SMTPChannel is deprecated, use 'mailfrom' insteadr rrir_rrrr __mailfromrkzSMTPChannel.__mailfromcCrl)NzQSetting __mailfrom attribute on SMTPChannel is deprecated, set 'mailfrom' insteadr rvrmrrrrwrocCrg)NzQAccess to __rcpttos attribute on SMTPChannel is deprecated, use 'rcpttos' insteadr rrir`rrrr __rcpttosrkzSMTPChannel.__rcpttoscCrl)NzOSetting __rcpttos attribute on SMTPChannel is deprecated, set 'rcpttos' insteadr rxrmrrrryrocCrg)NzTAccess to __data attribute on SMTPChannel is deprecated, use 'received_data' insteadr rrirerrrr__data rkzSMTPChannel.__datacCrl)NzRSetting __data attribute on SMTPChannel is deprecated, set 'received_data' insteadr rzrmrrrr{rocCrg)NzKAccess to __fqdn attribute on SMTPChannel is deprecated, use 'fqdn' insteadr rrirOrrrr__fqdnrkzSMTPChannel.__fqdncCrl)NzISetting __fqdn attribute on SMTPChannel is deprecated, set 'fqdn' insteadr r|rmrrrr}rocCrg)NzKAccess to __peer attribute on SMTPChannel is deprecated, use 'peer' insteadr rrirQrrrr__peer!rkzSMTPChannel.__peercCrl)NzISetting __peer attribute on SMTPChannel is deprecated, set 'peer' insteadr r~rmrrrr&rocCrg)NzKAccess to __conn attribute on SMTPChannel is deprecated, use 'conn' insteadr rrir>rrrr__conn,rkzSMTPChannel.__conncCrl)NzISetting __conn attribute on SMTPChannel is deprecated, set 'conn' insteadr rrmrrrr1rocCrg)NzKAccess to __addr attribute on SMTPChannel is deprecated, use 'addr' insteadr rrir?rrrr__addr7rkzSMTPChannel.__addrcCrl)NzISetting __addr attribute on SMTPChannel is deprecated, set 'addr' insteadr rrmrrrr<rocCs&tj|t|d|jr dnddS)Nr4utf-8ascii)r:r;rXbytesrarrrrrXCs  zSMTPChannel.pushcCs~d}|j|jkr |j}n |j|jkr|j}|r|j|krdS|r)|jt|7_|jr7|j t |ddS|j |dS)Nr) r^r]r0DATAr@rblenrBrfappendstr)rdatalimitrrrcollect_incoming_dataHs  z!SMTPChannel.collect_incoming_datac Cs|j|j}tdt|tdg|_|j|jkr|jd}|_|s)| ddS|j s1t |d}| d}|dkrA| }d}n|d| }||dd}|jr[|j|n|j}||kri| ddSt|d |d}|s|| d |dS||dS|j|jkr| d d|_dS|jr|j|jkr| d d|_dSg}||jD]} | r| d|jkr|| ddq|| q|j||_|j|j|j|jf} i} |j s|j|jd } |j j!| i| } |"| s| ddS| | dS)NzData:rrz500 Error: bad syntaxr r(z500 Error: line too longsmtp_z&500 Error: command "%s" not recognizedz451 Internal confusionz552 Error: Too much mail data) mail_options rcpt_options250 OK)#rCjoinrfr rVrWr^r]rbrXrBrfindupperstriprKr,r/getattrrr@splitrDrErrGrerQr_r`rrr=process_messagerd) rlineszicommandargmax_szmethodrtextargskwargsstatusrrrfound_terminatorXsl          zSMTPChannel.found_terminatorcCsH|s |ddS|jr|ddS|||_|d|jdS)Nz501 Syntax: HELO hostname503 Duplicate HELO/EHLOz250 %s)rXrJrIrOrrrrr smtp_HELOs  zSMTPChannel.smtp_HELOcCs|s |ddS|jr|ddS|||_d|_|d|j|jr9|d|j|jdd7<|jsA|d|jrR|d |jdd 7<|d dS) Nz501 Syntax: EHLO hostnamerTz250-%sz 250-SIZE %sMAILz 250-8BITMIMEz 250-SMTPUTF8 z250 HELP) rXrJrIrKrOr@r,rBrArrrr smtp_EHLOs&    zSMTPChannel.smtp_EHLOcCs |r |ddS|ddS)Nz501 Syntax: NOOPrrXrrrr smtp_NOOPszSMTPChannel.smtp_NOOPcCs|d|dS)Nz221 Bye)rXclose_when_donerrrr smtp_QUITs  zSMTPChannel.smtp_QUITcCs0t|}|d||kr||dSdS)Nr)rrr)rkeywordrkeylenrrr_strip_command_keywordsz"SMTPChannel._strip_command_keywordcCsF|sdS|drt|\}}nt|\}}|s||fS|j|fS)N)rr<)lstrip startswithrr addr_spec)rraddressrestrrr_getaddrs  zSMTPChannel._getaddrcCsHi}|D]}|d\}}}|r|r|sdS|r|nd||<q|S)N=T) partitionisalnum)rparamsresultparameqrnrrr _getparamsszSMTPChannel._getparamscCs|rd}|}|dkr|ddS|dkr|ddS|dkr2d}|jr+||7}||dS|dkrFd }|jr?||7}||dS|d krQ|d dS|d kr\|d dS|dkrg|ddS|dkrr|ddS|dkr}|ddS|ddS|ddS)N [SP ]EHLOz250 Syntax: EHLO hostnameHELOz250 Syntax: HELO hostnamerz 250 Syntax: MAIL FROM:
RCPTz250 Syntax: RCPT TO:
rz250 Syntax: DATARSETz250 Syntax: RSETNOOPz250 Syntax: NOOPQUITz250 Syntax: QUITVRFYz250 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)rrXrK)rrextendedlc_argrrrr smtp_HELPs:zSMTPChannel.smtp_HELPcCsD|r||\}}|r|ddS|d|dS|ddS)NzB252 Cannot VRFY user, but will accept message and attempt deliveryz502 Could not VRFY %sz501 Syntax: VRFY
)rrX)rrrrrrr smtp_VRFYs zSMTPChannel.smtp_VRFYcCs|js |ddStd|tdd}|jr|d7}|dur%||dS|d|}||\}}|s;||dS|jsG|rG||dS|jrQ|ddS| |_ | |j }|duri||dS|j s}| dd }|d vr}|d dS|jr| d d }|durd|_n |d ur|ddS| dd}|r|s||dS|jrt||jkr|ddSt|dkr|ddS||_td|jtd|ddS)N503 Error: send HELO firstz ===> MAILrz 501 Syntax: MAIL FROM:
rzFROM:z503 Error: nested MAIL commandBODY7BIT)r8BITMIMEz1501 Error: BODY can only be one of 7BIT, 8BITMIMESMTPUTF8FTz&501 Error: SMTPUTF8 takes no argumentsSIZEz:552 Error: message size exceeds fixed maximum message sizerz:555 MAIL FROM parameters not recognized or not implementedzsender:r)rJrXr rWrKrrr_rrrrrBpoprAraisdigitr@intrkeys)rr syntaxerrrrbodysmtputf8sizerrr smtp_MAIL sh                 zSMTPChannel.smtp_MAILcCs|js |ddStd|td|js|ddSd}|jr$|d7}|dur/||dS|d|}||\}}|sE||dS|jsQ|rQ||dS| |_ | |j }|duri||dSt | dkrx|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)rJrXr rWr_rKrrrrrrrrr`r)rrrrrrrr smtp_RCPTCs@           zSMTPChannel.smtp_RCPTcCs(|r |ddS||ddS)Nz501 Syntax: RSETr)rXrIrrrr smtp_RSETfs  zSMTPChannel.smtp_RSETcCsZ|js |ddS|js|ddS|r|ddS|j|_|d|ddS)Nrz503 Error: need RCPT commandz501 Syntax: DATAs . z#354 End data with .)rJrXr`rr^rcrrrr smtp_DATAms    zSMTPChannel.smtp_DATAcCs|ddS)Nz502 EXPN not implementedrrrrr smtp_EXPN|szSMTPChannel.smtp_EXPN),rrrr]rr/ collections defaultdictr,propertyr0DATA_SIZE_DEFAULTr<rdrI_SMTPChannel__serversetter_SMTPChannel__line_SMTPChannel__state_SMTPChannel__greeting_SMTPChannel__mailfrom_SMTPChannel__rcpttos_SMTPChannel__data_SMTPChannel__fqdn_SMTPChannel__peer_SMTPChannel__conn_SMTPChannel__addrrXrrrrrrrrrrrrrrrrrrrrrs  '                       >   # 6# rc@s2eZdZeZedddfddZddZddZdS) rNFcCs||_||_||_||_||_|r|rtdtjj||dz't j |dt j i}| |dd|dd| |||dWn|td|jjtt||ftddS) Nr3r1typerr(z0%s started at %s Local addr: %s Remote addr:%sr) _localaddr _remoteaddrr@rArBr.asyncore dispatcherr<rM getaddrinfo SOCK_STREAM create_socketset_reuse_addrbindlistenrSr __class__rtimectimerW)r localaddr remoteaddrr@r2rAr[ gai_resultsrrrr<s2  zSMTPServer.__init__c Cs6tdt|td|||||j|j|j|j}dS)NzIncoming connection from %sr)r rVrW channel_classr@_maprArB)rr>r?channelrrrhandle_acceptedszSMTPServer.handle_acceptedcKst)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. )NotImplementedErrorrrQr_r`rrrrrrszSMTPServer.process_message) rrrrrrr<rrrrrrrs  rc@r )rcCsld}|}|D]+}|r&|s&d|d}t|ts t|d}t|d}t|ts/t|}t|qdS)Nr(zX-Peer: rr) splitlines isinstancerrVencoder )rrQr inheaderslinesr peerheaderrrr_print_message_contents    z&DebuggingServer._print_message_contentcKsXtd|r |drtd|d|dr td|d|||tddS)Nz%---------- MESSAGE FOLLOWS ----------rzmail options: %srzrcpt options: %s z%------------ END MESSAGE ------------)r getrr rrrrs    zDebuggingServer.process_messageN)rrrrrrrrrrs rcs,eZdZfddZddZddZZS)rcs2d|vr |dr tdtt|j|i|dS)NrAz$PureProxy does not support SMTPUTF8.)r.superrr<rrrrrrr<szPureProxy.__init__c Csf|d}d}|D] }|sn|d7}q ||d|dt|}||||}td|tddS)Nrrr(z X-Peer: %szwe got some refusals:r)rinsertrFr_deliverr rW) rrQr_r`rrrrrefusedrrrrs   zPureProxy.process_messagec Csddl}i}z%|}||jd|jdz||||}W|W|S|w|jyH}ztdtd|j }WYd}~|Sd}~wt |j fy|}z&td|j tdt |dd}t |dd } |D]} || f|| <qhWYd}~|Sd}~ww) Nrr(zgot SMTPRecipientsRefusedrgot smtp_code smtp_errorignore)smtplibSMTPconnectrsendmailquitSMTPRecipientsRefusedr rW recipientsrR SMTPExceptionrr) rr_r`rrrseerrcodeerrmsgrrrrrs2       zPureProxy._deliver)rrrr<rr __classcell__rrrrrs rcs$eZdZfddZddZZS)r cs>tdtdd|vr|drtdtt|j|i|dS)Nz8MailmanProxy is deprecated and will be removed in futurer rAz'MailmanProxy does not support SMTPUTF8.)rrir.rrr<rrrrr<s zMailmanProxy.__init__cCsddlm}ddlm}ddlm}ddlm}g} |D]:} | dd} | d} t| dkr3q| d} t| dkrB| d }nd }| | rM|d vrNq| | | |fq| D] \} } }| | qYt d d |td|r~||||}t d|tdi}||}||}|ds||d<|dstt|d<| D]g\} } }t d| td|| }|s|j| dd}||| <|d kr|j|d dq|dkr|j|d dq|dkr|j|d dq|dkr|j|d dq|dvr |dkrd|d <nd!|d <|j|d dqdS)"Nr)StringIO)Utils)Message)MailList@-r r(r)radminownerrequestrleavezforwarding recips:rrzwe got refusals:fromFromdateDatezsending message to)lock)tolistr1)toadminr2)toownerr3) torequest)rr4r subscribeSubject unsubscribe)ior+Mailmanr,r-r.lowerrr list_existsrremover rrWrrrrEnqueue)rrQr_r`rr+r,r-r. listnamesrcptlocalpartslistnamerrmlistsr%rmlistrrrr sf               zMailmanProxy.process_message)rrrr<rr*rrrrr s r c@seZdZdZdZdZdZdS)OptionsTrNF)rrrsetuid classname size_limitrArrrrrNms rNc CsXzttjdddgd\}}Wntjy*}z td|WYd}~nd}~wwt}|D]\\}}|dvr=tdq0|dvrKtttdq0|dvrSd|_ q0|d vr[||_ q0|d vrctj a q0|d vrkd |_ q0|d vrz t|}||_Wq0td|tj dtdYq0q0t|dkrd}d}n&t|dkr|d}d}nt|dkr|d}|d}n tddt||d} | dkrtdd||d| |_z t|| dd|_Wntytdd|Ynw|d} | dkrtdd||d| |_zt|| dd|_W|Sty+tdd|Y|Sw)Nr(z nVhc:s:du)zclass=nosetuidversionhelpzsize=debugr)z-hz--helpr)z-Vz --version)z-nz --nosetuidF)z-cz--class)z-dz--debug)z-uz --smtputf8T)z-sz--sizezInvalid size: rzlocalhost:8025z localhost:25r zInvalid arguments: %s:zBad local spec: %szBad local port: %szBad remote spec: %szBad remote port: %s)getoptr#argverrorr'rNr rYr%rOrPr$rWrArrQr COMMASPACErr localhost localportr. remotehost remoteport) optsrr&optionsoptrint_size localspec remotespecrrrr parseargsts|             rf__main__r5r()rAz7Cannot import module "pwd"; try running with -n option.rnobodyz3Cannot setuid "nobody"; try running with -n option.)r)Ar!r#osrTrXrrMrwarningsremail._header_value_parserrr__all__rirr:rYprogramrYr rWrFr[rr'r;rrrrrr rNrfrrarPrfindlastdot __import__r"localsmodrgrclass_r\r]r^r_rQrAproxyrOpwd ImportErrorr r$r%getpwnamrhPermissionErrorloopKeyboardInterruptrrrrsN    M-U B