o ?Ogj‰ã@s`dZddlZddlZddlZddlZddlZddlZddlZddlm Z ddl m Z m Z gd¢Z e deddddlZddlZejdZd ZGd d „d ƒZeƒad Zd ZdZd(dd„ZGdd„dejƒZGdd„dejƒZGdd„deƒZGdd„deƒZGdd„deƒZ Gdd„dƒZ!dd„Z"e#d kr.e"ƒZ$e$j%Z%d!e%vr»e% &d!¡Z'e(e%de'…e)ƒe*ƒdgƒZ+e%e'd"d…Z%nddl,Z+e-e+e%ƒZ.e.e$j/e$j0fe$j1e$j2fe$j3e$j4d#Z5e$j6rzddl7Z7Wne8yõe9d$ej:d%e ;d"¡Ynwe7 ye9d'ej:d%e ;d"¡Ynwze ?¡WdSe@y-YdSwdS))a­An 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_specÚget_angle_addr)Ú SMTPChannelÚ SMTPServerÚDebuggingServerÚ PureProxyÚ MailmanProxyz¬The 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@óeZdZdd„Zdd„ZdS)ÚDevnullcCódS©N©©ÚselfÚmsgrrú,/opt/alt/python310/lib64/python3.10/smtpd.pyÚwriteróz Devnull.writecCrrr©rrrrÚflushsrz Devnull.flushN)Ú__name__Ú __module__Ú __qualname__rrrrrrr qs r Ú z, iÚcCs4tttƒtjd|rt|tjdt |¡dS)N©Úfile)ÚprintÚ__doc__ÚglobalsÚsysÚstderrÚexit)ÚcoderrrrÚusage|sr'c@sþeZdZdZdZdZe efdd„¡Ze dd„ƒZ e dd d fd d „Z d d „Z dd„Ze dd„ƒZejdd„ƒZe dd„ƒZejdd„ƒZe dd„ƒZejdd„ƒZe dd„ƒZejdd„ƒZe dd„ƒZejdd„ƒZe 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/„ƒZd1d2„Zd3d4„Zd5d6„Zd7d8„Zd9d:„Zd;d<„Z d=d>„Z!d?d@„Z"dAdB„Z#dCdD„Z$dEdF„Z%dGdH„Z&dIdJ„Z'dKdL„Z(dMdN„Z)dOdP„Z*dQdR„Z+dS)SrréicCs|Srr)ÚxrrrÚˆrzSMTPChannel.cCs*zt|j ¡ƒWSty|jYSwr)ÚmaxÚcommand_size_limitsÚvaluesÚ ValueErrorÚcommand_size_limitrrrrÚmax_command_size_limitŠs   ÿz"SMTPChannel.max_command_size_limitNFc Cs tjj|||d||_||_||_||_||_||_|r#|r#t dƒ‚|r2d|_ d|_ d|_ t |_nd|_ d|_ tdƒ|_ d |_| ¡d|_d |_|j ¡t ¡|_z| ¡|_Wntyy}z| ¡|jtjkrn‚WYd}~dSd}~wwtd t|jƒt d | !d |jt"f¡dS)N©ÚmapúFdecode_data and enable_SMTPUTF8 cannot be set to True at the same timerú Ú.óó ó.ó FzPeer:rz 220 %s %s)#ÚasynchatÚ async_chatÚ__init__Ú smtp_serverÚconnÚaddrÚdata_size_limitÚenable_SMTPUTF8Ú _decode_datar.Ú _emptystringÚ_linesepÚ_dotsepÚNEWLINEÚ_newlineÚordÚ_set_rset_stateÚ seen_greetingÚ extended_smtpr,ÚclearÚsocketZgetfqdnÚfqdnZ getpeernameÚpeerÚOSErrorÚcloseÚerrnoZENOTCONNr ÚreprÚ DEBUGSTREAMÚpushÚ __version__) rZserverr>r?r@r2rAÚ decode_dataÚerrrrrr<‘sD    €úzSMTPChannel.__init__cCs.|j|_d|_g|_d|_d|_| d¡dS)z/Reset state variables to their post-DATA state.NFrr7)ÚCOMMANDÚ smtp_stateÚmailfromÚrcpttosÚrequire_SMTPUTF8Ú num_bytesÚset_terminatorrrrrÚ_set_post_data_state¸s z SMTPChannel._set_post_data_statecCs| ¡d|_g|_dS)z.Reset all state variables except the greeting.rN)r`Ú received_dataÚreceived_linesrrrrrIÁs zSMTPChannel._set_rset_statecCótdtdƒ|jS)NzTAccess to __server attribute on SMTPChannel is deprecated, use 'smtp_server' insteadr ©rÚDeprecationWarningr=rrrrÚ__serverÉóÿzSMTPChannel.__servercCótdtdƒ||_dS)NzRSetting __server attribute on SMTPChannel is deprecated, set 'smtp_server' insteadr rd©rÚvaluerrrrfÎóÿ cCrc)NzUAccess to __line attribute on SMTPChannel is deprecated, use 'received_lines' insteadr ©rrerbrrrrÚ__lineÔrgzSMTPChannel.__linecCrh)NzSSetting __line attribute on SMTPChannel is deprecated, set 'received_lines' insteadr rlrirrrrmÙrkcCrc)NzRAccess to __state attribute on SMTPChannel is deprecated, use 'smtp_state' insteadr ©rrerZrrrrÚ__stateßrgzSMTPChannel.__statecCrh)NzPSetting __state attribute on SMTPChannel is deprecated, set 'smtp_state' insteadr rnrirrrroärkcCrc)NzXAccess to __greeting attribute on SMTPChannel is deprecated, use 'seen_greeting' insteadr ©rrerJrrrrÚ __greetingêrgzSMTPChannel.__greetingcCrh)NzVSetting __greeting attribute on SMTPChannel is deprecated, set 'seen_greeting' insteadr rprirrrrqïrkcCrc)NzSAccess to __mailfrom attribute on SMTPChannel is deprecated, use 'mailfrom' insteadr ©rrer[rrrrÚ __mailfromõrgzSMTPChannel.__mailfromcCrh)NzQSetting __mailfrom attribute on SMTPChannel is deprecated, set 'mailfrom' insteadr rrrirrrrsúrkcCrc)NzQAccess to __rcpttos attribute on SMTPChannel is deprecated, use 'rcpttos' insteadr ©rrer\rrrrÚ __rcpttosrgzSMTPChannel.__rcpttoscCrh)NzOSetting __rcpttos attribute on SMTPChannel is deprecated, set 'rcpttos' insteadr rtrirrrrurkcCrc)NzTAccess to __data attribute on SMTPChannel is deprecated, use 'received_data' insteadr ©rrerarrrrÚ__data rgzSMTPChannel.__datacCrh)NzRSetting __data attribute on SMTPChannel is deprecated, set 'received_data' insteadr rvrirrrrwrkcCrc)NzKAccess to __fqdn attribute on SMTPChannel is deprecated, use 'fqdn' insteadr ©rrerNrrrrÚ__fqdnrgzSMTPChannel.__fqdncCrh)NzISetting __fqdn attribute on SMTPChannel is deprecated, set 'fqdn' insteadr rxrirrrryrkcCrc)NzKAccess to __peer attribute on SMTPChannel is deprecated, use 'peer' insteadr ©rrerOrrrrÚ__peer!rgzSMTPChannel.__peercCrh)NzISetting __peer attribute on SMTPChannel is deprecated, set 'peer' insteadr rzrirrrr{&rkcCrc)NzKAccess to __conn attribute on SMTPChannel is deprecated, use 'conn' insteadr ©rrer>rrrrÚ__conn,rgzSMTPChannel.__conncCrh)NzISetting __conn attribute on SMTPChannel is deprecated, set 'conn' insteadr r|rirrrr}1rkcCrc)NzKAccess to __addr attribute on SMTPChannel is deprecated, use 'addr' insteadr ©rrer?rrrrÚ__addr7rgzSMTPChannel.__addrcCrh)NzISetting __addr attribute on SMTPChannel is deprecated, set 'addr' insteadr r~rirrrr<rkcCs&tj |t|d|jr dndƒ¡dS)Nr4úutf-8Úascii)r:r;rUÚbytesr]rrrrrUCs  ÿzSMTPChannel.pushcCs~d}|j|jkr |j}n |j|jkr|j}|r|j|krdS|r)|jt|ƒ7_|jr7|j  t |dƒ¡dS|j  |¡dS)Nr€) rZrYr0ÚDATAr@r^ÚlenrBrbÚappendÚstr)rÚdataÚlimitrrrÚcollect_incoming_dataHs  z!SMTPChannel.collect_incoming_datac Cs|j |j¡}tdt|ƒtdg|_|j|jkr‚|jd}|_|s)|  d¡dS|j s1t |dƒ}|  d¡}|dkrA|  ¡}d}n|d|…  ¡}||dd… ¡}|jr[|j|n|j}||kri|  d¡dSt|d |dƒ}|s||  d |¡dS||ƒdS|j|jkr’|  d ¡d|_dS|jr¥|j|jkr¥|  d ¡d|_dSg}| |j¡D]} | rÂ| d|jkrÂ| | dd…¡q­| | ¡q­|j |¡|_|j|j|j|jf} i} |j så|j|jd œ} |j j!| i| ¤Ž} | "¡| sû|  d¡dS|  | ¡dS)NzData:rrz500 Error: bad syntaxr€ú r(z500 Error: line too longZsmtp_z&500 Error: command "%s" not recognizedz451 Internal confusionz552 Error: Too much mail data)Ú mail_optionsÚ rcpt_optionsú250 OK)#rCÚjoinrbr rSrTrZrYr^rUrBr†ÚfindÚupperÚstriprKr,r/Úgetattrrƒr@ÚsplitrDrEr…rGrarOr[r\r‹rŒr=Úprocess_messager`) rÚlineZszÚiÚcommandÚargZmax_szÚmethodr‡ÚtextÚargsÚkwargsZstatusrrrÚfound_terminatorXsl     ÿÿ     þzSMTPChannel.found_terminatorcCsH|s | d¡dS|jr| d¡dS| ¡||_| d|j¡dS)Nz501 Syntax: HELO hostnameú503 Duplicate HELO/EHLOz250 %s)rUrJrIrN©rr˜rrrÚ smtp_HELO–s  zSMTPChannel.smtp_HELOcCs²|s | d¡dS|jr| d¡dS| ¡||_d|_| d|j¡|jr9| d|j¡|jdd7<|jsA| d¡|jrR| d ¡|jdd 7<| d ¡dS) Nz501 Syntax: EHLO hostnameržTz250-%sz 250-SIZE %sÚMAILéz 250-8BITMIMEz 250-SMTPUTF8é z250 HELP) rUrJrIrKrNr@r,rBrArŸrrrÚ smtp_EHLO¢s&    zSMTPChannel.smtp_EHLOcCs |r | d¡dS| d¡dS)Nz501 Syntax: NOOPr©rUrŸrrrÚ smtp_NOOP¸szSMTPChannel.smtp_NOOPcCs| d¡| ¡dS)Nz221 Bye)rUZclose_when_donerŸrrrÚ smtp_QUIT¾s  zSMTPChannel.smtp_QUITcCs0t|ƒ}|d|… ¡|kr||d… ¡SdS)Nr)r„rr‘)rÚkeywordr˜ZkeylenrrrÚ_strip_command_keywordÃsz"SMTPChannel._strip_command_keywordcCsF|sdS| ¡ d¡rt|ƒ\}}nt|ƒ\}}|s||fS|j|fS)N)rrú<)ÚlstripÚ startswithrrZ addr_spec)rr˜ÚaddressÚrestrrrÚ_getaddrÉs  zSMTPChannel._getaddrcCsHi}|D]}| d¡\}}}| ¡r|r|sdS|r|nd||<q|S)Nú=T)Ú partitionÚisalnum)rÚparamsÚresultZparamÚeqrjrrrÚ _getparamsÔszSMTPChannel._getparamscCs|r„d}| ¡}|dkr| d¡dS|dkr| d¡dS|dkr2d}|jr+||7}| |¡dS|dkrFd }|jr?||7}| |¡dS|d krQ| d ¡dS|d kr\| d ¡dS|dkrg| d¡dS|dkrr| d¡dS|dkr}| d¡dS| d¡dS| d¡dS)Nú [SP ]ZEHLOz250 Syntax: EHLO hostnameZHELOz250 Syntax: HELO hostnamer¡z 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)rrUrK)rr˜ZextendedZlc_argrrrrÚ smtp_HELPßs:zSMTPChannel.smtp_HELPcCsD|r| |¡\}}|r| d¡dS| d|¡dS| d¡dS)NzB252 Cannot VRFY user, but will accept message and attempt deliveryz502 Could not VRFY %sz501 Syntax: VRFY
)r¯rU)rr˜r­r³rrrÚ smtp_VRFYs zSMTPChannel.smtp_VRFYcCs¼|js | d¡dStd|tdd}|jr|d7}|dur%| |¡dS| d|¡}| |¡\}}|s;| |¡dS|jsG|rG| |¡dS|jrQ| d¡dS| ¡  ¡|_ |  |j ¡}|duri| |¡dS|j s}|  dd ¡}|d vr}| d ¡dS|jr™|  d d ¡}|durŽd|_n |d ur™| d¡dS|  dd¡}|r½| ¡s¬| |¡dS|jr½t|ƒ|jkr½| d¡dSt| ¡ƒdkrÌ| d¡dS||_td|jtd| d¡dS)Nú503 Error: send HELO firstz ===> MAILrz 501 Syntax: MAIL FROM:
r·zFROM:z503 Error: nested MAIL commandZBODYÚ7BIT)r»Z8BITMIMEz1501 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)rJrUr rTrKr©r¯r[rr“r‹r¶rBÚpoprAr]Úisdigitr@Úintr„Úkeys)rr˜Ú syntaxerrr­r³ÚbodyÚsmtputf8ÚsizerrrÚ smtp_MAIL sh                 zSMTPChannel.smtp_MAILcCs|js | d¡dStd|td|js| d¡dSd}|jr$|d7}|dur/| |¡dS| d|¡}| |¡\}}|sE| |¡dS|jsQ|rQ| |¡dS| ¡  ¡|_ |  |j ¡}|duri| |¡dSt |  ¡ƒdkrx| d ¡dS|j |¡td |jtd| d ¡dS) Nrºz ===> RCPTrz503 Error: need MAIL commandz501 Syntax: RCPT TO:
r·zTO:rz8555 RCPT TO parameters not recognized or not implementedzrecips:r)rJrUr rTr[rKr©r¯rr“rŒr¶r„r¿r\r…)rr˜rÀr­r³rrrÚ smtp_RCPTCs@           zSMTPChannel.smtp_RCPTcCs(|r | d¡dS| ¡| d¡dS)Nz501 Syntax: RSETr)rUrIrŸrrrÚ smtp_RSETfs  zSMTPChannel.smtp_RSETcCsZ|js | d¡dS|js| d¡dS|r| d¡dS|j|_| d¡| d¡dS)Nrºz503 Error: need RCPT commandz501 Syntax: DATAs . z#354 End data with .)rJrUr\rƒrZr_rŸrrrÚ smtp_DATAms    zSMTPChannel.smtp_DATAcCs| d¡dS)Nz502 EXPN not implementedr¥rŸrrrÚ smtp_EXPN|szSMTPChannel.smtp_EXPN),rrrrYrƒr/Ú collectionsÚ defaultdictr,Úpropertyr0ÚDATA_SIZE_DEFAULTr<r`rIZ_SMTPChannel__serverÚsetterZ_SMTPChannel__lineZ_SMTPChannel__stateZ_SMTPChannel__greetingZ_SMTPChannel__mailfromZ_SMTPChannel__rcpttosZ_SMTPChannel__dataZ_SMTPChannel__fqdnZ_SMTPChannel__peerZ_SMTPChannel__connZ_SMTPChannel__addrrUr‰rr r¤r¦r§r©r¯r¶r¸r¹rÄrÅrÆrÇrÈrrrrrƒs’  ÿ'                       >   # 6# rc@s2eZdZeZedddfdd„Zdd„Zdd„ZdS) rNFcCsÈ||_||_||_||_||_|r|rtdƒ‚tjj||dz't j |dt j iŽ}|  |dd|dd¡|  ¡| |¡| d¡Wn| ¡‚td|jjt t ¡¡||ftddS) Nr3r1Útyperr(éz0%s started at %s Local addr: %s Remote addr:%sr)Z _localaddrÚ _remoteaddrr@rArBr.ÚasyncoreÚ dispatcherr<rMZ getaddrinfoZ SOCK_STREAMZ create_socketZset_reuse_addrZbindZlistenrQr Ú __class__rÚtimeÚctimerT)rZ localaddrZ remoteaddrr@r2rArWZ gai_resultsrrrr<„s2ÿ þ þzSMTPServer.__init__c Cs6tdt|ƒtd| ||||j|j|j|j¡}dS)NzIncoming connection from %sr)r rSrTÚ channel_classr@Ú_maprArB)rr>r?ZchannelrrrÚhandle_accepted súzSMTPServer.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. )ÚNotImplementedError©rrOr[r\r‡rœrrrr”«szSMTPServer.process_message) rrrrrÖrÌr<rØr”rrrrr€s þ rc@r )rcCsld}| ¡}|D]+}|r&|s&d|d}t|tƒs t| d¡ƒ}t|ƒd}t|tƒs/t|ƒ}t|ƒqdS)Nr(zX-Peer: rr€)Ú splitlinesÚ isinstancer†rSÚencoder )rrOr‡Z inheadersÚlinesr•Z peerheaderrrrÚ_print_message_contentÏs    ôz&DebuggingServer._print_message_contentcKsXtdƒ|r | d¡rtd|dƒ| d¡r td|dƒ| ||¡tdƒdS)Nz%---------- MESSAGE FOLLOWS ----------r‹zmail options: %srŒzrcpt options: %s z%------------ END MESSAGE ------------)r ÚgetrßrÚrrrr”às    zDebuggingServer.process_messageN)rrrrßr”rrrrrÍs rcs,eZdZ‡fdd„Zdd„Zdd„Z‡ZS)rcs2d|vr |dr tdƒ‚tt|ƒj|i|¤ŽdS)NrAz$PureProxy does not support SMTPUTF8.)r.Úsuperrr<©rr›rœ©rÓrrr<ìszPureProxy.__init__c Csf| d¡}d}|D] }|sn|d7}q | |d|d¡t |¡}| |||¡}td|tddS)Nrrr(z X-Peer: %szwe got some refusals:r)r“ÚinsertrFrŽÚ_deliverr rT) rrOr[r\r‡rÞr–r•Úrefusedrrrr”ñs   zPureProxy.process_messagec Csúddl}i}z%| ¡}| |jd|jd¡z| |||¡}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 SMTPRecipientsRefusedrZgotZ smtp_codeéÿÿÿÿZ smtp_errorÚignore)ÚsmtplibZSMTPZconnectrÐZsendmailÚquitZSMTPRecipientsRefusedr rTZ recipientsrPZ SMTPExceptionrÓr’) rr[r\r‡réræÚsÚeZerrcodeÚerrmsgÚrrrrråÿs2  ó  €÷   ÿ€÷zPureProxy._deliver)rrrr<r”råÚ __classcell__rrrãrrës rcs$eZdZ‡fdd„Zdd„Z‡ZS)r cs>tdtdƒd|vr|drtdƒ‚tt|ƒj|i|¤ŽdS)Nz8MailmanProxy is deprecated and will be removed in futurer rAz'MailmanProxy does not support SMTPUTF8.)rrer.rárr<rârãrrr<s ÿzMailmanProxy.__init__cCsddlm}ddlm}ddlm}ddlm}g} |D]:} |  ¡ d¡d} |  d¡} t| ƒdkr3q| d} t| ƒdkrB| d }nd }|  | ¡rM|d vrNq|   | | |f¡q| D] \} } }|  | ¡qYt d d   |¡td|r~| |||¡}t d|tdi}||ƒ}| |¡}| d¡s’||d<| d¡s t t ¡¡|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 |dkrþd|d <nd!|d <|j|d dq¢dS)"Nr)ÚStringIO)ÚUtils)ÚMessage)ÚMailListú@ú-r r(r)rÚadminÚownerÚrequestrŽÚleavezforwarding recips:rŠrzwe got refusals:ÚfromZFromÚdateZDatezsending message to)Úlock)Útoliströ)Ztoadminr÷)Ztoownerrø)Z torequest)rŽrùrŽZ subscribeZSubjectZ unsubscribe)ÚiorðZMailmanrñròróÚlowerr“r„Z list_existsr…Úremover rŽrTråràrÔrÕZEnqueue)rrOr[r\r‡rðrñròróZ listnamesZrcptZlocalÚpartsZlistnamer—ræZmlistsrërZmlistrrrr” sf               €êzMailmanProxy.process_message)rrrr<r”rïrrrãrr s r c@seZdZdZdZdZdZdS)ÚOptionsTrNF)rrrÚsetuidÚ classnameÚ size_limitrArrrrrms rc CsXzt tjdd…dgd¢¡\}}Wntjy*}z td|ƒWYd}~nd}~wwtƒ}|D]\\}}|dvr=tdƒq0|dvrKttƒt d¡q0|dvrSd|_ q0|d vr[||_ q0|d vrctj a q0|d vrkd |_ q0|d vrŒz t|ƒ}||_Wq0td|tj dt d¡Yq0q0t|ƒdkr˜d}d}n&t|ƒdkr¥|d}d}nt|ƒdkr´|d}|d}n tddt |¡ƒ| d¡} | dkrÎtdd|ƒ|d| …|_z t|| dd…ƒ|_Wntyòtdd|ƒYnw| d¡} | dkrtdd|ƒ|d| …|_zt|| dd…ƒ|_W|Sty+tdd|ƒY|Sw)Nr(z nVhc:s:du)zclass=ZnosetuidÚversionÚhelpzsize=Ú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#ÚargvÚerrorr'rr rVr%rrr$rTrAr¾rr„Ú COMMASPACErŽrÚ localhostÚ localportr.Ú remotehostÚ remoteport) Zoptsr›rìÚoptionsÚoptr˜Zint_sizeZ localspecZ remotespecr–rrrÚ parseargsts| þ€ÿ    ú      ÿ  þþrÚ__main__r5r()rAz7Cannot import module "pwd"; try running with -n option.rÚnobodyz3Cannot setuid "nobody"; try running with -n option.)r)Ar!r#ÚosrRr rÔrMrÉÚwarningsrZemail._header_value_parserrrÚ__all__rerÑr:r ZprogramrVr rTrFrrÌr'r;rrÒrrrr rrrrrÚrfindZlastdotÚ __import__r"ÚlocalsÚmodrr’Zclass_rrrrrrAÚproxyrÚpwdÚ ImportErrorr r$r%ÚgetpwnamrÚPermissionErrorZloopÚKeyboardInterruptrrrrÚsŒN û   M-U B    þ  þþÿä