ó
    Ö›‘hk ã                   ó  • S r SSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK	J
r
  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SS	KJrJrJrJr  SS
KJr  SSKJrJr  SSKJ r J!r!J"r#  SSK$J%r%J&r&J'r'J(r(J)r)J*r*J+r+J,r,J-r-J.r.J/r/J0r0J1r1J2r2J3r3J4r4J5r6J7r7  SSK8J9r9J:r:J;r;J<r=  SSK>J?r?J@r@  SSKAJBrBJCrC  SSKDJErEJFrFJGrG  SSKHJIrI  / SQrJ\IR–                  " 5       (       a!  \R˜                  " 5       R›                  S5      rNO \Rž                  " 5       R›                  S5      rN\PR£                  \R" SS5      5      rSSDS jrTS rU\U" 5       rVSS 4S jrWS rXSu  rYrZr[Sr\ " S S5      r] " S  S!5      r^ " S" S#\?R¾                  \@RÀ                  5      ra " S$ S%\RÄ                  5      rc " S& S'\?RÈ                  \@RÀ                  5      re " S( S)\e5      rf " S* S+\a5      rg " S, S-5      rh " S. S/\h\e5      ri " S0 S1\RÔ                  5      rk " S2 S3\#5      r"\" \95       " S4 S55      5       rl " S6 S7\h\f5      rm " S8 S9\k5      rnSS:\SSS;S;4S< jroSSKprpSES= jrqSES> jrr " S? S@\pRæ                  5      rt " SA SB\pRê                  5      rvSC rw\pRð                  " \w5        g)Fz/
Simple Mail Transfer Protocol implementation.
é    N)Ú	parseaddr)ÚBytesIO)ÚType)Úimplementer)Úcred)Úlongversion)ÚdeferÚerrorÚprotocolÚreactor)Ú	_idnaText)ÚISSLTransportÚITLSTransport)ÚCramMD5ClientAuthenticatorÚLOGINAuthenticatorÚLOGINCredentials)ÚAddressErrorÚAUTHDeclinedErrorÚAuthenticationErrorÚAUTHRequiredErrorÚEHLORequiredErrorÚESMTPClientErrorÚSMTPAddressErrorÚSMTPBadRcptÚSMTPBadSenderÚSMTPClientErrorÚSMTPConnectErrorÚSMTPDeliveryErrorÚ	SMTPErrorÚSMTPProtocolErrorÚSMTPServerErrorÚSMTPTimeoutErrorÚSMTPTLSErrorÚTLSRequiredError)ÚIClientAuthenticationÚIMessageDeliveryÚIMessageDeliveryFactoryÚIMessageSMTP)ÚbasicÚpolicies)ÚlogÚutil)Ú	iterbytesÚnativeStringÚnetworkString)Úplatform)0r   r   r   r   r   r   r   r   r   r   r   r   r   r!   r"   ÚTLSErrorr$   r    r%   ÚIMessager&   r'   r   r   r   ÚPLAINAuthenticatorÚAddressÚUserÚsendmailÚSenderMixinÚESMTPÚESMTPClientÚESMTPSenderÚESMTPSenderFactoryÚSMTPÚ
SMTPClientÚSMTPFactoryÚ
SMTPSenderÚSMTPSenderFactoryÚidGeneratorÚ	messageidÚ	quoteaddrÚ
rfc822dateÚxtextStreamReaderÚxtextStreamWriterÚxtext_codecÚxtext_decodeÚxtext_encodeÚasciiéÈ   i,  c                 óä  • U (       d2  U(       a  [         R                  " 5       n O[         R                  " 5       n U(       at  U S   (       a  [         R                  * nO[         R                  * n[        [        U5      S5      u  p4U(       a  U[        [        U5      U-  5      -  n[        US5      u  pEOSu  p4[        S/ SQU S      U S   / S	QU S
   S
-
     U S   U S   U S   U S   UU4	-  5      $ )aÀ  
Format an RFC-2822 compliant date string.

@param timeinfo: (optional) A sequence as returned by C{time.localtime()}
    or C{time.gmtime()}. Default is now.
@param local: (optional) Indicates if the supplied time is local or
    universal time, or if no time is given, whether now should be local or
    universal time. Default is local, as suggested (SHOULD) by rfc-2822.

@returns: A L{bytes} representing the time and date in RFC-2822 format.
é   i  é<   )r   r   z)%s, %02d %s %04d %02d:%02d:%02d %+03d%02d)ÚMonÚTueÚWedÚThuÚFriÚSatÚSuné   é   )ÚJanÚFebÚMarÚAprÚMayÚJunÚJulÚAugÚSepÚOctÚNovÚDecé   r   é   é   é   )	ÚtimeÚ	localtimeÚgmtimeÚaltzoneÚtimezoneÚdivmodÚabsÚintr/   )ÚtimeinfoÚlocalÚtzÚtzhrÚtzminÚtzsecs         ÚUC:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\twisted/mail/smtp.pyrD   rD   „   sì   € ö ÞÜ—~’~Ó'‰Hä—{’{“}ˆHÞØ�A�;ä—,‘,�‰Bä—-‘-�ˆBäœs 2›w¨Ó-‰ˆÞØ”Cœ˜B› 2™Ó&Ñ&ˆDÜ  rÓ*‰ˆ�à‰ˆäØ3â=¸hÀq¹kÑJØ�Q‰Kòð �q‰k˜A‰oñð �Q‰KØ�Q‰KØ�Q‰KØ�Q‰KØØð-
ñ	
óð ó    c               #   ó&   #   • Sn  U v •  U S-  n M  7f)Nr   rd   © )Úis    rv   rA   rA   À   s    é € Ø	€AØ
ØŠØ	ˆQ‰ˆñ ùs   ‚c                  ó    • [        [        5      $ ©N)ÚnextÚ_genry   rw   rv   Ú<lambda>r   Ê   s   € ¤4¬¤:rw   c           	      ó4  • [         R                  " S[         R                  " 5       5      n[        R                  " 5       n[
        R                  " S5      nU c  Sn OSU -   n SR                  X#X@U" 5       [        R                  5       5      R                  5       $ )z±
Return a globally unique random string in RFC 2822 Message-ID format

<datetime.pid.random@host.dom.ain>

Optional uniq string will be added to strengthen uniqueness if given.
z%Y%m%d%H%M%SiÿÿÿÚ Ú.z<{}.{}.{}{}.{}@{}>)rh   Ústrftimerj   ÚosÚgetpidÚrandomÚ	randrangeÚformatÚDNSNAMEÚdecodeÚencode)ÚuniqÚNÚdatetimeÚpidÚrands        rv   rB   rB   Ê   st   € ô �}Š}˜^¬T¯[ª[«]Ó;€HÜ
�)Š)‹+€CÜ×Ò˜IÓ&€DØ�|Ø‰à�T‰zˆà×&Ñ&Ø�t¡1£3¬¯©Ó(8óç�fƒhðrw   c                 ó  • [        U [        5      (       a  S[        U 5      -   S-   $ [        U [        5      (       a  U R                  S5      n [	        U 5      nUS:X  a  S[        U 5      -   S-   $ SUS   R                  S5      -   S-   $ )ze
Turn an email address, possibly with realname part etc, into
a form suitable for and SMTP envelope.
ó   <ó   >rJ   ©NNrd   )Ú
isinstancer4   ÚbytesrŠ   r   r‹   )ÚaddrÚress     rv   rC   rC   ß   s‚   € ô �$œ× Ñ Ø”e˜D“kÑ! DÑ(Ð(ä�$œ×ÑØ�{‰{˜7Ó#ˆä
�D‹/€Cà
ˆlÓà”e˜D“kÑ! DÑ(Ð(à�c˜!‘f—m‘m GÓ,Ñ,¨tÑ3Ð3rw   )ÚCOMMANDÚDATAÚAUTHs   [-A-Za-z0-9!\#$%&'*+/=?^_`{|}~]c                   óà   • \ rS rSrSr\R                  " S\-   S-   \R                  5      r	\R                  " \5      r
SS jr\R                  " S5      rS rS	\4S
 jrS	\4S jrS	\4S jrSrg)r4   éû   a*  Parse and hold an RFC 2821 address.

Source routes are stipped and ignored, UUCP-style bang-paths
and %-style routing are not parsed.

@type domain: C{bytes}
@ivar domain: The domain within which this address resides.

@type local: C{bytes}
@ivar local: The local ("user") portion of this address.
s    ( # A string of
                           (?:"[^"]*" # quoted string
                           |\\. # backslash-escaped characted
                           |sL    # atom character
                           )+|.) # or any single characterNc                 óŠ  • [        U[        5      (       a  UR                  n[        U[        5      (       a   UR                  R                  5       U l        g [        U[        5      (       d  [        U5      R                  S5      nXl	        [        [        S U R                  R                  U5      5      5      n/ n/ nU(       Ga!  US   S:X  a  US   S:w  a  [        S5      eUSS nOôUS   S:X  aa  USS  nU(       d?  U(       a   US   S	:w  a  USS  nU(       a  US   S	:w  a  M  U(       d  [        S
5      eUSS  nO U(       a  [        S5      eS/nOŠ[        US   5      S:X  aC  U R                   R#                  US   5      (       d   US   S:w  a  [        SUS   < SX4< 35      eU(       d  UR%                  US   5        OUR%                  US   5        USS  nU(       a  GM!  SR'                  U5      U l        SR'                  U5      U l        U R(                  S:w  a!  U R*                  S:X  a  Uc  [,        nX l        g g g )NrJ   r   r’   éÿÿÿÿr“   zUnbalanced <>rd   ó   @ó   :zMalformed source routez
Too many @rw   ó   .zParse error at z of )r•   r5   Údestr4   Ú__dict__Úcopyr–   Ústrr‹   ÚaddrstrÚlistÚfilterÚtstringÚsplitr   ÚlenÚatomreÚmatchÚappendÚjoinrq   Údomainr‰   )Úselfr—   ÚdefaultDomainÚatlrq   r±   s         rv   Ú__init__ÚAddress.__init__  s  € Ü�dœD×!Ñ!Ø—9‘9ˆDÜ�dœG×$Ñ$Ø ŸM™M×.Ñ.Ó0ˆDŒMØÜ˜D¤%×(Ñ(Ü�t“9×#Ñ# GÓ,ˆDàŒô ”6˜$ §¡× 2Ñ 2°4Ó 8Ó9Ó:ˆØˆØˆçØ�1‰v˜‹~Ø�r‘7˜d“?Ü& Ó7Ð7Ø˜!˜B�i‘Ø�Q‘˜4“Ø˜!˜"�g�Þæ # a¡&¨D£.à! ! "˜g˜ö  # a¡&¨D¥.ö Ü*Ð+CÓDÐDØ˜a˜b˜'‘CÞÜ& |Ó4Ð4ð "˜U‘FÜ�S˜‘V“ Ó!¨$¯+©+×*;Ñ*;¸CÀ¹F×*CÑ*CÈÈAÉÐRVËÜ" _°S¸±V±J¸dÀDÀ;Á/Ð#RÓSÐSæØ—L‘L  Q¡Õ(à—M‘M # a¡&Ô)Ø˜!˜"�g�÷7 ‰cð: —X‘X˜e“_ˆŒ
Ø—h‘h˜vÓ&ˆŒØ�:‰:˜Ó §¡°Ó!3ØÑ$Ü '�Ø'�Kð "4Ðrw   s   \\(.)c                 óº  • / n[        U[        5      (       d  [        U5      R                  S5      n[	        SU R
                  R                  U5      5      nU Ho  nUS   S:X  a  US   S:X  a  UR                  USS 5        M+  SU;   a-  UR                  U R                  R                  SU5      5        M^  UR                  U5        Mq     S	R                  U5      $ )
z&
Remove RFC-2821 quotes from address.
rJ   Nr   ó   "rŸ   rd   Ú\s   \1rw   )r•   r–   r¦   r‹   r©   rª   r«   r¯   Ú	dequotebsÚsubr°   )r²   r—   r˜   r´   Úts        rv   ÚdequoteÚAddress.dequoteJ  sµ   € ð ˆä˜$¤×&Ñ&Ü�t“9×#Ñ# GÓ,ˆDä�T˜4Ÿ<™<×-Ñ-¨dÓ3Ó4ˆãˆAØ�‰t�t‹|  "¡¨£Ø—
‘
˜1˜Q˜r˜7Ö#Ø˜“Ø—
‘
˜4Ÿ>™>×-Ñ-¨f°aÓ8Ö9à—
‘
˜1–ñ ð �x‰x˜‹}Ðrw   Úreturnc                 ó@   • U R                  5       R                  S5      $ ©NrJ   ©Ú	__bytes__rŠ   ©r²   s    rv   Ú__str__ÚAddress.__str___  ó   € Ø�~‰~Ó×&Ñ& wÓ/Ð/rw   c                 ó–   • U R                   (       d  U R                  (       a'  SR                  U R                   U R                  45      $ g)Nr    rw   )rq   r±   r°   rÄ   s    rv   rÃ   ÚAddress.__bytes__b  s.   € Ø�:�:˜ŸŸØ—9‘9˜dŸj™j¨$¯+©+Ð6Ó7Ð7àrw   c           	      óˆ   • SR                  U R                  U R                  R                  [	        [        U 5      5      5      $ )Nz	{}.{}({}))rˆ   Ú
__module__Ú	__class__Ú__name__Úreprr¦   rÄ   s    rv   Ú__repr__ÚAddress.__repr__h  s2   € Ø×!Ñ!Ø�O‰O˜TŸ^™^×4Ñ4´d¼3¸t»9³oó
ð 	
rw   )r¤   r§   r±   rq   r|   )rÍ   rË   Ú__qualname__Ú__firstlineno__Ú__doc__ÚreÚcompileÚatomÚXrª   r­   rµ   rº   r½   r¦   rÅ   r–   rÃ   rÏ   Ú__static_attributes__ry   rw   rv   r4   r4   û   sˆ   † ñ
ð �jŠjð	 ð ñ		ð
>ñ	>ð 	�‰ó	€Gð �ZŠZ˜Ó€Fô2(ðh —
’
˜9Ó%€Iòð*0˜ô 0ð˜5ô ð
˜#÷ 
rw   r4   c                   ó@   • \ rS rSrSrS rS rS\4S jrS\	4S jr
Srg	)
r5   in  zi
Hold information about and SMTP message recipient,
including information on where the message came from
c                 óÒ   •  UR                   n[        X5      U l        X l        X0l        [        U[        5      (       a  X@l        g [        XE5      U l        g ! [         a    S n NWf = fr|   )ÚhostÚAttributeErrorr4   r£   Úhelor   r•   Úorig)r²   ÚdestinationrÝ   r   rÞ   rÛ   s         rv   rµ   ÚUser.__init__t  s\   € ð	Ø—=‘=ˆDô ˜KÓ.ˆŒ	ØŒ	Ø ŒÜ�dœG×$Ñ$Ø�Iä Ó+ˆD�Iøô ó 	ØŠDð	ús   ‚A ÁA&Á%A&c                 óL   • U R                   U R                  SU R                  S.$ )z`
Helper for pickle.

protocol isn't picklabe, but we want User to be, so skip it in
the pickle.
N)r£   rÝ   r   rÞ   )r£   rÝ   rÞ   rÄ   s    rv   Ú__getstate__ÚUser.__getstate__�  s&   € ð —I‘IØ—I‘IØØ—I‘Iñ	
ð 	
rw   r¿   c                 ó@   • U R                  5       R                  S5      $ rÁ   rÂ   rÄ   s    rv   rÅ   ÚUser.__str__�  rÇ   rw   c                 ó,   • [        U R                  5      $ r|   )r–   r£   rÄ   s    rv   rÃ   ÚUser.__bytes__’  s   € Ü�T—Y‘YÓÐrw   )r£   rÝ   rÞ   r   N)rÍ   rË   rÑ   rÒ   rÓ   rµ   râ   r¦   rÅ   r–   rÃ   rØ   ry   rw   rv   r5   r5   n  s)   † ñò
,ò
ð0˜ô 0ð ˜5÷  rw   r5   c                   ó  • \ rS rSrSrSrSrSrSrSr	Sr
S,S jr\S 5       r\R                  S 5       rS	 rS
 rS rS-S jrS rS rS rS rS rS rS rS rS\-   S-   r\R<                  " S\-   S-   \-   S-   \R>                  \R@                  -  5      r!\R<                  " S\-   S-   \-   S-   \R>                  \R@                  -  5      r"S r#S.S jr$S r%S r&S/S jr'S  r(S! r)S" r*S# r+S$ r,S% r-\-r.S& r/S' r0S( r1S) r2S* r3S+r4g)0r<   i–  z`
SMTP server-side protocol.

@ivar host: The hostname of this mail server.
@type host: L{bytes}
éX  NTc                 ór   • [         U l        S U l        S U l        / U l        Xl        X l        [        U l        g r|   )	r™   ÚmodeÚ_fromÚ_heloÚ_toÚdeliveryÚdeliveryFactoryr‰   rÛ   )r²   rï   rð   s      rv   rµ   ÚSMTP.__init__µ  s0   € ÜˆŒ	ØˆŒ
ØˆŒ
ØˆŒØ ŒØ.ÔÜˆ�	rw   c                 ó   • U R                   $ r|   )Ú_hostrÄ   s    rv   rÛ   Ú	SMTP.host¾  s   € à�z‰zÐrw   c                 ón   • [        U[        5      (       d  [        U5      R                  S5      nXl        g rÁ   )r•   r–   r¦   r‹   ró   )r²   ÚtoSets     rv   rÛ   rô   Â  s(   € ä˜%¤×'Ñ'Ü˜“J×%Ñ% gÓ.ˆEØ�
rw   c                 óz   • U R                   S-   nU R                  SU5        U R                  R                  5         g )Ns'    Timeout. Try talking faster next time!i¥  )rÛ   ÚsendCodeÚ	transportÚloseConnection)r²   Úmsgs     rv   ÚtimeoutConnectionÚSMTP.timeoutConnectionÈ  s/   € Ø�i‰iÐDÑDˆØ�‰�c˜3ÔØ�‰×%Ñ%Õ'rw   c                 ó    • U R                   S-   $ )Ns    NO UCE NO UBE NO RELAY PROBES)rÛ   rÄ   s    rv   ÚgreetingÚSMTP.greetingÍ  s   € Ø�y‰yÐ<Ñ<Ð<rw   c                 ó  • U R                   R                  5       n UR                  nS U4U l        U R                  SU R                  5       5        U R                  U R                  5        g ! [         a    [	        U5      n N\f = f©NéÜ   )
rù   ÚgetPeerrÛ   rÜ   r¦   rí   rø   rÿ   Ú
setTimeoutÚtimeout)r²   ÚpeerrÛ   s      rv   ÚconnectionMadeÚSMTP.connectionMadeÐ  sm   € à�~‰~×%Ñ%Ó'ˆð	Ø—9‘9ˆDð ˜D�\ˆŒ
Ø�‰�c˜4Ÿ=™=›?Ô+Ø�‰˜Ÿ™Õ%øô	 ó 	Ü�t“9ŠDð	ús   œA- Á-BÂBc                 óô   • UR                  5       nUSS nUSS  H$  nU R                  [        SU4-  5      U-   5        M&     U R                  [        SU4-  5      U=(       a    US   =(       d    S-   5        g)z#
Send an SMTP code with a message.
rŸ   Nz%3.3d-z%3.3d r   rw   )Ú
splitlinesÚsendLiner/   )r²   ÚcodeÚmessageÚlinesÚlastlineÚlines         rv   rø   ÚSMTP.sendCodeÛ  sx   € ð ×"Ñ"Ó$ˆØ˜˜�:ˆØ˜#˜2“JˆDØ�M‰Mœ-¨°D°7Ñ(:Ó;¸dÑBÖCñ à�‰Ü˜( d WÑ,Ó-°×1I¸hÀq¹k×1PÈSÑQõ	
rw   c                 ó`   • U R                  5         [        U SU R                  -   5      " U5      $ )NÚstate_)ÚresetTimeoutÚgetattrrë   ©r²   r  s     rv   ÚlineReceivedÚSMTP.lineReceivedç  s)   € Ø×ÑÔÜ�t˜X¨¯	©	Ñ1Ô2°4Ó8Ð8rw   c                 ó  • UR                  5       nUR                  S S5      nU(       aK  U R                  US   5      =(       d    U R                  n[	        U5      S:X  a  U" US   5        g U" S5        g U R                  5         g )Nrd   r   rW   rw   )Ústripr«   ÚlookupMethodÚ
do_UNKNOWNr¬   ÚsendSyntaxError)r²   r  ÚpartsÚmethods       rv   Ústate_COMMANDÚSMTP.state_COMMANDë  si   € ð �z‰z‹|ˆà—
‘
˜4 Ó#ˆÞØ×&Ñ& u¨Q¡xÓ0×C°D·O±OˆFÜ�5‹z˜Q‹Ù�u˜Q‘xÕ á�s•à× Ñ Õ"rw   c                 ó(   • U R                  SS5        g )Néô  s   Error: bad syntax©rø   rÄ   s    rv   r  ÚSMTP.sendSyntaxErrorû  s   € Ø�‰�cÐ/Õ0rw   c                 ó~   • [        U[        5      (       d  [        U5      n[        U SUR	                  5       -   S5      $ )z

@param command: The command to get from this class.
@type command: L{str}
@return: The function which executes this command.
Údo_N)r•   r¦   r.   r  Úupper)r²   Úcommands     rv   r  ÚSMTP.lookupMethodþ  s5   € ô ˜'¤3×'Ñ'Ü" 7Ó+ˆGä�t˜U W§]¡]£_Ñ4°dÓ;Ð;rw   c                 ó®   • U R                   [        L a0  U R                   H  nUR                  5         M     [        U l         U ?U R                  SS5        g )Nr$  s   Line too long)rë   rš   Ú_SMTP__messagesÚconnectionLostr™   rø   )r²   r  r  s      rv   ÚlineLengthExceededÚSMTP.lineLengthExceeded
  sC   € Ø�9‰9œÒØŸ?œ?�Ø×&Ñ&Ö(ñ +äˆDŒIØ�Ø�‰�cÐ+Õ,rw   c                 ó(   • U R                  SS5        g )Nr$  s   Command not implementedr%  ©r²   Úrests     rv   r  ÚSMTP.do_UNKNOWN  s   € Ø�‰�cÐ5Õ6rw   c                 óJ  • U R                   R                  5       n UR                  n[        U[        5      (       d  UR                  S5      nX4U l        S U l	        / U l
        U R                  SU R                  S-   U-   S-   5        g ! [         a    [	        U5      n Nyf = f)NÚidnaéú   ó    Hello s   , nice to meet you)rù   r  rÛ   rÜ   r¦   r•   r–   r‹   rí   rì   rî   rø   )r²   r3  r  rÛ   s       rv   Údo_HELOÚSMTP.do_HELO  s’   € Ø�~‰~×%Ñ%Ó'ˆð	Ø—9‘9ˆDô ˜$¤×&Ñ&Ø—;‘;˜vÓ&ˆDà�\ˆŒ
ØˆŒ
ØˆŒØ�‰�c˜4Ÿ9™9 zÑ1°DÑ8Ð;PÑPÕQøô ó 	Ü�t“9ŠDð	ús   œB
 Â
B"Â!B"c                 ó\   • U R                  SS5        U R                  R                  5         g )NéÝ   s   See you later)rø   rù   rú   r2  s     rv   Údo_QUITÚSMTP.do_QUIT$  s!   € Ø�‰�cÐ+Ô,Ø�‰×%Ñ%Õ'rw   s   ("[^"]*"|\\.|s	   |[@.,:])+s>   \s*FROM:\s*(?P<path><> # Empty <>
                          |<s&   > # <addr>
                          |sq    # addr
                          )\s*(\s(?P<opts>.*))? # Optional WS + ESMTP options
                          $s   \s*TO:\s*(?P<path><c           	      ó*  • U R                   (       a  U R                  SS5        g / U l        U R                  R	                  U5      nU(       d  U R                  SS5        g  [        UR                  S5      U R                  5      n[        R                  " U R                  U R                  U5      nUR                  U R                   U R"                  5        g ! [         a.  nU R                  S[        [        U5      5      5         S nAg S nAff = f)Né÷  s#   Only one sender per message, pleaseéõ  ó   Syntax errorÚpathé)  )rì   rø   rî   Úmail_rer®   r4   ÚgrouprÛ   r   r/   r¦   r	   ÚmaybeDeferredÚvalidateFromrí   ÚaddCallbacksÚ_cbFromValidateÚ_ebFromValidate)r²   r3  Úmr—   ÚeÚ	validateds         rv   Údo_MAILÚSMTP.do_MAILD  sÏ   € Ø�:�:Ø�M‰M˜#ÐEÔFØàˆŒØ�L‰L×Ñ˜tÓ$ˆÞØ�M‰M˜#˜Ô/Øð	Ü˜1Ÿ7™7 6›?¨D¯I©IÓ6ˆDô
 ×'Ò'¨×(9Ñ(9¸4¿:¹:ÀtÓLˆ	Ø×Ñ˜t×3Ñ3°T×5IÑ5IÕJøô ó 	Ø�M‰M˜#œ}¬S°«VÓ4Ô5Üûð	ús   Á"%C Ã
DÃ$$DÄDc                 ó2   • Xl         U R                  X#5        g r|   )rì   rø   )r²   Ú	fromEmailr  rû   s       rv   rJ  ÚSMTP._cbFromValidateX  s   € ØŒ
Ø�‰�dÕ rw   c                 ó  • UR                  [        5      (       aj  U R                  UR                  R                  S[        UR                  R                  5      -   S-   [        UR                  R                  5      -   5        g UR                  [        5      (       aD  U R                  UR                  R                  [        UR                  R                  5      5        g [        R                  " US5        U R                  SS5        g )Ns&   Cannot receive from specified address ó   : zSMTP sender validation failureéÃ  ó3   Requested action aborted: local error in processing)Úcheckr   rø   Úvaluer  rC   r—   r/   Úrespr!   r+   Úerr©r²   Úfailures     rv   rK  ÚSMTP._ebFromValidate\  s»   € Ø�=‰=œ×'Ñ'Ø�M‰MØ—‘×"Ñ"à=Ü §¡× 2Ñ 2Ó3ñ4àñô $ G§M¡M×$6Ñ$6Ó7ñ8õð �]‰]œ?×+Ñ+Ø�M‰M˜'Ÿ-™-×,Ñ,¬m¸G¿M¹M×<NÑ<NÓ.OÕPä�GŠG�GÐ=Ô>Ø�M‰M˜#ÐUÕVrw   c           	      ó  • U R                   (       d  U R                  SS5        g U R                  R                  U5      nU(       d  U R                  SS5        g  [	        UR                  S5      U R                  X R                   5      n[        R                  " U R                  U5      nUR                  U R                  U R                  U4S9  g ! [         a.  nU R                  S[        [        U5      5      5         S nAg S nAff = f)Nr@  s!   Must have sender before recipientrA  rB  rC  rD  )ÚcallbackArgs)rì   rø   Úrcpt_rer®   r5   rF  rí   r   r/   r¦   r	   rG  Ú
validateTorI  Ú_cbToValidateÚ_ebToValidate)r²   r3  rL  ÚuserrM  Úds         rv   Údo_RCPTÚSMTP.do_RCPTm  sÊ   € Ø�z�zØ�M‰M˜#ÐCÔDØØ�L‰L×Ñ˜tÓ$ˆÞØ�M‰M˜#˜Ô/Øð	Ü˜Ÿ™ ›¨¯©°T¿:¹:ÓFˆDô
 ×Ò §¡°Ó6ˆØ	�‰�t×)Ñ)¨4×+=Ñ+=ÈTÈGˆÒTøô ó 	Ø�M‰M˜#œ}¬S°«VÓ4Ô5Üûð	ús   Á0C Ã
DÃ$DÄDc                 óh   • Uc  UnU R                   R                  X!45        U R                  X45        g r|   )rî   r¯   rø   )r²   Útore  r  rû   s        rv   rc  ÚSMTP._cbToValidate  s*   € Ø‰<ØˆDØ�‰�‰˜˜
Ô#Ø�‰�dÕ rw   c                 ó  • UR                  [        [        5      (       aD  U R                  UR                  R
                  [        UR                  R                  5      5        g [        R                  " U5        U R                  SS5        g )NrV  rW  )
rX  r   r!   rø   rY  r  r/   rZ  r+   r[  r\  s     rv   rd  ÚSMTP._ebToValidate…  sU   € Ø�=‰=œ¤o×6Ñ6Ø�M‰M˜'Ÿ-™-×,Ñ,¬m¸G¿M¹M×<NÑ<NÓ.OÕPä�GŠG�GÔØ�M‰M˜#ÐUÕVrw   c                 ó°   • U H  n UR                  5         M     g ! [         a/    [        R                  " S5        [        R                  " 5          MQ  f = f)Nz(msg raised exception from connectionLost)r.  ÚBaseExceptionr+   rû   r[  )r²   Úmsgsrû   s      rv   Ú_disconnectÚSMTP._disconnectŒ  sD   € ÛˆCðØ×"Ñ"Ö$ò øô !ó Ü—’ÐBÔCÜ—’—	ðús   ‡œ5AÁAc                 óÐ  • U R                   b  U R                  (       d  U R                  SS5        g [        U l        U R
                  U R                   p2U R                  nS U l         / U l        S U l        / nU HI  u  pg U" 5       nU R                  X#U/5      n	U	(       a  UR                  U	5        UR                  U5        MK     XPl        S=U l        U l        U R                  SS5        U R*                  (       a;  Sn[         R,                  " X³U VVs/ s H  u  pÍ[/        U5      PM     snn4-  5        g g ! [         aM  n
U R                  U
R                  U
R                  5        [        U l        U R                  U5         S n
A
  g S n
A
f[         aG    [         R"                  " 5         U R                  SS5        [        U l        U R                  U5           g f = fs  snnf )	Nr@  s'   Must have valid receiver and originatoré&  s   Internal server errorr   éb  s   Continuez-Receiving message for delivery: from=%s to=%s)rì   rî   rø   rš   rë   rí   Ú
datafailedÚreceivedHeaderr  r¯   r!   r  rZ  r™   rq  ro  r+   r[  r-  Ú_SMTP__inheaderÚ_SMTP__inbodyÚnoisyrû   r¦   )r²   r3  rÝ   ÚoriginÚ
recipientsrp  re  ÚmsgFuncrû   ÚrcvdhdrrM  ÚfmtÚuÚfs                 rv   Údo_DATAÚSMTP.do_DATA”  s€  € Ø�:‰:Ñ d§h§hØ�M‰M˜#ÐIÔJØÜˆŒ	Ø—z‘z 4§:¡:ˆfØ—X‘Xˆ
àˆŒ
ØˆŒØˆŒàˆÛ'‰MˆDðÙ“i�Ø×-Ñ-¨d¸T¸FÓC�ÞØ×$Ñ$ WÔ-Ø—‘˜CÖ ñ (ð$ Œà*+Ð+ˆŒ˜$œ-Ø�‰�c˜;Ô'à�:�:ØAˆCÜ�GŠG�C¹Ô#Dº©v°¤C¨¦F¹Ò#DÐEÑEÕFð øô! #ó Ø—‘˜aŸf™f a§f¡fÔ-Ü#�”	Ø× Ñ  Ô&ÝûÜ ó Ü—’”	Ø—‘˜cÐ#;Ô<Ü#�”	Ø× Ñ  Ô&Úðüó $Es'   Á?AD9ÄG"Ä9
GÅAFÆAGÇGc                 óV  • U R                   [        L a'   U R                   H  n UR                  5         M     U ?U R                  (       a  U R                  5         S U l        U R                  S 5        g ! [         a    [
        R                  " 5          Mv  f = f! [         a     Nlf = fr|   )
rë   rš   r-  r.  ro  r+   r[  rÜ   Ú	_onLogoutr  )r²   Úreasonr  s      rv   r.  ÚSMTP.connectionLost¼  sŽ   € ð
 �9‰9œÒðØ#Ÿœ�Gð"Ø×.Ñ.Ö0ñ  /ð
 �Oð �>�>Ø�N‰NÔØ!ˆDŒNØ�‰˜Õøô )ó "ÜŸšŸ	ð"ûô "ó Ùðús3   •B ¥A5µB Á5BÂB ÂBÂB Â
B(Â'B(c                 óD   • S U l         / U l        U R                  SS5        g )Nr7  s   I remember nothing.)rì   rî   rø   r2  s     rv   Údo_RSETÚSMTP.do_RSETÐ  s   € ØˆŒ
ØˆŒØ�‰�cÐ1Õ2rw   c                 óª  • US S S:X  aÞ  US:X  aÓ  [         U l        U R                  (       a;  U R                  U R                  R                  U R                  R
                  5        g U R                  (       d  U R                  S5        g [        R                  " U R                   Vs/ s H  o"R                  5       PM     snSS9R                  U R                  5        U ?g USS  nU R                  (       a  g  U R                  (       dQ  U R                  (       d@  SU;   a  SU l        O2U(       a+  U R                   H  nUR                  S5        M     SU l        U(       d  SU l        U R                   H  nUR                  U5        M     g s  snf ! [         a3  nX@l        U R                   H  nUR!                  5         M      S nAg S nAff = f)Nrd   r¢   zthrown awayT)ÚconsumeErrorsr¡   rw   )r™   rë   rv  rø   r  rZ  r-  Ú_messageHandledr	   ÚDeferredListÚeomReceivedÚaddCallbackrx  ry  r  r!   r.  )r²   r  rL  r  rM  s        rv   ÚdataLineReceivedÚSMTP.dataLineReceivedÕ  s]  € Ø��ˆ8�tÓØ�t‹|Ü#�”	Ø—?—?Ø—M‘M $§/¡/×"6Ñ"6¸¿¹×8LÑ8LÔMØØ——Ø×(Ñ(¨Ô7ØÜ×"Ò"Ø.2¯oªoÓ>ªo¨—]‘]–_©oÑ>Èdñç‘+˜d×2Ñ2Ô3Ø�OØØ˜˜�8ˆDà�?�?Øð	)ð —?—?¨4¯=¯=Ø˜4“<Ø&'�D•OÞØ#'§?¤?˜Ø×,Ñ,¨SÖ1ñ $3à$%�D”MæØ !�”àŸ?œ?�Ø×$Ñ$ TÖ*ò +ùò1 ?øô4 ó 	)ØŒOØŸ?œ?�Ø×&Ñ&Ö(ö +ûð	)ús   Â(FÃ;BF Æ
GÆ)GÇGc                 ó  • SnU H)  u  p4U(       a  M  US-  n[         R                  " U5        M+     U(       a;  Sn[        U5      nUS:”  a  USU SU S3-  nU R                  S[	        U5      5        g U R                  SS	5        g )
Nr   rd   zCould not send e-mailz (z failures out of z recipients)rt  r7  s   Delivery in progress)r+   r[  r¬   rø   r/   )r²   Ú
resultListÚfailuresÚsuccessÚresultrû   Ú	resultLens          rv   r�  ÚSMTP._messageHandled  s‚   € ØˆÛ)‰OˆGß�7Ø˜A‘�Ü—’˜–ñ  *ö Ø)ˆCÜ˜J›ˆIØ˜1‹}Ø˜˜H˜:Ð%6°y°kÀÐNÑN�Ø�M‰M˜#œ}¨SÓ1Õ2à�M‰M˜#Ð6Õ7rw   c                 óä   • Uu  p#n[        U[        5      (       a  X0l        SU l        O;[        U[        5      (       a  SU l        X0l        O[        UR                   S35      eX@l        SU l        g)zB
Save the state resulting from a successful anonymous cred login.
Nz is not a supported interface)	Ú
issubclassr'   rð   rï   r&   ÚRuntimeErrorrÍ   r…  Ú
challenger)r²   r—  ÚifaceÚavatarÚlogouts        rv   Ú_cbAnonymousAuthenticationÚSMTP._cbAnonymousAuthentication  sh   € ð #)Ñˆ˜Ü�eÔ4×5Ñ5Ø#)Ô Ø ˆD�MÜ˜Ô/×0Ñ0Ø#'ˆDÔ Ø"�Mä %§.¡.Ð!1Ð1NÐOÓPÐPØŒØˆ�rw   c                 ó  ^ ^^• T R                   b  T R                   R                  5       T l        T R                  b,  [        R                  " T R                  R
                  TT5      $ T R                  (       a  T R                  R                  [        R                  R                  5       S[        [        5      nU4S jnUR                  T R                  U5        UUU 4S jnUR                  U5        U$ [!        T5      e)a°  
Validate the address from which the message originates.

@type helo: C{(bytes, bytes)}
@param helo: The argument to the HELO command and the client's IP
address.

@type origin: C{Address}
@param origin: The address the message is from

@rtype: C{Deferred} or C{Address}
@return: C{origin} or a C{Deferred} whose callback will be
passed C{origin}.

@raise SMTPBadSender: Raised of messages from this address are
not to be accepted.
Nc                 ó  >• U R                  [        R                  R                  5      (       a  [	        T5      nO;U R                  [        R                  R
                  5      (       a  [	        TSS9nOU $ [        R                  " U5      $ )z‰
Translate cred exceptions into SMTP exceptions so that the
protocol code which invokes C{validateFrom} can properly report
the failure.
z#Unauthenticated senders not allowed)rZ  )rX  r   r
   ÚUnauthorizedLoginr   ÚUnhandledCredentialsr	   Úfail)r[  Úexcr{  s     €rv   ÚebAuthenticationÚ+SMTP.validateFrom.<locals>.ebAuthenticationD  sf   ø€ ð —9‘9œTŸZ™Z×9Ñ9×:Ñ:Ü'¨Ó/‘CØ—Y‘YœtŸz™z×>Ñ>×?Ñ?Ü'ØÐ%Jñ‘Cð �JÜ—z’z #“Ð&rw   c                 ó(   >• TR                  TT5      $ )z%
Re-attempt from address validation.
)rH  )ÚignoredrÝ   r{  r²   s    €€€rv   ÚcontinueValidationÚ-SMTP.validateFrom.<locals>.continueValidationV  s   ø€ ð ×(Ñ(¨¨vÓ6Ð6rw   )rð   ÚgetMessageDeliveryrï   r	   rG  rH  ÚportalÚloginr   ÚcredentialsÚ	Anonymousr'   r&   rI  r¡  r�  r   )r²   rÝ   r{  r—  r©  r­  s   ```   rv   rH  ÚSMTP.validateFrom!  sÌ   ú€ ð$ ×ÑÑ+Ø ×0Ñ0×CÑCÓEˆDŒMà�=‰=Ñ$Ü×&Ò& t§}¡}×'AÑ'AÀ4ÈÓPÐPð
 �;�;Ø—[‘[×&Ñ&Ü× Ñ ×*Ñ*Ó,ØÜ'Ü ó	ˆFõ'ð  ×Ñ × ?Ñ ?ÐAQÔR÷7ð ×ÑÐ1Ô2ØˆMä˜FÓ#Ð#rw   c                 óh   • U R                   b  U R                   R                  U5      $ [        U5      e)a·  
Validate the address for which the message is destined.

@type user: L{User}
@param user: The address to validate.

@rtype: no-argument callable
@return: A C{Deferred} which becomes, or a callable which
takes no arguments and returns an object implementing C{IMessage}.
This will be called and the returned object used to deliver the
message when it arrives.

@raise SMTPBadRcpt: Raised if messages to the address are
not to be accepted.
)rï   rb  r   ©r²   re  s     rv   rb  ÚSMTP.validateToa  s.   € ð  �=‰=Ñ$Ø—=‘=×+Ñ+¨DÓ1Ð1Ü˜$ÓÐrw   c                 óÂ  • U R                   b  U R                   R                  XU5      $ SnUS   (       a  SUS   -   n[        U R                  R	                  5       R
                  5      nSUS   -   S-   US   -   S-   U-   S-   nS	XPR                  R                  [        4-  nS
SR                  [        [        U5      5      [        5       4-  nSU-   S-   U-   S-   U-   $ )Nrw   r   s    helo=s   from s    ([rd   ó   ]ó   )s   by %s with %s (%s)s
   for %s; %sÚ s
   Received: s   
	)rï   rw  r/   rù   ÚgetHostrÛ   rÌ   rÍ   r   r°   Úmapr¦   rD   )	r²   rÝ   r{  r|  ÚheloStrr±   Úfrom_ÚbyÚfor_s	            rv   rw  ÚSMTP.receivedHeaderu  sÞ   € Ø�=‰=Ñ$Ø—=‘=×/Ñ/°¸jÓIÐIàˆØ��7Ø $ q¡'Ñ)ˆGÜ˜tŸ~™~×5Ñ5Ó7×<Ñ<Ó=ˆà˜4 ™7Ñ" VÑ+¨d°1©gÑ5¸Ñ<¸wÑFÈÑMˆØ" f¯n©n×.EÑ.EÄ{Ð%SÑSˆØ §¡¬¬S°*Ó)=Ó >Ä
ÃÐMÑMˆØ˜uÑ$ wÑ.°Ñ3°gÑ=ÀÑDÐDrw   )Ú__inbodyÚ
__inheaderÚ
__messagesrì   rí   ró   r…  rî   r�  rv  rï   rð   rÛ   rë   r”   )rw   )r7  s   Sender address accepted)Nr7  s   Recipient address accepted)5rÍ   rË   rÑ   rÒ   rÓ   r  r°  rz  rð   rï   r…  rµ   ÚpropertyrÛ   Úsetterrü   rÿ   r  rø   r  r!  r  r  r/  r  r9  r=  rÖ   ÚqstringrÔ   rÕ   ÚIr×   rE  ra  rO  rJ  rK  rg  rc  rd  rq  r‚  r.  r‰  r‘  Ú
state_DATAr�  r¡  rH  rb  rw  rØ   ry   rw   rv   r<   r<   –  s¢  † ñð €GØ€Fð €Eð €Oð €Hð €Iôð ñó ðð 
‡[�[ñó ðò
(ò
=ò	&ô

ò9ò#ò 1ò
<ò-ò7òRò(ð   $Ñ&¨Ñ6€Gà�jŠjð	 à
ñ	ðñ	ð
 ñ	ðñ	ð 	�‰ˆr�t‰t‰ó€Gð �jŠjØØ
ñ	ðñ	ð ñ		ð
ñ	ð 	�‰ˆr�t‰t‰ó
€GòKô(!òWò"Uô$!òWòò&GòPò(3ò
()ðT "€Jò8òò">$ò@ õ(Erw   r<   c                   ó8   • \ rS rSrSr\rSr\r	Sr
SS jrS rSrg)	r>   i„  z
Factory for SMTP.
ré   Nc                 ó   • Xl         g r|   ©r°  )r²   r°  s     rv   rµ   ÚSMTPFactory.__init__�  s   € Ø�rw   c                 óˆ   • [         R                  R                  X5      nU R                  Ul        U R                  Ul        U$ r|   )r   ÚServerFactoryÚbuildProtocolr°  r±   rÛ   ©r²   r—   Úps      rv   rÑ  ÚSMTPFactory.buildProtocol“  s3   € Ü×"Ñ"×0Ñ0°Ó<ˆØ—;‘;ˆŒØ—‘ˆŒØˆrw   rÍ  r|   )rÍ   rË   rÑ   rÒ   rÓ   r‰   r±   r  r<   r   r°  rµ   rÑ  rØ   ry   rw   rv   r>   r>   „  s'   † ñð
 €FØ€GØ€Hà€Fôõrw   r>   c                   óÈ   • \ rS rSrSrSrSrSS jrS rS r	\
R                  4S jrS	 rS
 rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rSr g)r=   iš  aÃ  
SMTP client for sending emails.

After the client has connected to the SMTP server, it repeatedly calls
L{SMTPClient.getMailFrom}, L{SMTPClient.getMailTo} and
L{SMTPClient.getMailData} and uses this information to send an email.
It then calls L{SMTPClient.getMailFrom} again; if it returns L{None}, the
client will disconnect, otherwise it will continue as normal i.e. call
L{SMTPClient.getMailTo} and L{SMTPClient.getMailData} and send a new email.
TNc                 óì   • [        U[        5      (       a  UR                  S5      nU=(       d    SU l        / U l        / U l        S U l        / U l        SU l        [        R                  " U5      U l        g )NrJ   rw   rŸ   )r•   r¦   r‹   ÚidentityÚtoAddressesResultÚsuccessAddressesrì   rZ  r  r,   ÚLineLogr+   )r²   r×  Úlogsizes      rv   rµ   ÚSMTPClient.__init__­  s]   € Ü�h¤×$Ñ$Ø—‘ wÓ/ˆHà Ÿ CˆŒØ!#ˆÔØ "ˆÔØˆŒ
ØˆŒ	ØˆŒ	Ü—<’< Ó(ˆ�rw   c                 ó    • U R                   (       a  U R                  R                  SU-   5        [        R                  R                  X5        g )Ns   >>> )Údebugr+   r¯   r)   ÚLineReceiverr  r  s     rv   r  ÚSMTPClient.sendLine¹  s1   € à�:�:Ø�H‰H�O‰O˜G d™NÔ+ä×Ñ×#Ñ# DÕ/rw   c                 óŽ   • U R                  U R                  5        S/U l        U R                  U l        U R
                  U l        g r  )r  r  Ú	_expectedÚsmtpState_heloÚ_okresponseÚsmtpConnectionFailedÚ_failresponserÄ   s    rv   r  ÚSMTPClient.connectionMadeÀ  s7   € Ø�‰˜Ÿ™Ô%à˜ˆŒØ×.Ñ.ˆÔØ!×6Ñ6ˆÕrw   c                 ó4   • U R                  S5        SU l        g)z
We are no longer connected
N)r  ÚmailFile©r²   r†  s     rv   r.  ÚSMTPClient.connectionLostÇ  s   € ð 	�‰˜ÔØˆ�rw   c                 ól   • U R                  [        SSU R                  R                  5       5      5        g )NrŸ   s(   Timeout waiting for SMTP server response)Ú	sendErrorr"   r+   r¦   rÄ   s    rv   rü   ÚSMTPClient.timeoutConnectionÎ  s(   € Ø�‰ÜØÐ?ÀÇÁÇÁÃóõ	
rw   c           	      óÈ  • U R                  5         U R                  (       a  U R                  R                  SU-   5        S n [	        US S 5      U l        USS S:X  a  g U R                  R                  USS  5        USS S	:X  a  g U R
                  U R                  ;   a6  U R                  U R
                  S
R                  U R                  5      5      nO5U R                  U R
                  S
R                  U R                  5      5      nSU l        / U l
        U$ ! [         a:    U R                  [        SSU 3U R                  R                  5       5      5         g f = f)Ns   <<< re   rŸ   z#Invalid response from SMTP server: r   rd   ó   0rf   ó   -ó   
)r  rÞ  r+   r¯   ro   r  Ú
ValueErrorrí  r    r¦   rZ  râ  rä  r°   ræ  )r²   r  Úwhys      rv   r  ÚSMTPClient.lineReceivedÕ  s1  € Ø×ÑÔð �:�:Ø�H‰H�O‰O˜G d™NÔ+àˆð	Ü˜D  !˜H›ˆDŒIð ��!ˆ9˜Óàà�	‰	×Ñ˜˜a˜b˜Ô"à��!ˆ9˜Óàà�9‰9˜Ÿ™Ó&Ø×"Ñ" 4§9¡9¨e¯j©j¸¿¹Ó.CÓD‰Cà×$Ñ$ T§Y¡Y°·
±
¸4¿9¹9Ó0EÓFˆCàˆŒ	ØˆŒ	Øˆ
øô; ó 
	ð �N‰NÜ!ØØ9¸$¸Ð@Ø—H‘H—L‘L“Nóôñ ð
	ús   ÁD ÄAE!Å E!c                 ój   • U R                  [        XU R                  R                  5       5      5        g r|   )rí  r   r+   r¦   ©r²   r  rZ  s      rv   rå  ÚSMTPClient.smtpConnectionFailedÿ  s    € Ø�‰Ô'¨°D·H±H·L±L³NÓCÕDrw   c                 óš   • US:  a4  U R                  [        XU R                  R                  5       5      5        g U R	                  X5        g )Nr   )rí  r    r+   r¦   ÚsmtpState_msgSentr÷  s      rv   ÚsmtpTransferFailedÚSMTPClient.smtpTransferFailed  s5   € Ø�!‹8Ø�N‰NÔ,¨T¸¿¹¿¹»ÓHÕIà×"Ñ" 4Õ.rw   c                 óx   • U R                  SU R                  -   5        [        U l        U R                  U l        g )Ns   HELO )r  r×  ÚSUCCESSrâ  ÚsmtpState_fromrä  r÷  s      rv   rã  ÚSMTPClient.smtpState_helo  s,   € Ø�‰�h §¡Ñ.Ô/Ü ˆŒØ×.Ñ.ˆÕrw   c                 ó  • U R                  5       U l        U R                  U l        U R                  bA  U R	                  S[        U R                  5      -   5        S/U l        U R                  U l        g U R                  5         g )Ns
   MAIL FROM:r7  )
ÚgetMailFromrì   rû  ræ  r  rC   râ  ÚsmtpState_torä  Ú_disconnectFromServerr÷  s      rv   rÿ  ÚSMTPClient.smtpState_from  si   € Ø×%Ñ%Ó'ˆŒ
Ø!×4Ñ4ˆÔØ�:‰:Ñ!Ø�M‰M˜-¬)°D·J±JÓ*?Ñ?Ô@Ø!˜UˆDŒNØ#×0Ñ0ˆDÕð ×&Ñ&Õ(rw   c                 ó8   • U R                   R                  5         g r|   )rù   rú   r÷  s      rv   ÚsmtpState_disconnectÚSMTPClient.smtpState_disconnect  s   € Ø�‰×%Ñ%Õ'rw   c                 óÐ   • [        U R                  5       5      U l        / U l        / U l        U R
                  U l        [        SS5      U l        S U l	        U R                  SS5      $ )Nr   éè  rw   )
ÚiterÚ	getMailToÚtoAddressesrØ  rÙ  ÚsmtpState_toOrDatarä  Úrangerâ  ÚlastAddressr÷  s      rv   r  ÚSMTPClient.smtpState_to  s\   € Ü §¡Ó 0Ó1ˆÔØ!#ˆÔØ "ˆÔØ×2Ñ2ˆÔÜ˜q $›ˆŒØˆÔØ×&Ñ& q¨#Ó.Ð.rw   c                 ó  • U R                   bV  U R                  R                  U R                   X45        U[        ;   a%  U R                  R                  U R                   5         [        U R                  5      U l         U R                  S[        U R                   5      -   5        g ! [         aR    U R                  (       a,  U R                  S5        S/U l
        U R                  U l         g U R                  US5      s $ f = f)Ns   RCPT TO:s   DATAru  zNo recipients accepted)r  rØ  r¯   rþ  rÙ  r}   r  r  rC   ÚStopIterationrâ  ÚsmtpState_datarä  rú  r÷  s      rv   r  ÚSMTPClient.smtpState_toOrData$  sØ   € Ø×ÑÑ'Ø×"Ñ"×)Ñ)¨4×+;Ñ+;¸TÐ*HÔIØ”w‹Ø×%Ñ%×,Ñ,¨T×-=Ñ-=Ô>ð
	EÜ# D×$4Ñ$4Ó5ˆDÔð �M‰M˜+¬	°$×2BÑ2BÓ(CÑCÕDøô ó 	NØ×$×$Ø—‘˜gÔ&Ø"% �”Ø#'×#6Ñ#6�Ö à×-Ñ-¨dÐ4LÓMÒMð	Nús   Á%B' Â'ADÃ.DÄDc                 ó  ^ • [         R                  " 5       nUR                  T R                  5       T R                  T R
                  5      nU 4S jnUR                  T R                  U5        [        T l	        T R                  T l        g )Nc                 ó<   >• TR                  U R                  5        g r|   )rí  rY  )r[  r²   s    €rv   Ú
ebTransferÚ-SMTPClient.smtpState_data.<locals>.ebTransfer9  s   ø€ Ø�N‰N˜3Ÿ9™9Õ%rw   )r)   Ú
FileSenderÚbeginFileTransferÚgetMailDatarù   ÚtransformChunkrI  ÚfinishedFileTransferrþ  râ  rú  rä  )r²   r  rZ  Úsrf  r  s   `     rv   r  ÚSMTPClient.smtpState_data5  sh   ø€ Ü×ÒÓˆØ×Ñ × 0Ñ 0Ó 2°D·N±NÀD×DWÑDWÓXˆõ	&ð 	
�‰�t×0Ñ0°*Ô=Ü ˆŒØ×1Ñ1ˆÕrw   c                 ó
  • U R                   b;  U R                  X[        U R                  5      U R                  U R
                  5        / U l        S U l         U R                  S5        [        U l        U R                  U l
        g )Ns   RSET)rì   ÚsentMailr¬   rÙ  rØ  r+   r  rþ  râ  rÿ  rä  r÷  s      rv   rú  ÚSMTPClient.smtpState_msgSent@  sk   € Ø�:‰:Ñ!Ø�M‰MØœC × 5Ñ 5Ó6¸×8NÑ8NÐPT×PXÑPXôð "$ˆÔØˆŒ
Ø�‰�gÔÜ ˆŒØ×.Ñ.ˆÕrw   c                 óf   • U R                  5         UR                  SS5      R                  SS5      $ )zâ
Perform the necessary local to network newline conversion and escape
leading periods.

This method also resets the idle timeout so that as long as process is
being made sending the message body, the client will not time out.
rò  s   
ó   
.s   
..)r  Úreplace)r²   Úchunks     rv   r  ÚSMTPClient.transformChunkO  s.   € ð 	×ÑÔØ�}‰}˜U GÓ,×4Ñ4°X¸yÓIÐIrw   c                 ó<   • US:w  a  SnOSnU R                  U5        g )Nrò  r%  r¢   )r  )r²   Úlastsentr  s      rv   r  ÚSMTPClient.finishedFileTransferZ  s    € Ø�uÓØ‰DàˆDØ�‰�dÕrw   c                 ó   • [         e)z,
Return the email address the mail is from.
©ÚNotImplementedErrorrÄ   s    rv   r  ÚSMTPClient.getMailFromc  ó
   € ô "Ð!rw   c                 ó   • [         e)z%
Return a list of emails to send to.
r-  rÄ   s    rv   r  ÚSMTPClient.getMailToi  r0  rw   c                 ó   • [         e)zp
Return file-like object containing data of message to be sent.

Lines in the file should be delimited by '\n'.
r-  rÄ   s    rv   r  ÚSMTPClient.getMailDatao  s
   € ô "Ð!rw   c                 ó–   • [        U[        5      (       a"  UR                  (       d  U R                  5         gU R	                  SS5        g)a  
If an error occurs before a mail message is sent sendError will be
called.  This base class method sends a QUIT if the error is
non-fatal and disconnects the connection.

@param exc: The SMTPClientError (or child class) raised
@type exc: C{SMTPClientError}
rŸ   N)r•   r   ÚisFatalr  r  ©r²   r¨  s     rv   rí  ÚSMTPClient.sendErrorw  s5   € ô �cœ?×+Ñ+°C·K·KØ×&Ñ&Õ(ð ×%Ñ% b¨$Õ/rw   c                 ó   • [         e)a-  
Called when an attempt to send an email is completed.

If some addresses were accepted, code and resp are the response
to the DATA command. If no addresses were accepted, code is -1
and resp is an informative message.

@param code: the code returned by the SMTP Server
@param resp: The string response returned from the SMTP Server
@param numOk: the number of addresses accepted by the remote host.
@param addresses: is a list of tuples (address, code, resp) listing
                  the response to each RCPT command.
@param log: is the SMTP session log
r-  )r²   r  rZ  ÚnumOkÚ	addressesr+   s         rv   r"  ÚSMTPClient.sentMail‡  s
   € ô "Ð!rw   c                 ój   • [        SS5      U l        U R                  U l        U R	                  S5        g )Nr   r
  s   QUIT)r  râ  r  rä  r  rÄ   s    rv   r  Ú SMTPClient._disconnectFromServer˜  s)   € Ü˜q $›ˆŒØ×4Ñ4ˆÔØ�‰�gÕrw   )râ  ræ  rì   rä  r  r×  r  r+   ré  rZ  rÙ  r  rØ  )é
   )!rÍ   rË   rÑ   rÒ   rÓ   rÞ  r  rµ   r  r  r   ÚconnectionDoner.  rü   r  rå  rû  rã  rÿ  r  r  r  r  rú  r  r  r  r  r  rí  r"  r  rØ   ry   rw   rv   r=   r=   š  s—   † ñ	ð €Eð €Gô
)ò0ò7ð %-×$;Ñ$;ô ò
ò(òTEò/ò/ò
	)ò(ò/òEò"	2ò
/ò	Jòò"ò"ò"ò0ò "õ"rw   r=   c                   óÊ   • \ rS rSrSrSrSrSrSrSr	SS jr
S rS rSS	 jrSS
 jrSS jrSS jrSS jrSS jrSS jrS rS rS rS rS rS rS rS rS rS rS rSrg)r9   iž  aÃ  
A client for sending emails over ESMTP.

@ivar heloFallback: Whether or not to fall back to plain SMTP if the C{EHLO}
    command is not recognised by the server. If L{requireAuthentication} is
    C{True}, or L{requireTransportSecurity} is C{True} and the connection is
    not over TLS, this fallback flag will not be honored.
@type heloFallback: L{bool}

@ivar requireAuthentication: If C{True}, refuse to proceed if authentication
    cannot be performed. Overrides L{heloFallback}.
@type requireAuthentication: L{bool}

@ivar requireTransportSecurity: If C{True}, refuse to proceed if the
    transport cannot be secured. If the transport layer is not already
    secured via TLS, this will override L{heloFallback}.
@type requireAuthentication: L{bool}

@ivar context: The context factory to use for STARTTLS, if desired.
@type context: L{IOpenSSLClientConnectionCreator}

@ivar _tlsMode: Whether or not the connection is over TLS.
@type _tlsMode: L{bool}
TFNc                 ó^   • [         R                  " U /UQ70 UD6  / U l        Xl        X l        g r|   )r=   rµ   ÚauthenticatorsÚsecretÚcontext)r²   rD  ÚcontextFactoryÚargsÚkws        rv   rµ   ÚESMTPClient.__init__¾  s,   € Ü×Ò˜DÐ. 4Ò.¨2Ò.Ø ˆÔØŒØ%�rw   c                 ó¦   • US:X  a&  [         R                  " S[        SS9  U R                  $ [	        U R
                  R                  < SU< 35      e)NÚtlsModeúStlsMode attribute of twisted.mail.smtp.ESMTPClient is deprecated since Twisted 13.0rW   ©ÚcategoryÚ
stacklevelz instance has no attribute )ÚwarningsÚwarnÚDeprecationWarningÚ_tlsModerÜ   rÌ   rÍ   )r²   Únames     rv   Ú__getattr__ÚESMTPClient.__getattr__Ä  sQ   € Ø�9ÓÜ�MŠMð3ä+Øò	ð —=‘=Ð ä ð —N‘N×+Ô+Úðóð rw   c                 ón   • US:X  a!  [         R                  " S[        SS9  X l        g X R                  U'   g )NrK  rL  rW   rM  )rP  rQ  rR  rS  r¤   )r²   rT  rY  s      rv   Ú__setattr__ÚESMTPClient.__setattr__Ö  s4   € Ø�9ÓÜ�MŠMð3ä+Øò	ð "�Mà"'�M‰M˜$Òrw   c                 ól   • U R                  [        SSU R                  R                  5       5      5        g)aU  
Fail because authentication is required, but the server does not support
ESMTP, which is required for authentication.

@param code: The server status code from the most recently received
    server message.
@type code: L{int}

@param resp: The server status response from the most recently received
    server message.
@type resp: L{bytes}
éö  s,   Server does not support ESMTP AuthenticationN)rí  r   r+   r¦   r÷  s      rv   ÚesmtpEHLORequiredÚESMTPClient.esmtpEHLORequiredâ  s*   € ð 	�‰ÜØÐHÈ$Ï(É(Ï,É,Ë.óõ	
rw   c                 ó  • / nU R                    H0  nUR                  UR                  5       R                  5       5        M2     SSR	                  U5      -  nU R                  [        SSU-  U R                  R                  5       5      5        g)a@  
Fail because authentication is required, but the server does not support
any schemes we support.

@param code: The server status code from the most recently received
    server message.
@type code: L{int}

@param resp: The server status response from the most recently received
    server message.
@type resp: L{bytes}
s   [%s]s   , r[  s8   Server does not support Client Authentication schemes %sN)	rC  r¯   ÚgetNamer)  r°   rí  r   r+   r¦   )r²   r  rZ  ÚtmpÚaÚauths         rv   ÚesmtpAUTHRequiredÚESMTPClient.esmtpAUTHRequiredõ  su   € ð ˆà×$Ô$ˆAØ�J‰J�q—y‘y“{×(Ñ(Ó*Ö+ñ %ð ˜Ÿ™ C›Ñ(ˆà�‰ÜØØOÐRVÑVØ—‘—‘“óõ	
rw   c                 ól   • U R                  [        SSU R                  R                  5       5      5        g)a   
Fail because TLS is required and the server does not support it.

@param code: The server status code from the most recently received
    server message.
@type code: L{int}

@param resp: The server status response from the most recently received
    server message.
@type resp: L{bytes}
r[  s:   Server does not support secure communication via TLS / SSLN)rí  r$   r+   r¦   r÷  s      rv   ÚesmtpTLSRequiredÚESMTPClient.esmtpTLSRequired  s+   € ð 	�‰ÜØØQØ—‘—‘“óõ	
rw   c                 ól   • U R                  [        USU R                  R                  5       5      5        g)a  
Fail because the TLS handshake wasn't able to be completed.

@param code: The server status code from the most recently received
    server message.
@type code: L{int}

@param resp: The server status response from the most recently received
    server message.
@type resp: L{bytes}
s(   Could not complete the SSL/TLS handshakeN)rí  r1   r+   r¦   r÷  s      rv   ÚesmtpTLSFailedÚESMTPClient.esmtpTLSFailed%  s*   € ð 	�‰ÜØÐEÀtÇxÁxÇ|Á|Ã~óõ	
rw   c                 ój   • U R                  [        XU R                  R                  5       5      5        g)a  
Fail because the authentication was rejected.

@param code: The server status code from the most recently received
    server message.
@type code: L{int}

@param resp: The server status response from the most recently received
    server message.
@type resp: L{bytes}
N)rí  r   r+   r¦   r÷  s      rv   ÚesmtpAUTHDeclinedÚESMTPClient.esmtpAUTHDeclined7  s"   € ð 	�‰Ô(¨°T·X±X·\±\³^ÓDÕErw   c                 ól   • U R                  [        SSU R                  R                  5       5      5        g)a"  
Fail because the server sent a malformed authentication challenge.

@param code: The server status code from the most recently received
    server message.
@type code: L{int}

@param resp: The server status response from the most recently received
    server message.
@type resp: L{bytes}
rA  sR   Login failed because the SMTP Server returned a malformed Authentication ChallengeN©rí  r   r+   r¦   r÷  s      rv   ÚesmtpAUTHMalformedChallengeÚ'ESMTPClient.esmtpAUTHMalformedChallengeE  s.   € ð 	�‰ÜØðMà—‘—‘“ó	õ	
rw   c                 ój   • U R                  [        XU R                  R                  5       5      5        g)a  
Fail because of some other authentication error.

@param code: The server status code from the most recently received
    server message.
@type code: L{int}

@param resp: The server status response from the most recently received
    server message.
@type resp: L{bytes}
Nro  r÷  s      rv   ÚesmtpAUTHServerErrorÚ ESMTPClient.esmtpAUTHServerErrorZ  s"   € ð 	�‰Ô*¨4°t·x±x·|±|³~ÓFÕGrw   c                 ó:   • U R                   R                  U5        g)aZ  
Registers an Authenticator with the ESMTPClient. The ESMTPClient will
attempt to login to the SMTP Server in the order the Authenticators are
registered. The most secure Authentication mechanism should be
registered first.

@param auth: The Authentication mechanism to register
@type auth: L{IClientAuthentication} implementor

@return: L{None}
N)rC  r¯   )r²   rb  s     rv   ÚregisterAuthenticatorÚ!ESMTPClient.registerAuthenticatorh  s   € ð 	×Ñ×"Ñ" 4Õ(rw   c                 óš   • [         R                  " U R                  5      U l        [        R                  U 5        U R                  U l        g)zX
Called when a connection has been made, and triggers sending an C{EHLO}
to the server.
N)r   Ú
providedByrù   rS  r=   r  ÚesmtpState_ehlorä  rÄ   s    rv   r  ÚESMTPClient.connectionMadev  s6   € ô
 &×0Ò0°·±Ó@ˆŒÜ×!Ñ! $Ô'Ø×/Ñ/ˆÕrw   c                 óN  • [         U l        U R                  U l        U R                  U l        U R                  (       a  SnOU R                  nU R                  (       a)  U R                  (       d  U(       d  U R                  U l        U R                  SU R                  -   5        g)a�  
Send an C{EHLO} to the server.

If L{heloFallback} is C{True}, and there is no requirement for TLS or
authentication, the client will fall back to basic SMTP.

@param code: The server status code from the most recently received
    server message.
@type code: L{int}

@param resp: The server status response from the most recently received
    server message.
@type resp: L{bytes}

@return: L{None}
Fs   EHLO N)rþ  râ  ÚesmtpState_serverConfigrä  r\  ræ  rS  ÚrequireTransportSecurityÚheloFallbackÚrequireAuthenticationrã  r  r×  )r²   r  rZ  ÚneedTLSs       rv   rz  ÚESMTPClient.esmtpState_ehlo  st   € ô" !ˆŒà×7Ñ7ˆÔØ!×3Ñ3ˆÔà�=�=Ø‰Gà×3Ñ3ˆGà×× T×%?×%?ÎØ!%×!4Ñ!4ˆDÔà�‰�h §¡Ñ.Õ/rw   c                 óÂ   • 0 nUR                  5        H7  nUR                  SS5      n[        U5      S:”  a  US   X5S   '   M0  SX5S   '   M9     U R                  XU5        g)z¼
Handle a positive response to the I{EHLO} command by parsing the
capabilities in the server's response and then taking the most
appropriate next step towards entering a mail transaction.
Nrd   r   )r  r«   r¬   ÚtryTLS)r²   r  rZ  Úitemsr  rM  s         rv   r}  Ú#ESMTPClient.esmtpState_serverConfigŸ  s_   € ð ˆØ—O‘OÖ%ˆDØ—
‘
˜4 Ó#ˆAÜ�1‹v˜‹zØ ™d�˜‘d“à"�˜‘d“ñ &ð 	�‰�D Õ&rw   c                 óZ  • U R                   nU R                  =(       a    SU;   nU R                  nU(       d  U(       d  U(       d  U R                  XU5        gU(       a<  S/U l        U R
                  U l        U R                  U l        U R                  S5        gU R                  5         g)a  
Take a necessary step towards being able to begin a mail transaction.

The step may be to ask the server to being a TLS session.  If TLS is
already in use or not necessary and not available then the step may be
to authenticate with the server.  If TLS is necessary and not available,
fail the mail transmission attempt.

This is an internal helper method.

@param code: The server status code from the most recently received
    server message.
@type code: L{int}

@param resp: The server status response from the most recently received
    server message.
@type resp: L{bytes}

@param items: A mapping of ESMTP extensions offered by the server.  Keys
    are extension identifiers and values are the associated values.
@type items: L{dict} mapping L{bytes} to L{bytes}

@return: L{None}
ó   STARTTLSr  N)rS  rE  r~  Úauthenticaterâ  ÚesmtpState_starttlsrä  ri  ræ  r  rf  )r²   r  rZ  r…  ÚhasTLSÚcanTLSÚmustTLSs          rv   r„  ÚESMTPClient.tryTLS¯  sƒ   € ðJ —‘ˆØ—‘×6 +°Ñ"6ˆØ×/Ñ/ˆæž&¦GØ×Ñ˜d¨%Õ0ÞØ!˜UˆDŒNØ#×7Ñ7ˆDÔØ!%×!4Ñ!4ˆDÔØ�M‰M˜+Õ&à×!Ñ!Õ#rw   c                 óì   •  U R                   R                  U R                  5        SU l        U R                  X5        g! [         a)    [
        R                  " 5         U R                  S5         NDf = f)zÐ
Handle a positive response to the I{STARTTLS} command by starting a new
TLS session on C{self.transport}.

Upon success, re-handshake with the server to discover what capabilities
it has when TLS is in use.
TrV  N)	rù   ÚstartTLSrE  rS  ro  r+   r[  ri  rz  r÷  s      rv   rŠ  ÚESMTPClient.esmtpState_starttlsâ  s\   € ð	%Ø�N‰N×#Ñ# D§L¡LÔ1Ø ˆDŒMð 	×Ñ˜TÕ(øô ó 	%Ü�GŠGŒIØ×Ñ Ö$ð	%ús   ‚,A  Á 0A3Á2A3c                 ó  • U R                   (       GaD  UR                  S5      (       Ga-  US   R                  5       n0 nU H  nSXVR                  5       '   M     U R                   Hí  nUR                  5       R                  5       nX…;   d  M(  Xpl        US:X  a{  U R                  U l        U R                  U l
        S/U l        [        R                  " U R                  R                  U R                   S5      5      n	U R                  SX‰4-  5          g S/U l        U R                   U l        U R"                  U l
        U R                  SU-   5          g    U R$                  (       a  U R'                  5         g U R                  X5        g )Nó   AUTHrd   ó   PLAINéë   s
   AUTH %s %séN  s   AUTH )rD  Úgetr«   r)  rC  r_  Ú	_authinforÿ  rä  Ú_esmtpState_plainAuthræ  râ  Úbase64Ú	b64encodeÚchallengeResponser  ÚesmtpState_challengers  r€  rc  )
r²   r  rZ  r…  ÚschemesÚ
tmpSchemesr  ra  rb  Ú	challenges
             rv   r‰  ÚESMTPClient.authenticateõ  sN  € Ø�;�;ˆ;˜5Ÿ9™9 W×-Ò-Ø˜G‘n×*Ñ*Ó,ˆGØˆJó �Ø()�
Ÿ7™7›9Ó%ñ ð ×(Ô(�Ø—y‘y“{×(Ñ(Ó*�àÕ%Ø%&”Nð ˜xÓ'Ø+/×+>Ñ+>˜Ô(Ø-1×-GÑ-G˜Ô*Ø*-¨˜œÜ$*×$4Ò$4Ø ŸN™N×<Ñ<¸T¿[¹[È!ÓLó%˜	ð Ÿ™ m°tÐ6GÑ&GÔHñ ð +.¨˜œØ+/×+DÑ+D˜Ô(ð .2×-FÑ-F˜Ô*ØŸ™ h°¡oÔ6Ùñ/ )ð2 ×%×%Ø×"Ñ"Õ$à×Ñ Õ+rw   c                 óô   • U R                   U l        U R                  U l        S/U l        [
        R                  " U R                  R                  U R                  S5      5      nU R                  SU-   5        g )Nr•  rW   s   AUTH PLAIN )rÿ  rä  rl  ræ  râ  rš  r›  r˜  rœ  rD  r  )r²   r  rZ  r   s       rv   r™  Ú!ESMTPClient._esmtpState_plainAuth  s^   € Ø×.Ñ.ˆÔØ!×3Ñ3ˆÔØ˜ˆŒÜ×$Ò$ T§^¡^×%EÑ%EÀdÇkÁkÐSTÓ%UÓVˆ	Ø�‰�n yÑ0Õ1rw   c                 ó<   • U R                  U R                  U5        g r|   )Ú_authResponser˜  r÷  s      rv   r�  Ú ESMTPClient.esmtpState_challenge#  s   € Ø×Ñ˜4Ÿ>™>¨4Õ0rw   c                 ó¤  • U R                   U l         [        R                  " U5      nUR	                  U R
                  U5      nSS/U l        U R                  U l        U R                  [        R                  " U5      5        g ! [        R                   a6    U R                  S5        U R                  U l        U R                  U l         g f = f)Nr•  r–  ó   *)rl  ræ  rš  Ú	b64decoderœ  rD  râ  ÚsmtpState_maybeAuthenticatedrä  r  r›  ÚbinasciiÚErrorrp  )r²   rb  r   rZ  s       rv   r¥  ÚESMTPClient._authResponse&  s¬   € Ø!×3Ñ3ˆÔð	2Ü×(Ò(¨Ó3ˆIð ×)Ñ)¨$¯+©+°yÓAˆDØ! 3˜ZˆDŒNØ#×@Ñ@ˆDÔØ�M‰Mœ&×*Ò*¨4Ó0Õ1øô �~‰~ó 	Bà�M‰M˜$ÔØ#×?Ñ?ˆDÔØ!%×!AÑ!AˆDÖð		Bús   “B ÂACÃCc                 óp   • US:X  a  U ? U R                  X5        gU R                  U R                   U5        g)zÄ
Called to handle the next message from the server after sending a
response to a SASL challenge.  The server response might be another
challenge or it might indicate authentication has succeeded.
r•  N)r˜  rÿ  r¥  r÷  s      rv   rª  Ú(ESMTPClient.smtpState_maybeAuthenticated5  s4   € ð �3‹;à�Ø×Ñ Õ+ð ×Ñ˜tŸ~™~¨tÕ4rw   )r˜  râ  ræ  rä  rS  rC  rE  rD  r|   )rŸ   N) rÍ   rË   rÑ   rÒ   rÓ   r  r€  r~  rE  rS  rµ   rU  rX  r\  rc  rf  ri  rl  rp  rs  rv  r  rz  r}  r„  rŠ  r‰  r™  r�  r¥  rª  rØ   ry   rw   rv   r9   r9   ž  s’   † ñð2 €LØ!ÐØ$ÐØ€GØ€Hô&òò$
(ô
ô&
ô8
ô(
ô$Fô
ô*Hò)ò0ò0ò@'ò 1$òf)ò&%,òN2ò1ò2õ5rw   r9   c                   óp   • \ rS rSrSrSrSrSrSS jrS r	S r
S rS rS	 rS
 rS rS rS rS rS rSrg)r8   iD  NFc                 ó^   • [         R                  U 5        Uc  0 nXl        SU l        X l        g )NF)r<   rµ   ÚchallengersÚauthenticatedÚctx)r²   ÚchalrF  s      rv   rµ   ÚESMTP.__init__K  s+   € Ü�‰�dÔØ‰<ØˆDØÔØ"ˆÔØ!�rw   c                 óÄ   • [         R                  U 5        [        R                  " U R                  5      U l        U R
                  =(       a    U R                  S LU l        g r|   )r<   r  r   ry  rù   ÚcanStartTLSr´  rÄ   s    rv   r  ÚESMTP.connectionMadeS  sC   € Ü×Ñ˜DÔ!Ü(×3Ò3°D·N±NÓCˆÔØ×+Ñ+×F°·±ÀÐ1EˆÕrw   c                 ó2   • [         R                  U 5      S-   $ )Ns    ESMTP)r<   rÿ   rÄ   s    rv   rÿ   ÚESMTP.greetingX  s   € Ü�}‰}˜TÓ" YÑ.Ð.rw   c                 óž   • S[        U R                  R                  5       5      0nU R                  (       a  U R                  (       d  SUS'   U$ )z²
SMTP service extensions

@return: the SMTP service extensions that are supported.
@rtype: L{dict} with L{bytes} keys and a value of either L{None} or a
    L{list} of L{bytes}.
r“  Nrˆ  )r¨   r²  Úkeysr¸  Ú
startedTLS)r²   Úexts     rv   Ú
extensionsÚESMTP.extensions[  s@   € ð œ˜T×-Ñ-×2Ñ2Ó4Ó5Ð6ˆØ×× D§O§OØ#ˆC�ÑØˆ
rw   c                 óˆ   • [        U5      n[        R                  X5      nUc  [        U SUR	                  5       -   S 5      nU$ )NÚext_)r.   r<   r  r  r)  )r²   r*  rL  s      rv   r  ÚESMTP.lookupMethodh  s?   € Ü˜wÓ'ˆä×Ñ˜dÓ,ˆØ‰9Ü˜˜f w§}¡}£Ñ6¸Ó=ˆAØˆrw   c                 ó   • / nU R                  5       R                  5        HJ  u  p#Ub1  U(       a(  UR                  US-   SR                  U5      -   5        M7  M9  UR                  U5        ML     SR                  U5      $ )Nó    rò  )rÀ  r…  r¯   r°   )r²   ÚrÚcÚvs       rv   ÚlistExtensionsÚESMTP.listExtensionsp  sj   € ØˆØ—O‘OÓ%×+Ñ+Ö-‰DˆAØ‰}Þà—H‘H˜Q ™X¨¯	©	°!«Ñ4Ö5ñ ð —‘˜–ñ .ð �z‰z˜!‹}Ðrw   c                 ó0  • U R                   R                  5       R                  n[        U[        5      (       d  UR                  S5      nX4U l        S U l        / U l        U R                  SU R                  S-   U-   S-   U R                  5       -   5        g )Nr6  r7  r8  s   , nice to meet you
)rù   r  rÛ   r•   r–   r‹   rí   rì   rî   rø   rÊ  )r²   r3  r  s      rv   Údo_EHLOÚESMTP.do_EHLO|  s�   € Ø�~‰~×%Ñ%Ó'×,Ñ,ˆä˜$¤×&Ñ&Ø—;‘;˜vÓ&ˆDà�\ˆŒ
ØˆŒ
ØˆŒØ�‰Øà—	‘	Øñàñð *ñ*ð ×%Ñ%Ó'ñ	(õ		
rw   c                 ó2  • U R                   (       a  U R                  SS5        g U R                  (       aP  U R                  (       a?  U R                  SS5        U R                  R                  U R                  5        SU l         g U R                  SS5        g )Nr@  s   TLS already negotiatedr  s   Begin TLS negotiation nowTéÆ  s   TLS not available)r¾  rø   r´  r¸  rù   r�  r2  s     rv   Úext_STARTTLSÚESMTP.ext_STARTTLS�  sb   € Ø�?�?Ø�M‰M˜#Ð8Õ9Ø�X�X˜$×*×*Ø�M‰M˜#Ð;Ô<Ø�N‰N×#Ñ# D§H¡HÔ-Ø"ˆD�Oà�M‰M˜#Ð3Õ4rw   c                 óœ  • U R                   (       a  U R                  SS5        g UR                  S S5      nU R                  R	                  US   R                  5       S 5      " 5       nU(       d  U R                  SS5        g [        U l        X0l        [        U5      S:”  a  UR                  5         US   nOS nU R                  U5        g )Nr@  s   Already authenticatedrd   r   c                  ó   • g r|   ry   ry   rw   rv   r   Ú ESMTP.ext_AUTH.<locals>.<lambda>Ÿ  s   € ¸drw   iø  s    Unrecognized authentication type)r³  rø   r«   r²  r—  r)  r›   rë   r�  r¬   ÚgetChallengeÚ
state_AUTH)r²   r3  r  rµ  s       rv   Úext_AUTHÚESMTP.ext_AUTHš  s¥   € Ø××Ø�M‰M˜#Ð7Ô8ØØ—
‘
˜4 Ó#ˆØ×Ñ×#Ñ# E¨!¡H§N¡NÓ$4±lÔCÓEˆÞØ�M‰M˜#ÐBÔCØäˆŒ	ØŒäˆu‹:˜‹>Ø×ÑÔà˜‘8‰DàˆDØ�‰˜Õrw   c                 ó>   • [         R                  X5      nSU l        U$ )zb
Save the state resulting from a successful cred login and mark this
connection as authenticated.
T)r<   r¡  r³  )r²   Ú	loginInfor—  s      rv   Ú_cbAuthenticatedÚESMTP._cbAuthenticated¯  s!   € ô
 ×0Ñ0°ÓAˆØ!ˆÔØˆrw   c                 óæ   • SU l         UR                  [        R                  R                  5      (       a  U R                  SS5        g[        R                  " US5        U R                  SS5        g)zõ
Handle cred login errors by translating them to the SMTP authenticate
failed.  Translate all other errors into a generic SMTP error code and
log the failure for inspection.  Stop all errors from propagating.

@param reason: Reason for failure.
Ni  s   Authentication failedzSMTP authentication failurerV  rW  )r   rX  r   r
   r¥  rø   r+   r[  rê  s     rv   Ú_ebAuthenticatedÚESMTP._ebAuthenticated¸  sQ   € ð ˆŒØ�<‰<œŸ
™
×4Ñ4×5Ñ5Ø�M‰M˜#Ð7Õ8ä�GŠG�FÐ9Ô:Ø�M‰M˜#ÐUÕVrw   c                 óú  ^ • T R                   c  T R                  SS5        [        T l        gUcC  T R                  R                  5       n[        R                  " U5      nT R                  SU5        gUS:X  a%  T R                  SS5        ST l        [        T l        g [        R                  " U5      nT R                  R                  U5        T R                  R                  5       (       aC  T R                  R                  5       n[        R                  " U5      nT R                  SU5        g[        T l        T R                   R                  T R                  S[        [         5      nUR#                  T R$                  5        UR#                  U 4S	 j5        UR'                  T R(                  5        g! [        [        R                  4 a'    T R                  SS5        ST l        [        T l         gf = f)
zû
Handle one step of challenge/response authentication.

@param response: The text of a response. If None, this
function has been called as a result of an AUTH command with
no initial response. A response of '*' aborts authentication,
as per RFC 2554.
NrÐ  s    Temporary authentication failurer–  r¨  rA  s   Authentication aborteds'   Syntax error in parameters or argumentsc                 ó(   >• TR                  SS5      $ )Nr•  s   Authentication successful.r%  )Úignr²   s    €rv   r   Ú"ESMTP.state_AUTH.<locals>.<lambda>ö  s   ø€ ˜Ÿ™ cÐ+HÔIrw   )r°  rø   r™   rë   r�  rÖ  rš  r›  r©  Ú	TypeErrorr«  r¬  ÚsetResponseÚmoreChallengesr±  r'   r&   r�  rÜ  Ú
addErrbackrß  )r²   Úresponser   ÚencodedÚuncodedÚcodedr—  s   `      rv   r×  ÚESMTP.state_AUTHÇ  s™  ø€ ð �;‰;ÑØ�M‰M˜#ÐBÔCÜˆDŒIØàÑØŸ™×4Ñ4Ó6ˆIÜ×&Ò& yÓ1ˆGØ�M‰M˜#˜wÔ'Øà�tÓØ�M‰M˜#Ð8Ô9Ø"ˆDŒOÜˆDŒIØð	Ü×&Ò& xÓ0ˆGð 	�‰×#Ñ# GÔ,Ø�?‰?×)Ñ)×+Ñ+ØŸ™×4Ñ4Ó6ˆIÜ×$Ò$ YÓ/ˆEØ�M‰M˜#˜uÔ%ØäˆŒ	Ø—‘×"Ñ"Ø�O‰O˜TÔ#:Ô<Ló
ˆð 	×Ñ˜4×0Ñ0Ô1Ø×ÑÜIô	
ð 	×Ñ˜$×/Ñ/Õ0øô+ œ8Ÿ>™>Ð*ó 	Ø�M‰M˜#ÐIÔJØ"ˆDŒOÜˆDŒIÙð		ús   ÂF9 Æ9>G:Ç9G:)rì   rí   rî   r³  r¸  r   r�  r²  r´  rë   r¾  r”   )rÍ   rË   rÑ   rÒ   r´  r¸  r¾  r³  rµ   r  rÿ   rÀ  r  rÊ  rÍ  rÑ  rØ  rÜ  rß  r×  rØ   ry   rw   rv   r8   r8   D  sT   † Ø
€CØ€KØ€Jà€Mô"òGò
/òòò
ò
ò(5òò*òWõ11rw   r8   c                   ó:   • \ rS rSrSrSrS rS rS rS r	S r
S	rg
)r7   iû  z]
Utility class for sending emails easily.

Use with SMTPSenderFactory or ESMTPSenderFactory.
r   c                 ór   • U R                   (       d&  SU l         [        U R                  R                  5      $ g ©Nrd   )Údoner¦   ÚfactoryrR  rÄ   s    rv   r  ÚSenderMixin.getMailFrom  s(   € Ø�y�yØˆDŒIÜ�t—|‘|×-Ñ-Ó.Ð.àrw   c                 ó.   • U R                   R                  $ r|   )rò  ÚtoEmailrÄ   s    rv   r  ÚSenderMixin.getMailTo  s   € Ø�|‰|×#Ñ#Ð#rw   c                 ó.   • U R                   R                  $ r|   )rò  ÚfilerÄ   s    rv   r  ÚSenderMixin.getMailData  s   € Ø�|‰|× Ñ Ð rw   c                 ó4  • [         R                  X5        U R                  R                  S:¼  d1  UR                  (       dX  UR
                  S:¼  a  UR
                  S:  d7  SU R                  l        U R                  R                  R                  U5        g g g )Nr   i�  r$  T)	r=   rí  rò  ÚretriesÚretryr  ÚsendFinishedr—  Úerrbackr7  s     rv   rí  ÚSenderMixin.sendError  sk   € ä×Ñ˜TÔ'ð �<‰<×Ñ 1Ó$Ø—	—	 3§8¡8¨s£?°s·x±xÀ#³~à(,ˆD�L‰LÔ%Ø�L‰L×Ñ×'Ñ'¨Õ,ð 8F�	rw   c                 óÒ  • SU R                   l        U[        ;  a¦  / nU H<  u  pxn	U[        ;  d  M  UR                  US-   [	        SU4-  5      -   S-   U	-   5        M>     UR                  UR
                  " 5       5        [        XSR                  U5      U5      n
U R                   R                  R                  U
5        g U R                   R                  R                  X445        g )NTrU  z%03drÆ  rò  )rò  rý  rþ  r¯   r/   r¦   r   r°   r—  rþ  Úcallback)r²   r  rZ  r:  r;  r+   Úerrlogr—   ÚacodeÚarespr¨  s              rv   r"  ÚSenderMixin.sentMail   s¿   € à$(ˆ�‰Ô!Ø”wÓØˆFÛ&/Ñ"�˜UØ¤Õ'Ø—M‘MØ˜u™¤}°V¸u¸hÑ5FÓ'GÑGÈ$ÑNÐQVÑVöñ '0ð �M‰M˜#Ÿ'š'›)Ô$ä# D°·
±
¸6Ó0BÀIÓNˆCØ�L‰L×Ñ×'Ñ'¨Õ,à�L‰L×Ñ×(Ñ(¨%Ð);Õ<rw   )rñ  N)rÍ   rË   rÑ   rÒ   rÓ   rñ  r  r  r  rí  r"  rØ   ry   rw   rv   r7   r7   û  s'   † ñð €Dòò$ò!ò-õ=rw   r7   c                   ó   • \ rS rSrSrSrg)r?   i3  zp
SMTP protocol that sends a single email based on information it
gets from its factory, a L{SMTPSenderFactory}.
ry   N)rÍ   rË   rÑ   rÒ   rÓ   rØ   ry   rw   rv   r?   r?   3  s   † ôrw   r?   c                   ó`   • \ rS rSr% Sr\r\r\	\
   \S'   SS jrS rS rS rS	 rS
 rS rSrg)r@   i:  a‹  
Utility factory for sending emails easily.

@type currentProtocol: L{SMTPSender}
@ivar currentProtocol: The current running protocol returned by
    L{buildProtocol}.

@type sendFinished: C{bool}
@ivar sendFinished: When the value is set to True, it means the message has
    been sent or there has been an unrecoverable error or the sending has
    been cancelled. The default value is False.
r   Nc                 ó"  • [        U[        5      (       d   e[        U[        5      (       a  UR                  S5      /nO][        U[        5      (       a  U/nOD/ nU H:  n[        U[        5      (       d  UR                  S5      nUR                  U5        M<     Un[        U5      U l        [        U5      U l	        X l
        X0l        X@l        U R                  R                  U R                  5        SU l        SU l        U* U l        X`l        g)a  
@param fromEmail: The RFC 2821 address from which to send this
message.

@param toEmail: A sequence of RFC 2821 addresses to which to
send this message.

@param file: A file-like object containing the message to send.

@param deferred: A Deferred to callback or errback when sending
of this message completes.
@type deferred: L{defer.Deferred}

@param retries: The number of times to retry delivery of this
message.

@param timeout: Period, in seconds, for which to wait for
server responses, or None to wait forever.
rJ   FN)r•   ro   r¦   r‹   r–   r¯   r4   rR  r¬   ÚnEmailsrõ  rø  r—  ÚaddBothÚ_removeDeferredrý  ÚcurrentProtocolrû  r  )	r²   rR  rõ  rø  Údeferredrû  r  ÚtoEmailFinalÚ_emails	            rv   rµ   ÚSMTPSenderFactory.__init__K  sä   € ô( ˜'¤3×'Ñ'Ð'Ð'ä�gœs×#Ñ#Ø—~‘~ gÓ.Ð/‰GÜ˜¤×'Ñ'Ø�i‰GàˆLÛ!�Ü! &¬%×0Ñ0Ø#Ÿ]™]¨7Ó3�Fà×#Ñ# FÖ+ñ	 "ð
 #ˆGä  Ó+ˆŒÜ˜7“|ˆŒØŒØŒ	ØŒØ�‰×Ñ˜D×0Ñ0Ô1Ø!ˆÔØ#ˆÔà�xˆŒØ�rw   c                 ó
   • U ? U$ r|   )r—  ©r²   r—  s     rv   r  Ú!SMTPSenderFactory._removeDeferredz  s   € ØˆKØˆrw   c                 ó&   • U R                  X5        g r|   ©Ú_processConnectionError©r²   Ú	connectorr[  s      rv   ÚclientConnectionFailedÚ(SMTPSenderFactory.clientConnectionFailed~  ó   € Ø×$Ñ$ YÕ4rw   c                 ó&   • U R                  X5        g r|   r  r  s      rv   ÚclientConnectionLostÚ&SMTPSenderFactory.clientConnectionLost�  r  rw   c                 óø  • S U l         U R                  S:  aw  U R                  (       df  [        R                  " SU R                  * -  5        U R
                  R                  SS5        UR                  5         U =R                  S-  sl        g U R                  (       d[  UR                  [        R                  5      (       a  [        SS5      Ul        U R                  R                  UR                  5        g g )Nr   z&SMTP Client retrying server. Retry: %srd   rŸ   zUnable to connect to server.)r  rû  rý  r+   rû   rø  ÚseekÚconnectrX  r
   ÚConnectionDoner   rY  r—  rþ  r  s      rv   r  Ú)SMTPSenderFactory._processConnectionError„  s®   € Ø#ˆÔØ�L‰L˜1Ó t×'8×'8Ü�GŠGÐ<ÀÇÁ¸}ÑLÔMð �I‰I�N‰N˜1˜aÔ Ø×ÑÔØ�LŠL˜AÑŽLØ×"×"ð �y‰yœ×-Ñ-×.Ñ.Ü,¨RÐ1OÓP�”	Ø�K‰K×Ñ §	¡	Õ*ð #rw   c                 óâ   • U R                  U R                  U R                  S-  S-   5      nXl        U R                  Ul        X l        U R                  R                  U R                  5        U$ )NrW   )	r   r±   r	  rò  r  r  r—  r
  Ú_removeProtocolrÒ  s      rv   rÑ  ÚSMTPSenderFactory.buildProtocol•  sW   € Ø�M‰M˜$Ÿ+™+ t§|¡|°aÑ'7¸!Ñ';Ó<ˆØŒ	Ø—L‘LˆŒ	Ø ÔØ�‰×Ñ˜D×0Ñ0Ô1Øˆrw   c                 ó6   • U R                   (       a  SU l         U$ )z¯
Remove the protocol created in C{buildProtocol}.

@param result: The result/error passed to the callback/errback of
    L{defer.Deferred}.

@return: The C{result} untouched.
N)r  r  s     rv   r%  Ú!SMTPSenderFactory._removeProtocol�  s   € ð ××Ø#'ˆDÔ Øˆrw   )	r  rø  rR  r	  r—  rû  rý  r  rõ  )rg   N)rÍ   rË   rÑ   rÒ   rÓ   r‰   r±   r?   r   r   r=   Ú__annotations__rµ   r  r  r  r  rÑ  r%  rØ   ry   rw   rv   r@   r@   :  sA   ‡ ñð €FØ!+€Hˆd�:ÑÓ+ô-ò^ò5ò5ò+ò"õrw   r@   c                   ó   • \ rS rSrSrS rSrg)r   i«  a  
L{LOGINCredentials} generates challenges for I{LOGIN} authentication.

For interoperability with Outlook, the challenge generated does not exactly
match the one defined in the
U{draft specification<http://sepp.oetiker.ch/sasl-2.1.19-ds/draft-murchison-sasl-login-00.txt>}.
c                 óB   • [         R                  " U 5        SS/U l        g )Ns	   Password:s	   Username:)Ú_lcredentialsrµ   Ú
challengesrÄ   s    rv   rµ   ÚLOGINCredentials.__init__´  s   € Ü×Ò˜tÔ$Ø'¨Ð6ˆ�rw   )r-  N)rÍ   rË   rÑ   rÒ   rÓ   rµ   rØ   ry   rw   rv   r   r   «  s   † ñõ7rw   r   c                   ó*   • \ rS rSrS rS rSS jrSrg)r3   i¹  c                 ó   • Xl         g r|   ©re  r¶  s     rv   rµ   ÚPLAINAuthenticator.__init__»  s   € Ø�	rw   c                 ó   • g)Nr”  ry   rÄ   s    rv   r_  ÚPLAINAuthenticator.getName¾  s   € Ørw   c                 ó|   • US:X  a"  U R                   S-   U R                   -   S-   U-   $ SU R                   -   S-   U-   $ )Nrd   ó    r1  )r²   rD  rµ  s      rv   rœ  Ú$PLAINAuthenticator.challengeResponseÁ  sD   € Ø�1‹9Ø—9‘9˜uÑ$ t§y¡yÑ0°5Ñ8¸6ÑAÐAà˜4Ÿ9™9Ñ$ uÑ,¨vÑ5Ð5rw   r1  N)rd   )rÍ   rË   rÑ   rÒ   rµ   r_  rœ  rØ   ry   rw   rv   r3   r3   ¹  s   † òò÷6rw   r3   c                   ó2   • \ rS rSrSrSrSS jrS rS rSr	g)	r:   iÈ  TNc                 óÈ   • SU l         Xl        UR                  SS 5      U l        Uc  U R	                  5       n[
        R                  " XU/UQ70 UD6  U R                  5         g )Nr   Úhostname)r  ÚusernameÚpopÚ	_hostnameÚ_getContextFactoryr9   rµ   Ú_registerAuthenticators)r²   r;  rD  rF  rG  rH  s         rv   rµ   ÚESMTPSender.__init__Ì  s[   € ØˆÔØ ŒàŸ™ 
¨DÓ1ˆŒàÑ!Ø!×4Ñ4Ó6ˆNä×Ò˜T¨>ÐG¸DÒGÀBÒGà×$Ñ$Õ&rw   c                 óÜ   • U R                  [        U R                  5      5        U R                  [        U R                  5      5        U R                  [	        U R                  5      5        g r|   )rv  r   r;  r   r3   rÄ   s    rv   r?  Ú#ESMTPSender._registerAuthenticatorsÙ  sJ   € à×"Ñ"Ô#=¸d¿m¹mÓ#LÔMØ×"Ñ"Ô#5°d·m±mÓ#DÔEØ×"Ñ"Ô#5°d·m±mÓ#DÕErw   c                 ó¦   • U R                   b  U R                   $ U R                  c  g  SSKJn  U" U R                  5      nU$ ! [         a     g f = f)Nr   )ÚoptionsForClientTLS)rE  r=  Útwisted.internet.sslrD  ÚImportError)r²   rD  rE  s      rv   r>  ÚESMTPSender._getContextFactoryß  sT   € Ø�<‰<Ñ#Ø—<‘<ÐØ�>‰>Ñ!Øð	Ý@ñ *¨$¯.©.Ó9ˆGØˆNøô	 ó 	Ùð	ús   ©A Á
AÁA)r=  r  r;  r|   )
rÍ   rË   rÑ   rÒ   r€  r~  rµ   r?  r>  rØ   ry   rw   rv   r:   r:   È  s   † Ø ÐØ#Ðô'òFõrw   r:   c                   ó:   • \ rS rSrSr\r       SS jrS rSr	g)r;   ií  z¨
Utility factory for sending emails easily.

@type currentProtocol: L{ESMTPSender}
@ivar currentProtocol: The current running protocol as made by
    L{buildProtocol}.
Nc           	      óˆ   • [         R                  XXEXgU5        Xl        X l        X�l        X l        X°l        XÀl        XÐl        g r|   )	r@   rµ   r;  ÚpasswordÚ_contextFactoryÚ_heloFallbackÚ_requireAuthenticationÚ_requireTransportSecurityr=  )r²   r;  rJ  rR  rõ  rø  r  rû  r  rF  r  r€  r~  r:  s                 rv   rµ   ÚESMTPSenderFactory.__init__ø  sD   € ô  	×"Ñ"Ø˜W¨H¸wô	
ð !ŒØ ŒØ-ÔØ)ÔØ&;Ô#Ø)AÔ&Ø!�rw   c           	      óœ  • U R                  U R                  U R                  U R                  U R                  U R
                  S-  S-   U R                  S9nU R                  Ul        U R                  Ul
        U R                  Ul        Xl        U R                  Ul        X l        U R                   R#                  U R$                  5        U$ )zù
Build an L{ESMTPSender} protocol configured with C{heloFallback},
C{requireAuthentication}, and C{requireTransportSecurity} as specified
in L{__init__}.

This sets L{currentProtocol} on the factory, as well as returning it.

@rtype: L{ESMTPSender}
rW   )r:  )r   r;  rJ  rK  r±   r	  r=  rL  r  rM  r€  rN  r~  rò  r  r  r—  r
  r%  rÒ  s      rv   rÑ  Ú ESMTPSenderFactory.buildProtocol  s«   € ð �M‰MØ�M‰MØ�M‰MØ× Ñ Ø�K‰KØ�L‰L˜1Ñ˜qÑ Ø—^‘^ð ð 
ˆð ×+Ñ+ˆŒØ"&×"=Ñ"=ˆÔØ%)×%CÑ%CˆÔ"ØŒ	Ø—L‘LˆŒ	Ø ÔØ�‰×Ñ˜D×0Ñ0Ô1Øˆrw   )rK  rL  r=  rM  rN  r  rJ  r;  )rg   NNFTTN)
rÍ   rË   rÑ   rÒ   rÓ   r:   r   rµ   rÑ  rØ   ry   rw   rv   r;   r;   í  s/   † ñð €Hð ØØØØ"Ø!%Øô"õ6rw   r;   é   Fc                 óÚ  ^^• [        US5      (       d  [        [        U5      5      nUU4S jn[        R                  " U5      n[        U[        5      (       a  UR                  S5      n[        U[        5      (       a  UR                  S5      nU n[        U[        5      (       d  [        U5      n[        UUUUUUSU	U
US9
mUb  [        U5      Tl        UR                  " XT5      mU$ )až	  
Send an email.

This interface is intended to be a replacement for L{smtplib.SMTP.sendmail}
and related methods. To maintain backwards compatibility, it will fall back
to plain SMTP, if ESMTP support is not available. If ESMTP support is
available, it will attempt to provide encryption via STARTTLS and
authentication if a secret is provided.

@param smtphost: The host the message should be sent to.
@type smtphost: L{bytes}

@param from_addr: The (envelope) address sending this mail.
@type from_addr: L{bytes}

@param to_addrs: A list of addresses to send this mail to.  A string will
    be treated as a list of one address.
@type to_addrs: L{list} of L{bytes} or L{bytes}

@param msg: The message, including headers, either as a file or a string.
    File-like objects need to support read() and close(). Lines must be
    delimited by '\n'. If you pass something that doesn't look like a file,
    we try to convert it to a string (so you should be able to pass an
    L{email.message} directly, but doing the conversion with
    L{email.generator} manually will give you more control over the process).

@param senderDomainName: Name by which to identify. If None, try to pick
    something sane (but this depends on external configuration and may not
    succeed).
@type senderDomainName: L{bytes}

@param port: Remote port to which to connect.
@type port: L{int}

@param username: The username to use, if wanting to authenticate.
@type username: L{bytes} or L{unicode}

@param password: The secret to use, if wanting to authenticate. If you do
    not specify this, SMTP authentication will not occur.
@type password: L{bytes} or L{unicode}

@param requireTransportSecurity: Whether or not STARTTLS is required.
@type requireTransportSecurity: L{bool}

@param requireAuthentication: Whether or not authentication is required.
@type requireAuthentication: L{bool}

@param reactor: The L{reactor} used to make the TCP connection.

@rtype: L{Deferred}
@returns: A cancellable L{Deferred}, its callback will be called if a
    message is sent to ANY address, the errback if no message is sent. When
    the C{cancel} method is called, it will stop retrying and disconnect
    the connection immediately.

    The callback will be called with a tuple (numOk, addresses) where numOk
    is the number of successful recipient addresses and addresses is a list
    of tuples (address, code, resp) giving the response to the RCPT command
    for each address.
Úreadc                 ó    >• STl         TR                  (       a%  TR                  R                  R                  5         gTR	                  5         g)zŸ
Cancel the L{twisted.mail.smtp.sendmail} call, tell the factory not to
retry and disconnect the connection.

@param d: The L{defer.Deferred} to be cancelled.
TN)rý  r  rù   ÚabortConnectionÚ
disconnect)rf  r  rò  s    €€rv   ÚcancelÚsendmail.<locals>.cancel|  s<   ø€ ð  $ˆÔØ×"×"Ø×#Ñ#×-Ñ-×=Ñ=Õ?ð × Ñ Õ"rw   zutf-8T)r  r€  r~  r:  )Úhasattrr   r–   r	   ÚDeferredr•   r¦   r‹   r   r;   r/   r±   Ú
connectTCP)ÚsmtphostÚ	from_addrÚto_addrsrû   ÚsenderDomainNameÚportr   r;  rJ  r€  r~  rX  rf  ÚtlsHostnamer  rò  s                 @@rv   r6   r6   /  sÜ   ù€ ôR �3˜×Ñä”e˜C“jÓ!ˆö#ô 	�Š�vÓ€Aä�(œC× Ñ Ø—?‘? 7Ó+ˆÜ�(œC× Ñ Ø—?‘? 7Ó+ˆà€KÜ�k¤3×'Ñ'Ü Ó,ˆä ØØØØØØ	ØØ3Ø!9Øñ€Gð Ñ#Ü&Ð'7Ó8ˆŒà×"Ò" 8°7Ó;€Ià€Hrw   c                 ó  • / n[        U 5       Ha  n[        U5      nUS:X  d  US:X  d  US:  d  US:”  a   UR                  [        SUS 35      5        MF  UR                  [	        U45      5        Mc     SR                  U5      [        U 5      4$ )NÚ+Ú=é!   é~   Ú02Xrw   )r-   Úordr¯   r/   r–   r°   r¬   )r  ÚerrorsrÇ  ÚchÚos        rv   rI   rI   ­  s{   € Ø
€AÜ˜ŽlˆÜ�‹GˆØ�‹9˜˜c›	 Q¨£V¨q°3«wØ�H‰H”] Q q¨ g ;Ó/Ö0à�H‰H”U˜A˜4“[Ö!ñ ð �H‰H�Q‹Kœ˜Q›Ð Ð rw   c                 óÔ  • / nSnU[        U 5      :  a‹  XUS-    S:X  a<   UR                  [        [        [	        XS-   US-    5      S5      5      5        US-  nO3UR                  [	        XUS-    5      R                  S5      5        US-  nU[        U 5      :  a  M‹  SR                  U5      [        U 5      4$ ! [
         a"    UR                  [        XUS-    5      5         N‘f = f)z�
Decode the xtext-encoded string C{s}.

@param s: String to decode.
@param errors: codec error handling scheme.
@return: The decoded string.
r   rd   ó   +re   é   rJ   r�   )	r¬   r¯   Úchrro   r–   ró  ri  rŠ   r°   )r  rj  rÇ  rz   s       rv   rH   rH   ¸  sà   € ð 	€AØ	€AØ
Œc�!‹f‹*Ø��Q‘ˆ<˜4Óð,Ø—‘œœS¤ q¨Q©°°Q±Ð'7Ó!8¸"Ó=Ó>Ô?ð �‰F‰Aà�H‰H”U˜1  Q¡˜<Ó(×/Ñ/°Ó8Ô9Ø�‰FˆAð Œc�!‹f�*ð �G‰G�A‹Jœ˜A›ÐÐøô ó ,Ø—‘œ˜Q 1 q¡5˜\Ó*Ö+ð,ús    5B; Â;)C'Ã&C'c                   ó   • \ rS rSrSS jrSrg)rE   iÏ  c                 ó   • [        U5      $ r|   )rH   ©r²   r  rj  s      rv   rŠ   ÚxtextStreamReader.decodeÐ  ó   € Ü˜A‹Ðrw   ry   N©Ústrict©rÍ   rË   rÑ   rÒ   rŠ   rØ   ry   rw   rv   rE   rE   Ï  ó   † ÷rw   rE   c                   ó   • \ rS rSrSS jrSrg)rF   iÔ  c                 ó   • [        U5      $ r|   )rI   rs  s      rv   rŠ   ÚxtextStreamWriter.decodeÕ  ru  rw   ry   Nrv  rx  ry   rw   rv   rF   rF   Ô  ry  rw   rF   c                 ó<   • U S:X  a  [         [        [        [        4$ g )NÚxtext)rI   rH   rE   rF   )rT  s    rv   rG   rG   Ù  s   € ØˆwƒÜœlÔ,=Ô?PÐQÐQð rw   rð  r|   )yrÓ   rš  r«  r„   r†   rÔ   Úsocketrh   rP  Úemail.utilsr   Úior   Útypingr   Úzope.interfacer   Útwistedr   Útwisted.copyrightr   Útwisted.internetr	   r
   r   r   Útwisted.internet._idnar   Útwisted.internet.interfacesr   r   Útwisted.mail._credr   r   r   r,  Útwisted.mail._exceptr   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r1   r$   Útwisted.mail.interfacesr%   r&   r'   r(   r2   Útwisted.protocolsr)   r*   Útwisted.pythonr+   r,   Útwisted.python.compatr-   r.   r/   Útwisted.python.runtimer0   Ú__all__ÚisMacOSXÚgethostnamer‹   r‰   ÚgetfqdnÚdictÚfromkeysr  rþ  rD   rA   r~   rB   rC   r™   rš   r›   rÖ   r4   r5   ÚLineOnlyReceiverÚTimeoutMixinr<   rÐ  r>   rß  r=   r9   r8   r7   r?   ÚClientFactoryr@   r3   r:   r;   r6   ÚcodecsrI   rH   ÚStreamReaderrE   ÚStreamWriterrF   rG   Úregisterry   rw   rv   Ú<module>r�     s{  ðñó
 Û Û 	Û Û 	Û Û Û Ý !Ý Ý å &å Ý )ß <Ó <Ý ,ß D÷ñ ÷
÷ ÷ ÷ ÷ ÷(ó ÷ .ß $ß HÑ HÝ +ò1€ðl ×Ò×Ñð × Ò Ó"×)Ñ)¨'Ó2�Gà�nŠnÓ×%Ñ% gÓ.€Gð �-‰-™˜c 3›Ó
(€ô9òxñ ƒ}€ð Ñ-ô ò*4ð* 0Ñ €ˆˆtð +€÷p
ñ p
÷f% ñ % ôPkEˆ5×!Ñ! 8×#8Ñ#8ô kEô\�(×(Ñ(ô ô,A�×#Ñ# X×%:Ñ%:ô AôHc5�*ô c5ôLt1ˆDô t1÷n5=ñ 5=ôp�˜jô ôn˜×.Ñ.ô nôb7�}ô 7ñ Ð"Ó#÷6ð 6ó $ð6ô"�+˜{ô "ôJ?Ð*ô ?ðN Ø	ØØØØØ"ôxóv ô!ô ô.˜×+Ñ+ô ô
˜×+Ñ+ô ò
Rð
 ‡‚�Õ rw   