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 : 172.67.192.52 | your ip : 10.244.126.0
safemode OFF
 >  / usr / lib64 / python2.6 /
Filename/usr/lib64/python2.6/mimify.pyc
Size11.93 kb
Permissionrw-r--r--
Ownerapache
Create time23-Dec-2025 17:41
Last modified20-Jun-2019 19:45
Last accessed22-Apr-2026 05:27
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
Ñò
§ÚêLc @sdZdZdZdZddkZddkZeided�dd d
d gZei d ei
�Z ei d
ei
�Z ei dei
ei
B�Zei dei
ei
B�Zei d�Zei dei
�Zei dei
�Zei dei
�Zdd0d��YZdd1d��YZd�Zd�Zdd�Zdd�Zei d�Zei d�Zd�Zei d �Zd!�Zei d"ei
�Zei d#ei
�Z ei d$�Z!d%�Z"d&�Z#ddk$Z$e%d'jp*e&e$i'�djoõe$i'ddjoáddk(Z(d(Z)dZ*e(i(e$i'd)d*�\Z+Z,e&e,�d2joe)GHe$i-d)�nd3e+jd4e+jjpd5e+jo#d6e+joe)GHe$i-d)�nx¨e+D] \Z.Z/e.d+jo
e#Z0qÒe.d-jo
eZ0qÒe.d/joBye1e/�ZWqre2e3fj
oe)GHe$i-d)�qrXqÒe.d.jo
d)Z*qÒqÒWe&e,�djoe$i4e$i5fZ6n?e&e,�d)joe,de$i5fZ6ne,de,d)fZ6e*oe6e*fZ6ne0e6�ndS(7s¾Mimification and unmimification of mail messages.

Decode quoted-printable parts of a mail message or encode using
quoted-printable.

Usage:
mimify(input, output)
unmimify(input, output, decode_base64 = 0)
to encode and decode respectively. Input and output may be the name
of a file or an open file object. Only a readline() method is used
on the input file, only a write() method is used on the output file.
When using file names, the input and output file names may be the
same.

Interactive usage:
mimify.py -e [infile [outfile]]
mimify.py -d [infile [outfile]]
to encode and decode respectively. Infile defaults to standard
input and outfile to standard output.
iÈs
ISO-8859-1s> iÿÿÿÿNs>the mimify module is deprecated; use the email package insteaditmimifytunmimifytmime_encode_headertmime_decode_headers.^content-transfer-encoding:\s*quoted-printables$^content-transfer-encoding:\s*base64s0^content-type:.*multipart/.*boundary="?([^;"
]*)s:^(content-type:.*charset=")(us-ascii|iso-8859-[0-9]+)(".*)s^-*
s=([0-9a-f][0-9a-f])s=\?iso-8859-1\?q\?([^?
]+)\?=s^subject:\s+re: tFilecBs eZdZd�Zd�ZRS(s{A simple fake file object that knows about limited read-ahead and
boundaries. The only supported method is readline().cCs||_||_d|_dS(N(tfiletboundarytNonetpeek(tselfRR((s/usr/lib64/python2.6/mimify.pyt__init__3s  cCs�|idj odS|ii�}|p|S|ioH||idjo||_dS||idjo||_dSn|S(Nts
s--
(RRRtreadlineR(R tline((s/usr/lib64/python2.6/mimify.pyR 8s
   (t__name__t
__module__t__doc__R
R (((s/usr/lib64/python2.6/mimify.pyR/s t
HeaderFilecBseZd�Zd�ZRS(cCs||_d|_dS(N(RRR(R R((s/usr/lib64/python2.6/mimify.pyR
Hs cCsË|idj o|i}d|_n|ii�}|p|Sti|�o|Sxn|ii�|_t|i�djp(|iddjo|iddjo|S||i}d|_qYdS(Nit s (RRRR thetmatchtlen(R R
((s/usr/lib64/python2.6/mimify.pyR Ls 
(
(RRR
R (((s/usr/lib64/python2.6/mimify.pyRGs cCs�d}d}xlti||�}|djoPn||||id�!tt|id�d��}|id�}q|||S(s6Decode a single line of quoted-printable text to 8bit.R iiiN(t mime_codetsearchRtstarttchrtinttgrouptend(R
tnewlinetpostres((s/usr/lib64/python2.6/mimify.pyt mime_decode^s
cCs�d}d}x�ti||�}|djoPn|id�}di|id��}||||id�!t|�}|id�}q|||S(sDecode a header line to 8bit.R iiRt_N( t mime_headRRRtjointsplitRR R(R
RRRR((s/usr/lib64/python2.6/mimify.pyRks
$ic Cswd}d}d}d}|io|id tjo
t}nd}t|�}x|i�} | pdS|o1| t|� |jo| t|�} |}
nd}
t| �} ti| �o
d}qUn|ot i| �o
d}qUn|i
|
| �| ot i| �o
d}nt i| �} | od| i
d�}nti| �oPqUqU|o|p|o
d}nxá|i�} | pdStitd| �} |o1| t|� |jo| t|�} |}
nd}
x�|o�| |djo"|i
|
| �d}d} Pn| |d joL|i
|
| �t||�} t| ||�| i} | pPqqnPqW| o{|otxa| d
d joO| d
} |i�}
|
tt� tjo|
tt�}
n| |
} q®Wt| �} n| o.|o'|
od dk}|i| �} n| o|i
|
| �q�q�dS(
s?Convert a quoted-printable part of a MIME mail message to 8bit.iiR Nis--s\1s--
s
iþÿÿÿs=
iÿÿÿÿ(RRtQUOTERR RRtqpRt base64_retwritetrepltmpRRtretsubR"Rt
unmimify_partRR tbase64t decodestring(tifiletofilet
decode_base64t multiparttquoted_printablet is_base64tis_repltprefixthfileR
tpreftmp_restnifileRR.((s/usr/lib64/python2.6/mimify.pyR-zs�
  
 

 
 
  c Csÿt|�td�jo�t|�}t|�td�joX||joKddk}|ii|�\}}|i||ii|d|��q n|}t|�td�jot|d�}n|}t|d�}t |||�|i
