PAL.C.T MINI SHELL
��
��Pc@sSdZddkZddkZddkZddkZddklZddklZddkl Z ddkl
Z
ddklZddk
lZdd klZddkZdd
klZddklZddklZd
ZyeefWnej
odZdZnXddd��YZd�Zd�Zd�Zd�Z dS(s�Local SMTP direct drop-off.
This module delivers messages via SMTP to a locally specified daemon. This
should be compatible with any modern SMTP server. It is expected that the MTA
handles all final delivery. We have to play tricks so that the list object
isn't locked while delivery occurs synchronously.
Note: This file only handles single threaded delivery. See SMTPThreaded.py
for a threaded implementation.
i����N(tUnicodeType(tmm_cfg(tUtils(tErrors(tDecorate(tsyslog(tMsgSafeDict(t
formataddr(tHeader(tCharsett.iit
ConnectioncBs,eZd�Zd�Zd�Zd�ZRS(cCs
d|_dS(N(tNonet_Connection__conn(tself((sd/builddir/build/BUILDROOT/mailman-2.1.12-18.el6.i386//usr/lib/mailman/Mailman/Handlers/SMTPDirect.pyt__init__;scCs8ti�|_|iititi�ti|_dS(N( tsmtplibtSMTPR
tconnectRtSMTPHOSTtSMTPPORTt SMTP_MAX_SESSIONS_PER_CONNECTIONt_Connection__numsessions(R((sd/builddir/build/BUILDROOT/mailman-2.1.12-18.el6.i386//usr/lib/mailman/Mailman/Handlers/SMTPDirect.pyt __connect>scCs�|idjo|i�ny|ii|||�}Wn#tij
o|i��nX|id8_|idjo|i�n|S(Nii(R
Rt_Connection__connecttsendmailRt
SMTPExceptiontquitR(Rt envsendertrecipstmsgtexttresults((sd/builddir/build/BUILDROOT/mailman-2.1.12-18.el6.i386//usr/lib/mailman/Mailman/Handlers/SMTPDirect.pyRCs
cCsL|idjodSy|ii�Wntij
onXd|_dS(N(R
RRRR(R((sd/builddir/build/BUILDROOT/mailman-2.1.12-18.el6.i386//usr/lib/mailman/Mailman/Handlers/SMTPDirect.pyRVs(t__name__t
__module__RRRR(((sd/builddir/build/BUILDROOT/mailman-2.1.12-18.el6.i386//usr/lib/mailman/Mailman/Handlers/SMTPDirect.pyR:s cCs>|id�}|pdS|id�}|djo-|o|i�}qdtidd�}nd}|id�p|doR|id�p
|io8g}|D]}||gq�~}d|d<t}n0ti djo
|g}nt
|ti �}|id �o|d }n|djo;|id
�p!ti|||�t
|d
<nt}nh} ti�}
|d}|id|i��}t�}
z}||d <xe|o]|i�}||d<y|||||| |
�Wq�tj
o|i|��q�Xq�W|d =Wd|
i�||d<Xti�}t|h||
d6t|i��d
6t|�d6t| �d6|i�d6|d6�}tio(titidtidd|�n| o6tio(titidtidd|�q[nG|id�o6tio(titidtidd|�q[ng}g}x�| i�D]�\}\}}|djo|djo|i|�n|i|�ti oJ|i!h|d6|d6|d6�titi dti dd|�qtqtW|p|ot"i#||��ndS(NRRtextratbouncestpersonalizetverpiitundeliveredt decoratedtoriginal_senderttimetsizes#recipss#refusedtlistnametsendertkwsttolisti�i(t recipienttfailcodetfailmsg($tgetRtGetBouncesEmailRtget_site_emailthas_keyR$tverpdeliverRtSMTP_MAX_RCPTStchunkifyRtprocesstTruetbulkdeliverR)t
get_senderRtpopt ExceptiontappendRRtlent as_stringt
internal_nametSMTP_LOG_EVERY_MESSAGERtwrite_extSMTP_LOG_REFUSEDtSMTP_LOG_SUCCESStitemstSMTP_LOG_EACH_FAILUREtupdateRtSomeRecipientsFailed(tmlisttmsgtmsgdataRRtdeliveryfunct_[1]treciptchunkstrefusedtt0t
origrecipst
origsendertconntchunktt1tdttempfailurestpermfailurestcodetsmtpmsg((sd/builddir/build/BUILDROOT/mailman-2.1.12-18.el6.i386//usr/lib/mailman/Mailman/Handlers/SMTPDirect.pyR9as�
$
cCsYhdd6dd6dd6dd6dd6dd 6}h}x}|D]u}d}|id
�}|djo||d}n|i|d�}|i|g�}|i|�|||<q=Wg} g}
d}x�|i�D]|}xO|D]G}|
i|�|d}||jo| i|
�g}
d}q�q�W|
o| i|
�g}
d}q�q�W| S(NitcomitnettorgitedutustcaR
i(RtrfindR2R?tvalues(Rt chunksizetchunkmaptbucketstrttldtitbintbucketRQtcurrentchunktchunklen((sd/builddir/build/BUILDROOT/mailman-2.1.12-18.el6.i386//usr/lib/mailman/Mailman/Handlers/SMTPDirect.pyR8�sF
cCs-x&|dD]}|g|d<ti|�}ti|||�|id�o�ti|�\}} ti|�\}
}|djotdd|�qnh|d6|
d6t i
|�d6}dti|t i
| �f}n|i
d jo�|d
=d}
|i|�o|i|�}
n|
o�ti|i|��}|djo
d}nt|�}|ipd
}t|
t�pt|
|d�}
nt|
|�i�}
t|
|f�|d<q�||d<n|d=|idh�i|�od|d<nt||||||�qWdS(NRR%tsmtps*Skipping VERP delivery to unqual recip: %sR#tmailboxthosts%s@%sittosus-asciis
iso-8859-1tasciitreplacetTosx-mailman-copysadd-dup-headertyessX-Mailman-Copy(tcopytdeepcopyRR9R2Rt
ParseEmailRRtDOTtjoinRtVERP_FORMATR$tisMembert
getMemberNamet
GetCharSettgetMemberLanguageR tinput_codect
isinstanceRtunicodeRtencodeRR5R;(RKRLRMRtfailuresRVRPtmsgcopytbmailboxtbdomaintrmailboxtrdomainRYtnametcharsettcodec((sd/builddir/build/BUILDROOT/mailman-2.1.12-18.el6.i386//usr/lib/mailman/Mailman/Handlers/SMTPDirect.pyR6sH
$
c
Cs�|d=|d=||d<||d<|idt�}h}|d}|d} y|i|||�}Wntij
o%}
tdd |
| �|
i}n�tij
op}
tdd
|
i|
i | �|
idjp|
idjo+x(|D]}|
i|
i f||<q�Wqnet
itti
fj
oI}
tdd
|
| �t|
�}x#|D]}d|f||<q`WnX|i|�dS(NR,s errors-totSenders Errors-Totmangle_from_Rs
message-idssmtp-failures%All recipients refused: %s, msgid: %ss'SMTP session failure: %s, %s, msgid: %si�i(s#Low level smtp error: %s, msgid: %si����(RAtFalseRRtSMTPRecipientsRefusedRt
recipientstSMTPResponseExceptiont smtp_codet
smtp_errortsocketterrortIOErrorRtstrRI(
RKRLRMRR�RVRRRRtmsgidteRiR�((sd/builddir/build/BUILDROOT/mailman-2.1.12-18.el6.i386//usr/lib/mailman/Mailman/Handlers/SMTPDirect.pyR;]s8
"((!t__doc__RxR)R�RttypesRtMailmanRRRtMailman.HandlersRtMailman.Logging.SyslogRtMailman.SafeDictRtemailtemail.UtilsRtemail.HeaderRt
email.CharsetR R{R:R�t NameErrorRR9R8R6R;(((sd/builddir/build/BUILDROOT/mailman-2.1.12-18.el6.i386//usr/lib/mailman/Mailman/Handlers/SMTPDirect.pyt<module>s4' � + F
�
y���~�or�5�J�={��E��e�u磝Qk��ᯘG{�?���+�]������ן�?w�M3X^��歌>{�7پ�K�>�o��n�\����j�y��R���g/�=��f�O��r�o��NV�v��~�Y+��NG�u���Ý����HW��y�w�[eQ�ʨ�S�b��>������>�}G�mx[o[<��{���Ϯ_��qF���vMIEND�B`