b374k
m1n1 1.01
Apache/2.2.15 (CentOS)
Linux obd60-6c49958d75-2q7cw 5.4.0-174-generic #193-Ubuntu SMP Thu Mar 7 14:29:28 UTC 2024 x86_64
uid=48(apache) gid=48(apache) groups=48(apache)
server ip : 104.21.65.202 | your ip : 10.244.126.0
safemode OFF
 >  / usr / lib64 / python2.6 /
Filename/usr/lib64/python2.6/smtpd.pyo
Size15.81 kb
Permissionrw-r--r--
Ownerapache
Create time23-Dec-2025 17:41
Last modified20-Jun-2019 19:45
Last accessed22-Apr-2026 05:33
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
Ñò
§ÚêLc@sðdZddkZddkZddkZddkZddkZddkZddkZddkZddddgZ ei
dZ dZ d dd
��YZ
e
�ad Zd Zd
Zd d�Zdeifd��YZdeifd��YZdefd��YZdefd��YZdefd��YZdd d��YZd�Zedjo�e�Zeio´yddkZWn-e j
o!ei!dIJei"d�nXei#d�dZ$yeie$�Wq)e%j
o=Z&e&iei'jo�nei!dIJei"d�q)Xnei(Z(de(joCe(i)d�Z*e+e(e* e,�e-�d g�Z.e(e*dZ(n
ddk/Z.e0e.e(�Z1e1ei2ei3fei4ei5f�Z6yei7�Wqìe8j
oqìXndS(!scAn RFC 2821 smtp proxy.

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.

--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.
iÿÿÿÿNt
SMTPServertDebuggingServert PureProxyt MailmanProxyisPython SMTP proxy version 0.2tDevnullcBseZd�Zd�ZRS(cCsdS(N((tselftmsg((s/usr/lib64/python2.6/smtpd.pytwriteYscCsdS(N((R((s/usr/lib64/python2.6/smtpd.pytflushZs(t__name__t
__module__RR(((s/usr/lib64/python2.6/smtpd.pyRXs s
ts, cCs=titt�IJ|oti|IJnti|�dS(N(tsyststderrt__doc__tglobalstexit(tcodeR((s/usr/lib64/python2.6/smtpd.pytusagedst SMTPChannelcBs�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z d�Z
d �Z d
�Z d �Z
d �Zd
�ZRS(iicCstii||�||_||_||_g|_|i|_d|_ d|_ g|_ d|_
ti�|_y|i�|_WnAtij
o2}|i�|idtijo�ndSXtdIt|i�IJ|id|itf�|id�dS(NiR sPeer:s 220 %s %ss
(tasynchatt
async_chatt__init__t_SMTPChannel__servert_SMTPChannel__connt_SMTPChannel__addrt_SMTPChannel__linetCOMMANDt_SMTPChannel__statet_SMTPChannel__greetingtNonet_SMTPChannel__mailfromt_SMTPChannel__rcpttost_SMTPChannel__datatsockettgetfqdnt_SMTPChannel__fqdnt getpeernamet_SMTPChannel__peerterrortclosetargsterrnotENOTCONNt DEBUGSTREAMtreprtpusht __version__tset_terminator(Rtservertconntaddrterr((s/usr/lib64/python2.6/smtpd.pyRps*         
cCstii||d�dS(Ns
(RRR.(RR((s/usr/lib64/python2.6/smtpd.pyR.�scCs|ii|�dS(N(Rtappend(Rtdata((s/usr/lib64/python2.6/smtpd.pytcollect_incoming_data�sc Csti|i�}tdIt|�IJg|_|i|ijo·|p|id�dSd}|i d�}|djo|i
�}d}n%|| i
�}||di �}t |d|d�}|p|id|�dS||�dS|i|i
jo|id�dSg}xQ|id �D]@}|o&|dd
jo|i|d�q6|i|�q6Wti|�|_|ii|i|i|i|i�}g|_d|_|i|_|id �|p|id �n|i|�dS( NsData:s500 Error: bad syntaxt iitsmtp_s'502 Error: command "%s" not implementeds451 Internal confusions
t.s250 Ok(t EMPTYSTRINGtjoinRR,R-RRR.RtfindtuppertstriptgetattrtDATAtsplitR5tNEWLINER!Rtprocess_messageR&RR R0( RtlinetmethodtitcommandtargR6ttexttstatus((s/usr/lib64/python2.6/smtpd.pytfound_terminator�sR 

 


    
cCsU|p|id�dS|io|id�n||_|id|i�dS(Ns501 Syntax: HELO hostnames503 Duplicate HELO/EHLOs250 %s(R.RR$(RRI((s/usr/lib64/python2.6/smtpd.pyt smtp_HELOÃs

 cCs)|o|id�n|id�dS(Ns501 Syntax: NOOPs250 Ok(R.(RRI((s/usr/lib64/python2.6/smtpd.pyt smtp_NOOPÍscCs|id�|i�dS(Ns221 Bye(R.tclose_when_done(RRI((s/usr/lib64/python2.6/smtpd.pyt smtp_QUITÓs
cCs�d}t|�}|| i�|jo_||i�}|pq�|ddjo/|ddjo|djo|dd!}q�n|S(Nit<iÿÿÿÿt>s<>i(RtlenR>R?(RtkeywordRItaddresstkeylen((s/usr/lib64/python2.6/smtpd.pyt __getaddrÙs /cCs�tdI|IJ|o|id|�nd}|p|id�dS|io|id�dS||_tdI|iIJ|id�dS(Ns ===> MAILsFROM:s501 Syntax: MAIL FROM:<address>s503 Error: nested MAIL commandssender:s250 Ok(R,t_SMTPChannel__getaddrRR.R(RRIRU((s/usr/lib64/python2.6/smtpd.pyt smtp_MAILæs 


 cCs�tdI|IJ|ip|id�dS|o|id|�nd}|p|id�dS|ii|�tdI|iIJ|id�dS(Ns ===> RCPTs503 Error: need MAIL commandsTO:s501 Syntax: RCPT TO: <address>srecips:s250 Ok(R,RR.RXRR R5(RRIRU((s/usr/lib64/python2.6/smtpd.pyt smtp_RCPTós

 
cCsQ|o|id�dSd|_g|_d|_|i|_|id�dS(Ns501 Syntax: RSETR s250 Ok(R.RRR R!RR(RRI((s/usr/lib64/python2.6/smtpd.pyt smtp_RSETs
    cCs_|ip|id�dS|o|id�dS|i|_|id�|id�dS(Ns503 Error: need RCPT commands501 Syntax: DATAs
.
s#354 End data with <CR><LF>.<CR><LF>(R R.RARR0(RRI((s/usr/lib64/python2.6/smtpd.pyt smtp_DATA s


 
(R R
RRARR.R7RLRMRNRPRXRYRZR[R\(((s/usr/lib64/python2.6/smtpd.pyRls    1
 


cBs#eZd�Zd�Zd�ZRS(c
Csª||_||_tii|�y>|ititi�|i �|i
|�|i d�Wn|i ��n0Xt
d|iititi��||fIJdS(Nis0%s started at %s
Local addr: %s
Remote addr:%s(t
_localaddrt _remoteaddrtasyncoret
dispatcherRt
create_socketR"tAF_INETt SOCK_STREAMtset_reuse_addrtbindtlistenR(R,t __class__R ttimetctime(Rt localaddrt
remoteaddr((s/usr/lib64/python2.6/smtpd.pyRs  


cCs�y|i�\}}WnJtj
odStij
o(}|idtijo�ndSX|djodStdt |�IJt
|||�}dS(NisIncoming connection from %s( tacceptt TypeErrorR"R'R)R*t ECONNABORTEDRR,R-R(RR2R3R4tchannel((s/usr/lib64/python2.6/smtpd.pyt
handle_accept-s
cCs
t�dS(sIOverride 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.

This function should return None, for a normal `250 Ok' response;
otherwise it returns the desired response string in RFC 821 format.

N(tNotImplementedError(RtpeertmailfromtrcpttosR6((s/usr/lib64/python2.6/smtpd.pyRD@s(R R
RRpRD(((s/usr/lib64/python2.6/smtpd.pyRs  cBseZd�ZRS(cCs_d}|id�}dGHx9|D]1}|o| odG|dGHd}n|GHq!WdGHdS(Nis
s%---------- MESSAGE FOLLOWS ----------sX-Peer:is%------------ END MESSAGE ------------(RB(RRrRsRtR6t inheaderstlinesRE((s/usr/lib64/python2.6/smtpd.pyRD\s

 (R R
RD(((s/usr/lib64/python2.6/smtpd.pyRZscBseZd�Zd�ZRS(c Cs�|id�}d}x$|D]}|pPn|d7}qW|i|d|d�ti|�}|i|||�}tdI|IJdS(Ns
iis
X-Peer: %sswe got some refusals:(RBtinsertRCR<t_deliverR,( RRrRsRtR6RvRGREtrefused((s/usr/lib64/python2.6/smtpd.pyRDksc Csddk}h}yU|i�}|i|id|id�z|i|||�}Wd|i�XWn£|ij
o}tdIJ|i}nzt i
|i fj
oa}tdI|i IJt
|dd�}t
|dd�} x#|D]}
|| f||
<qîWnX|S( Niÿÿÿÿiisgot SMTPRecipientsRefusedtgott smtp_codet
smtp_errortignore(tsmtplibtSMTPtconnectR^tsendmailtquittSMTPRecipientsRefusedR,t
recipientsR"R't
SMTPExceptionRgR@( RRsRtR6R~Rytsteterrcodeterrmsgtr((s/usr/lib64/python2.6/smtpd.pyRxys&  

(R R
RDRx(((s/usr/lib64/python2.6/smtpd.pyRjs cBseZd�ZRS(c
Cs!ddkl}ddkl}ddkl}ddkl}g} x¼|D]´}
|
i�id�d} | id�} t| �d joqMn| d}
t| �d jo| d
}nd }|i |
� p
|d!joqMn| i
|
|
|f�qMWx$| D]\}
}
}|i |
�q Wt dIdi
|�IJ|o)|i|||�}t dI|IJnh}||�}|i|�}|id�p||d<n|id�ptiti��|d<nx9| D]1\}
}
}t dI|
IJ|i|
�}|p#|i|
dd�}|||
<n|d jo|i|dd
�qè|d jo|i|dd
�qè|d
jo|i|dd
�qè|djo|i|dd
�qè|d"jo<|djod|d<n d |d<|i|dd
�qèqèWdS(#Niÿÿÿÿ(tStringIO(tUtils(tMessage(tMailListt@it-iiR tadmintownertrequestR<tleavesforwarding recips:R8swe got refusals:tfromtFromtdatetDatessending message totlockttolistttoadminttoownert torequestt subscribetSubjectt unsubscribe(R R�R�R�sjoinR�(sjoinR�(t cStringIOR�tMailmanR�R�R�tlowerRBRSt list_existsR5tremoveR,R<Rxt getheaderRhRitgettEnqueue(RRrRsRtR6R�R�R�R�t listnamestrcpttlocaltpartstlistnameRHRytmlistsR�Rtmlist((s/usr/lib64/python2.6/smtpd.pyRD�sj

 






(R R
RD(((s/usr/lib64/python2.6/smtpd.pyR�stOptionscBseZdZdZRS(iR(R R
tsetuidt classname(((s/usr/lib64/python2.6/smtpd.pyR°âsc Cs¤y5titidddddddg�\}}Wn%tij
o}td|�nXt�}x¨|D] \}}|djotd
�qm|djotitIJtid
�qm|djo
d
|_ qm|d jo
||_
qm|d!jo
tia qmqmWt |�djod}d}nmt |�djo|d
}d}nFt |�djo|d
}|d}ntddt
i|��|id�}|d
jotdd|�n|| |_yt||d�|_Wn$tj
otdd|�nX|id�}|d
jotdd|�n|| |_yt||d�|_Wn$tj
otdd|�nX|S("NisnVhc:dsclass=tnosetuidtversionthelptdebugs-hs--helpis-Vs --versions-ns
--nosetuids-cs--classs-ds--debugslocalhost:8025s localhost:25iisInvalid arguments: %st:sBad local spec: %ssBad local port: %ssBad remote spec: %ssBad remote port: %s(s-hs--help(s-Vs --version(s-ns
--nosetuid(s-cs--class(s-ds--debug(tgetoptR targvR'RR°R
R/RR±R²R,RSt
COMMASPACER<R=t localhosttintt localportt
ValueErrort
remotehostt
remoteport( toptsR)R�toptionstoptRIt localspect
remotespecRG((s/usr/lib64/python2.6/smtpd.pyt parseargsès^
"  















t__main__s7Cannot import module "pwd"; try running with -n option.itnobodyis3Cannot setuid "nobody"; try running with -n option.R:(((9RR tosR*R¸RhR"R_Rt__all__R¹tprogramR/RR,RCR;RºRRRR`RRRRR°RÆR RÂR±tpwdt ImportErrorR
RtgetpwnamRÈtOSErrorR�tEPERMR²trfindtlastdott
__import__RtlocalstmodRÇR@tclass_R»R½R¿RÀtproxytlooptKeyboardInterrupt(((s/usr/lib64/python2.6/smtpd.pyt<module>$sn%        
  ¬B)O 9
 
 
"