�dS(s>Convert quoted-printable parts of a MIME mail message to 8bit.R iÿÿÿÿNt,tw( ttypetopentostpathR$trenameR#RRR-tflush( tinfiletoutfileR2R0R@tdtfR1R;((s/usr/lib64/python2.6/mimify.pyRÏs & +s[=-ÿ]s[=?-ÿ]cCsr|o
t}nt}d}d}t|�djo1|d djo dtd�i�}d}nxm|i||�}|d joPn||||id�!dt|id��i�}|i d�}qj|||}d}x|t|�djohd }x5||d
jp||dd
jo|d}q
W|d}||| d }||}qîW||S(
sZCode a single line as quoted-printable.
If header is set, quote some extra characters.R iisFrom s=%02xtFiiKiIt=s=
N(
tmime_header_chart mime_charRtordtupperRRRRR(R
theadertregRRRti((s/usr/lib64/python2.6/mimify.pyt mime_encodeäs6
$

 &
s<([ (]|^)([-a-zA-Z0-9_+]*[-ÿ][-a-zA-Z0-9_+-ÿ]*)(?=[ )]|
)c Cs�d}d}xzti||�}|djoPnd||||id�!|id�tt|id�d�f}|id�}q|||S(s.Code a single header line as quoted-printable.R is%s%s%s=?%s?Q?%s?=iiN(t mime_headerRRRRtCHARSETRQR(R
RRR((s/usr/lib64/python2.6/mimify.pyRs
"s^mime-version:s^content-transfer-encoding:s[-ÿ]cCs�d}}}d}d}}} g}
d} g} d}
t|�}xú|i�}|pPn| oti|�o
d}nti|�o
d}nti|�o>d}ti|�o
d}qët i|�o
d}qënt
i|�}|od|i d�}nt i|�o |} Pn|
i
|�qIxR|i�}|pPn|o<||djo |}
Pn||djo |}
Pq¡n|o| i
|�qFn|otxa|ddjoO|d }|i�}|tt� tjo|tt�}n||}qÆWt|�}n| i
|�| p"ti|�od} }qmn|p!t|�tjo
d}q�qFqFx|
D]ÿ}|ot|�}nti|�}|oj| oI|i d �i�d
jo)d |i d�t|i d �f}q8q<d
|i dd �}n|oNti|�o>d}|o|d}q�|o|d}q�|d}n|i|�q�W|p|oO| oG|id�|id�| o|idt�qÿ|id�n|o| o|id�n|i| �x5| D]-}|ot|d�}n|i|�q3W|i|
�|
}x|oü||djoIxF|i�}|pdS|ot|d�}n|i|�q�n||djoHt||�}t||d�|i}|pPn|i|�qznxB|i�}|pdS|ot|d�}n|i|�q7qzWdS(s@Convert an 8bit part of a MIME mail message to quoted-printable.iR is--s--
s
iþÿÿÿs=
isus-asciis%s%s%sis %sus-ascii%ssContent-Transfer-Encoding: sbase64
squoted-printable
s7bit
sMime-Version: 1.0
sContent-Type: text/plain; s
charset="%s"
scharset="us-ascii"
s,Content-Transfer-Encoding: quoted-printable
N(RRR tiso_charRtmvRtcteR&R'R*RRtappendRR%R tMAXLENRtchrsettlowerRSR(RQRt mimify_partR(R0R1tis_mimethas_ctetis_qpR5R3tmust_quote_bodytmust_quote_headert
has_iso_charsRNt
header_endtmessaget message_endR8R
R:Rt
chrset_resR;((s/usr/lib64/python2.6/mimify.pyR[sð  


  

 




  
 cCsÿt|�td�jo�t|�}t|�td�joX||joKddk}|ii|�\}}|i||ii|d|��q n|}t|�td�jot|d�}n|}t|d�}t ||d�|i
�dS(s>Convert 8bit parts of a MIME mail message to quoted-printable.R iÿÿÿÿNR<R=i( R>R?R@RAR$RBR#RRR[RC(RDRER0R@RFRGR1R;((s/usr/lib64/python2.6/mimify.pyR�s & +t__main__s/Usage: mimify [-l len] -[ed] [infile [outfile]]isl:edbs-eR s-ds-bs-l(((iii(s-eR (s-dR (s-bR (s-dR (7RRXRSR%R+twarningstwarntDeprecationWarningt__all__tcompiletIR&R'tSR*RYRRR"R)RRR RR-RRKRJRQRRRRURVRTR[RtsysRRtargvtgetopttusageR2toptstargstexittotatencodeRt
ValueErrort
OverflowErrortstdintstdoutt encode_args(((s/usr/lib64/python2.6/mimify.pyt<module>s�   

 U    �  7