a
´i&^ ã @ sä g d ¢Z ddlZddlZddlZddlZddlmZ ddlmZ e j
Z
dZdZdZ
dZd Zd
ZdZe
dƒZe
d
ƒZe dejejB ¡Ze d¡Ze d¡ZejjZdd„ Zddd„ZG dd„ dƒZG dd„ dƒZG dd„ de ƒZ!dS ))ÚHeaderÚ
decode_headerÚmake_headeré N)ÚHeaderParseError)ÚcharsetÚ
ú ó z Ú éN z úus-asciizutf-8ai
=\? # literal =?
(?P[^?]*?) # non-greedy up to the next ? is the charset
\? # literal ?
(?P[qQbB]) # either a "q" or a "b", case insensitive
\? # literal ?
(?P.*?) # non-greedy up to the next ?= is the encoded string
\?= # literal ?=
z[\041-\176]+:$z
\n[^ \t]+:c C s– t | dƒrdd„ | jD ƒS t | ¡s.| d fgS g }| ¡ D ]€}t |¡}d}|r:| d¡}|rj| ¡ }d}|r~| |d d f¡ |rL| d¡ ¡ }| d¡ ¡ }| d¡}| |||f¡ qLq:g } t
|ƒD ]J\}
}|
dkrÈ|d rÈ||
d d rÈ||
d d ¡ rÈ| |
d ¡ qÈt| ƒD ]}||= qg }
|D ]È\}}}|d u rV|
||f¡ n¢|d kr|t
j |¡}|
||f¡ n||d
krìt|ƒd }|r¬|dd d| … 7 }zt
j |¡}W n tjyÚ td
ƒ‚Y n0 |
||f¡ ntd| ƒ‚q2g }d }}|
D ]v\}}t|tƒr*t|dƒ}|d u r>|}|}nB||kr`| ||f¡ |}|}n |d u rx|t| 7 }n||7 }q| ||f¡ |S )NÚ_chunksc S s( g | ] \}}t |t|ƒ¡t|ƒf‘qS © )Ú_charsetZ_encodeÚstr)Ú.0Ústringr r r ú$/usr/lib64/python3.9/email/header.pyÚ
M s ÿz!decode_header..Tr Fé é ÚqÚbé z===zBase64 decoding errorzUnexpected encoding: zraw-unicode-escape)Úhasattrr
ÚecreÚsearchÚ
splitlinesÚsplitÚpopÚlstripÚappendÚlowerÚ enumerateÚisspaceÚreversedÚemailÚ
quoprimimeZ
header_decodeÚlenZ
base64mimeÚdecodeÚbinasciiÚErrorr ÚAssertionErrorÚ
isinstancer ÚbytesÚBSPACE)ÚheaderÚwordsÚlineÚpartsÚfirstZ unencodedr ÚencodingÚencodedZdroplistÚnÚwÚdZ
decoded_wordsZencoded_stringZwordZpaderrZ collapsedZ last_wordÚlast_charsetr r r r = s|
ÿ
4
r c C sF t |||d}| D ].\}}|d ur4t|tƒs4t|ƒ}| ||¡ q|S )N)Ú
maxlinelenÚheader_nameÚcontinuation_ws)r r- ÚCharsetr! )Zdecoded_seqr; r<