%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/mailman/Mailman/Handlers/
Upload File :
Create Path :
Current File : //lib/mailman/Mailman/Handlers/SMTPDirect.pyo

�
��ac@sQdZddlZddlZddlZddlZddlmZddlmZddlm	Z	ddlm
Z
ddlmZddl
mZdd	lmZddlZdd
lmZddlmZddlmZd
ZyeefWnek
rdZdZnXddd��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((si/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Handlers/SMTPDirect.pyt__init__;scCs8tj�|_|jjtjtj�tj|_dS(N(	tsmtplibtSMTPR
tconnectRtSMTPHOSTtSMTPPORTt SMTP_MAX_SESSIONS_PER_CONNECTIONt_Connection__numsessions(R((si/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Handlers/SMTPDirect.pyt	__connect>scCs�|jdkr|j�ny|jj|||�}Wn!tjk
r[|j��nX|jd8_|jdkr�|j�n|S(Nii(R
Rt_Connection__connecttsendmailRt
SMTPExceptiontquitR(Rt	envsendertrecipstmsgtexttresults((si/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Handlers/SMTPDirect.pyRCs


cCsH|jdkrdSy|jj�Wntjk
r:nXd|_dS(N(R
RRRR(R((si/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Handlers/SMTPDirect.pyRVs(t__name__t
__module__RRRR(((si/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Handlers/SMTPDirect.pyR:s			c
Cs
|jd�}|sdS|jd�}|dkr^|rI|j�}q^tjdd�}nd}|jd�s~|dr�|jd�s�|jr�g|D]}|g^q�}d|d<t}n-tj	dkr�|g}nt
|tj	�}|jd	�r|d	}n|dkrR|jd
�sItj|||�t
|d
<nt}ni}tj�}	|d}
|jd|j��}t�}zy||d	<xa|r�|j�}
|
|d<y|||||||�Wq�tk
r�|j|
��q�Xq�W|d	=Wd|j�|
|d<Xtj�}t|i||	d6t|j��d
6t|�d6t|�d6|j�d6|d6�}tjr�tjtjdtjdd|�n|r�tjr2tjtjdtjdd|�q2nB|jd�r2tjr2tjtjdtjdd|�q2ng}g}x�|j�D]�\}\}}|dkr�|dkr�|j|�n
|j|�tj rK|j!i|d6|d6|d6�tjtj dtj dd|�qKqKW|s�|r	t"j#||��ndS(NRRtextratbouncestpersonalizetverpiitundeliveredt	decoratedtoriginal_senderttimetsizes#recipss#refusedtlistnametsendertkwsttolisti�i(t	recipienttfailcodetfailmsg($tgetRtGetBouncesEmailRtget_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(tmlisttmsgtmsgdataRRtdeliveryfunctreciptchunkstrefusedtt0t
origrecipst
origsendertconntchunktt1tdttempfailurestpermfailurestcodetsmtpmsg((si/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Handlers/SMTPDirect.pyR9as�
	

	
	
	







			

	cCsSidd6dd6dd6dd6dd6dd	6}i}x{|D]s}d}|jd
�}|dkru||d}n|j|d�}|j|g�}|j|�|||<q=Wg}	g}
d}x�|j�D]x}xM|D]E}|
j|�|d}||kr�|	j|
�g}
d}q�q�W|
r�|	j|
�g}
d}q�q�W|	S(NitcomitnettorgitedutustcaR
i(RtrfindR2R?tvalues(Rt	chunksizetchunkmaptbucketstrttldtitbintbucketRPtcurrentchunktchunklen((si/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Handlers/SMTPDirect.pyR8�s@










c	Csx|dD]	}|g|d<tj|�}tj|||�|jd�r�tj|�\}}	tj|�\}
}|dkr�tdd|�qni|d6|
d6t	j
|�d6}dtj|t	j
|	�f}n|j
d	kr�|d
=d}
|j|�r|j|�}
n|
r�tj|j|��}|dkrRd}nt|�}|jpjd
}t|
t�s�t|
|d�}
nt|
|�j�}
t|
|f�|d<q�||d<n|d=|jdi�j|�r�d|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
ParseEmailRRtDOTtjoinRtVERP_FORMATR$tisMembert
getMemberNamet
GetCharSettgetMemberLanguageR	tinput_codect
isinstanceRtunicodeRtencodeRR5R;(RKRLRMRtfailuresRUROtmsgcopytbmailboxtbdomaintrmailboxtrdomainRXtnametcharsettcodec((si/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Handlers/SMTPDirect.pyR6sF	
	
#	

c
Cs�|d=||d<|jr;|d=d|j|f|d<n|jdt�}i}|d}|d}	y|j|||�}Wntjk
r�}
td	d
|
|	�|
j}n�tj	k
r-}
td	d|
j
|
j|	�|
j
dks|
j
d
kr�x'|D]}|
j
|
jf||<qWq�nbtj
ttjfk
r�}
td	d|
|	�t|
�}x"|D]}d|f||<qqWnX|j|�dS(Ns	errors-tos	Errors-ToR,s	"%s" <%s>tSendertmangle_from_Rs
message-idssmtp-failures%All recipients refused: %s, msgid: %ss'SMTP session failure: %s, %s, msgid: %si�i(s#Low level smtp error: %s, msgid: %si����(tinclude_sender_headert	real_nameRAtFalseRRtSMTPRecipientsRefusedRt
recipientstSMTPResponseExceptiont	smtp_codet
smtp_errortsocketterrortIOErrorRtstrRI(
RKRLRMRR�RURRQRtmsgidteRhR�((si/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Handlers/SMTPDirect.pyR;]s6
	

	
	
 
((!t__doc__RwR)R�RttypesRtMailmanRRRtMailman.HandlersRtMailman.Logging.SyslogRtMailman.SafeDictRtemailtemail.UtilsRtemail.HeaderRt
email.CharsetR	RzR:R�t	NameErrorRR9R8R6R;(((si/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Handlers/SMTPDirect.pyt<module>s4

'	�	+	F

Zerion Mini Shell 1.0