ó
    Ö›‘hº]  ã                   ó.  • S r SSKrSSKrSSKJr  SSKJrJrJr  SSK	J
r
  SSKJr  SSKJrJr  S rSS	 jr " S
 S5      r\" \5       " S S\5      5       r\" \
R(                  5       " S S5      5       r\" \5       " S S\5      5       r " S S\5      r\" \
R(                  5       " S S5      5       r " S S\R4                  5      r\" \5       " S S\5      5       r\" \
R(                  5       " S S5      5       r\" \5       " S S\5      5       rg)zD
Support for aliases(5) configuration files.

@author: Jp Calderone
é    N)Úimplementer)ÚdeferÚprotocolÚreactor)Úsmtp)ÚIAlias)ÚfailureÚlogc                 óz  • UR                  SS5       Vs/ s H  oDR                  5       PM     nn[        U5      S:w  a  SnX24n[        R                  " Xg-  5        gUu  p‰U R                  UR                  5       / 5      R                  [        [        R                  U	R                  S5      5      5        gs  snf )aÄ  
Parse a line from an aliases file.

@type result: L{dict} mapping L{bytes} to L{list} of L{bytes}
@param result: A dictionary mapping username to aliases to which
    the results of parsing the line are added.

@type line: L{bytes}
@param line: A line from an aliases file.

@type filename: L{bytes}
@param filename: The full or relative path to the aliases file.

@type lineNo: L{int}
@param lineNo: The position of the line within the aliases file.
Ú:é   é   z+Invalid format on line %d of alias file %s.Ú,N)	ÚsplitÚstripÚlenr
   ÚerrÚ
setdefaultÚextendÚmapÚstr)
ÚresultÚlineÚfilenameÚlineNoÚpÚpartsÚfmtÚargÚuserÚaliass
             ÚVC:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\twisted/mail/alias.pyÚhandler#      s�   € ð" !%§
¡
¨3°Ô 2Ó3Ò 2˜1�W‰WŽYÑ 2€EÐ3Ü
ˆ5ƒz�QƒØ;ˆØÐ ˆÜ�Š�‘	Õà‰ˆØ×Ñ˜$Ÿ*™*›,¨Ó+×2Ñ2´3´s·y±yÀ%Ç+Á+ÈcÓBRÓ3SÕTùò 4s   •B8c                 óF  • 0 nSnUc  [        U5      nSnO[        USS5      nSnSn U H…  nUS-  nUR                  5       nUR                  5       R	                  S5      (       a  M>  UR	                  S	5      (       d  UR	                  S
5      (       a  Xg-   nMp  U(       a  [        X6X5        UnM‡     U(       a  UR                  5         U(       a  [        X6X5        UR                  5        H  u  p‰[        X�U5      X8'   M     U$ ! U(       a  UR                  5         f f = f)a:  
Load a file containing email aliases.

Lines in the file should be formatted like so::

     username: alias1, alias2, ..., aliasN

Aliases beginning with a C{|} will be treated as programs, will be run, and
the message will be written to their stdin.

Aliases beginning with a C{:} will be treated as a file containing
additional aliases for the username.

Aliases beginning with a C{/} will be treated as the full pathname to a file
to which the message will be appended.

Aliases without a host part will be assumed to be addresses on localhost.

If a username is specified multiple times, the aliases for each are joined
together as if they had all been on one line.

Lines beginning with a space or a tab are continuations of the previous
line.

Lines beginning with a C{#} are comments.

@type domains: L{dict} mapping L{bytes} to L{IDomain} provider
@param domains: A mapping of domain name to domain object.

@type filename: L{bytes} or L{None}
@param filename: The full or relative path to a file from which to load
    aliases. If omitted, the C{fp} parameter must be specified.

@type fp: file-like object or L{None}
@param fp: The file from which to load aliases. If specified,
    the C{filename} parameter is ignored.

@rtype: L{dict} mapping L{bytes} to L{AliasGroup}
@return: A mapping from username to group of aliases.
FTÚnamez	<unknown>r   Ú r   Ú#Ú Ú	)	ÚopenÚgetattrÚrstripÚlstripÚ
startswithr#   ÚcloseÚitemsÚ
AliasGroup)
Údomainsr   Úfpr   r/   ÚiÚprevr   ÚuÚas
             r"   ÚloadAliasFiler8   3   s  € ðR €FØ€EØ	�zÜ�(‹^ˆØ‰ä˜2˜v {Ó3ˆØ	€AØ€DðÛˆDØ�‰FˆAØ—;‘;“=ˆDØ�{‰{‹}×'Ñ'¨×,Ñ,ÙØ—‘ ×%Ñ%¨¯©¸×)>Ñ)>Ø‘{’æÜ˜6¨Ô5Ø’ñ ö Ø�H‰HŒJÞÜˆv˜XÔ)Ø—‘–‰ˆÜ˜q¨1Ó-ˆ‹	ñ à€Møö Ø�H‰H�Jð ús   ¨BD ÄD c                   ó.   • \ rS rSrSrS rS rSS jrSrg)	Ú	AliasBaseé{   z–
The default base class for aliases.

@ivar domains: See L{__init__}.

@type original: L{Address}
@ivar original: The original address being aliased.
c                 óF   • Xl         [        R                  " U5      U l        g)zÊ
@type domains: L{dict} mapping L{bytes} to L{IDomain} provider
@param domains: A mapping of domain name to domain object.

@type original: L{bytes}
@param original: The original address being aliased.
N)r2   r   ÚAddressÚoriginal)Úselfr2   r>   s      r"   Ú__init__ÚAliasBase.__init__…   s   € ð ŒÜŸš XÓ.ˆ�ó    c                 óH   • U R                   U R                  R                     $ )z€
Return the domain associated with original address.

@rtype: L{IDomain} provider
@return: The domain for the original address.
)r2   r>   Údomain©r?   s    r"   rD   ÚAliasBase.domain�   s   € ð �|‰|˜DŸM™M×0Ñ0Ñ1Ð1rB   Nc                 óh   • Uc  0 n[        U 5      U;   a  gSU[        U 5      '   U R                  5       $ ©a  
Map this alias to its ultimate destination.

@type aliasmap: L{dict} mapping L{bytes} to L{AliasBase}
@param aliasmap: A mapping of username to alias or group of aliases.

@type memo: L{None} or L{dict} of L{AliasBase}
@param memo: A record of the aliases already considered in the
    resolution process.  If provided, C{memo} is modified to include
    this alias.

@rtype: L{IMessage <smtp.IMessage>} or L{None}
@return: A message receiver for the ultimate destination or None for
    an invalid destination.
N)r   ÚcreateMessageReceiver©r?   ÚaliasmapÚmemos      r"   ÚresolveÚAliasBase.resolve™   s9   € ð  ‰<ØˆDÜˆt‹9˜ÓØØˆŒS�‹Y‰Ø×)Ñ)Ó+Ð+rB   )r2   r>   ©N)	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r@   rD   rM   Ú__static_attributes__© rB   r"   r:   r:   {   s   † ñò	/ò2÷,rB   r:   c                   ó<   • \ rS rSrSrS rS\4S jrS rS
S jr	S	r
g)ÚAddressAliasé±   z{
An alias which translates one email address into another.

@type alias : L{Address}
@ivar alias: The destination address.
c                 óh   • [         R                  " U /UQ76   [        R                  " U5      U l        g)a  
@type alias: L{Address}, L{User}, L{bytes} or object which can be
    converted into L{bytes}
@param alias: The destination address.

@type args: 2-L{tuple} of (0) L{dict} mapping L{bytes} to L{IDomain}
    provider, (1) L{bytes}
@param args: Arguments for L{AliasBase.__init__}.
N)r:   r@   r   r=   r!   )r?   r!   Úargss      r"   r@   ÚAddressAlias.__init__º   s'   € ô 	×Ò˜4Ð' $Ó'Ü—\’\ %Ó(ˆ�
rB   Úreturnc                 ó"   • SU R                    S3$ )z‰
Build a string representation of this L{AddressAlias} instance.

@rtype: L{bytes}
@return: A string containing the destination address.
z	<Address Ú>©r!   rE   s    r"   Ú__str__ÚAddressAlias.__str__Ç   s   € ð ˜4Ÿ:™:˜, aÐ(Ð(rB   c                 óf   • U R                  5       R                  [        U R                  5      5      $ )z›
Create a message receiver which delivers a message to
the destination address.

@rtype: L{IMessage <smtp.IMessage>} provider
@return: A message receiver.
)rD   Úexistsr   r!   rE   s    r"   rI   Ú"AddressAlias.createMessageReceiverÐ   s#   € ð �{‰{‹}×#Ñ#¤C¨¯
©
£OÓ4Ð4rB   Nc                 óŽ  • Uc  0 n[        U 5      U;   a  gSU[        U 5      '    U R                  5       R                  [        R                  " U R
                  SSS5      U5      " 5       $ ! [        R                   a     Of = fU R
                  R                  U;   a'  XR
                  R                     R                  X5      $ grH   )	r   rD   rd   r   ÚUserr!   ÚSMTPBadRcptÚlocalrM   rJ   s      r"   rM   ÚAddressAlias.resolveÚ   sª   € ð  ‰<ØˆDÜˆt‹9˜ÓØØˆŒS�‹Y‰ð	Ø—;‘;“=×'Ñ'¬¯	ª	°$·*±*¸dÀDÈ$Ó(OÐQUÔVÓXÐXøÜ×Ñó 	Ùð	úà�:‰:×Ñ˜xÓ'ØŸJ™J×,Ñ,Ñ-×5Ñ5°hÓEÐEØs   ¥AA+ Á+BÂBr`   rO   )rP   rQ   rR   rS   rT   r@   r   ra   rI   rM   rU   rV   rB   r"   rX   rX   ±   s"   † ñò)ð)˜ô )ò5÷rB   rX   c                   ó>   • \ rS rSrSrS rS rS rS rS\	4S jr
S	rg
)ÚFileWrapperéø   zü
A message receiver which delivers a message to a file.

@type fp: file-like object
@ivar fp: A file used for temporary storage of the message.

@type finalname: L{bytes}
@ivar finalname: The name of the file in which the message should be
    stored.
c                 óD   • [         R                  " 5       U l        Xl        g)zk
@type filename: L{bytes}
@param filename: The name of the file in which the message should be
    stored.
N)ÚtempfileÚTemporaryFiler3   Ú	finalname)r?   r   s     r"   r@   ÚFileWrapper.__init__  s   € ô ×(Ò(Ó*ˆŒØ!�rB   c                 ó@   • U R                   R                  US-   5        g)zq
Write a received line to the temporary file.

@type line: L{bytes}
@param line: A received line of the message.
Ú
N)r3   Úwrite©r?   r   s     r"   ÚlineReceivedÚFileWrapper.lineReceived  s   € ð 	�‰�‰�d˜T‘kÕ"rB   c                 óØ  • U R                   R                  SS5         [        U R                  S5      nU   UR                  U R                   R                  5       5        U R                   R                  5         SSS5        [
        R                  " U R                  5      $ ! [         a,    [
        R                  " [        R                  " 5       5      s $ f = f! , (       d  f       Ng= f)a+  
Handle end of message by writing the message to the file.

@rtype: L{Deferred <defer.Deferred>} which successfully results in
    L{bytes}
@return: A deferred which succeeds with the name of the file to which
    the message has been stored or fails if the message cannot be
    saved to the file.
r   r7   N)r3   Úseekr*   rq   ÚBaseExceptionr   Úfailr	   ÚFailureru   Úreadr/   Úsucceed)r?   Úfs     r"   ÚeomReceivedÚFileWrapper.eomReceived  sœ   € ð 	�‰�‰�Q˜Ôð	1Ü�T—^‘^ SÓ)ˆAò Ø�G‰G�D—G‘G—L‘L“NÔ#Ø�G‰G�M‰MŒO÷ ô �}Š}˜TŸ^™^Ó,Ð,øô ó 	1Ü—:’:œgŸošoÓ/Ó0Ò0ð	1ú÷ �Qús   žB" ¶ACÂ"3CÃCÃ
C)c                 óF   • U R                   R                  5         SU l         g)z7
Close the temporary file when the connection is lost.
N)r3   r/   rE   s    r"   ÚconnectionLostÚFileWrapper.connectionLost-  s   € ð 	�‰�‰ŒØˆ�rB   r]   c                 ó"   • SU R                    S3$ )z�
Build a string representation of this L{FileWrapper} instance.

@rtype: L{bytes}
@return: A string containing the file name of the message.
z<FileWrapper r_   )rq   rE   s    r"   ra   ÚFileWrapper.__str__4  s   € ð ˜tŸ~™~Ð.¨aÐ0Ð0rB   )rq   r3   N©rP   rQ   rR   rS   rT   r@   rw   r�   r„   r   ra   rU   rV   rB   r"   rl   rl   ø   s'   † ñ	ò"ò#ò-ò,ð1˜÷ 1rB   rl   c                   ó2   • \ rS rSrSrS rS\4S jrS rSr	g)	Ú	FileAliasi>  zS
An alias which translates an address to a file.

@ivar filename: See L{__init__}.
c                 ó>   • [         R                  " U /UQ76   Xl        g)zò
@type filename: L{bytes}
@param filename: The name of the file in which to store the message.

@type args: 2-L{tuple} of (0) L{dict} mapping L{bytes} to L{IDomain}
    provider, (1) L{bytes}
@param args: Arguments for L{AliasBase.__init__}.
N)r:   r@   r   )r?   r   r[   s      r"   r@   ÚFileAlias.__init__F  s   € ô 	×Ò˜4Ð' $Ó'Ø �rB   r]   c                 ó"   • SU R                    S3$ )zƒ
Build a string representation of this L{FileAlias} instance.

@rtype: L{bytes}
@return: A string containing the name of the file.
z<File r_   ©r   rE   s    r"   ra   ÚFileAlias.__str__R  s   € ð ˜Ÿ™� aÐ(Ð(rB   c                 ó,   • [        U R                  5      $ )z™
Create a message receiver which delivers a message to the file.

@rtype: L{FileWrapper}
@return: A message receiver which writes a message to the file.
)rl   r   rE   s    r"   rI   ÚFileAlias.createMessageReceiver[  s   € ô ˜4Ÿ=™=Ó)Ð)rB   rŽ   N)
rP   rQ   rR   rS   rT   r@   r   ra   rI   rU   rV   rB   r"   rŠ   rŠ   >  s   † ñò
!ð)˜ô )õ*rB   rŠ   c                   ó   • \ rS rSrSrSrg)ÚProcessAliasTimeoutie  zV
An error indicating that a timeout occurred while waiting for a process
to complete.
rV   N)rP   rQ   rR   rS   rT   rU   rV   rB   r"   r“   r“   e  s   † ôrB   r“   c                   ó^   • \ rS rSrSrSrSrSr\rSS jr	S r
S rS	 rS
 rS rS\4S jrSrg)ÚMessageWrapperil  aò  
A message receiver which delivers a message to a child process.

@type completionTimeout: L{int} or L{float}
@ivar completionTimeout: The number of seconds to wait for the child
    process to exit before reporting the delivery as a failure.

@type _timeoutCallID: L{None} or
    L{IDelayedCall <twisted.internet.interfaces.IDelayedCall>} provider
@ivar _timeoutCallID: The call used to time out delivery, started when the
    connection to the child process is closed.

@type done: L{bool}
@ivar done: A flag indicating whether the child process has exited
    (C{True}) or not (C{False}).

@type reactor: L{IReactorTime <twisted.internet.interfaces.IReactorTime>}
    provider
@ivar reactor: A reactor which will be used to schedule timeouts.

@ivar protocol: See L{__init__}.

@type processName: L{bytes} or L{None}
@ivar processName: The process name.

@type completion: L{Deferred <defer.Deferred>}
@ivar completion: The deferred which will be triggered by the protocol
    when the child process exits.
Fé<   Nc                 óä   • X l         Xl        [        R                  " 5       U l        U R                  U R                  l        U R                  R                  U R                  5        Ub  X0l        gg)aV  
@type protocol: L{ProcessAliasProtocol}
@param protocol: The protocol associated with the child process.

@type process: L{bytes} or L{None}
@param process: The process name.

@type reactor: L{None} or L{IReactorTime
    <twisted.internet.interfaces.IReactorTime>} provider
@param reactor: A reactor which will be used to schedule timeouts.
N)	ÚprocessNamer   r   ÚDeferredÚ
completionÚonEndÚaddBothÚ_processEndedr   )r?   r   Úprocessr   s       r"   r@   ÚMessageWrapper.__init__“  sU   € ð #ÔØ ŒÜŸ.š.Ó*ˆŒØ"Ÿo™oˆ�‰ÔØ�‰×Ñ × 2Ñ 2Ô3àÑØ"�Lð rB   c                 ór   • SU l         U R                  b"  U R                  R                  5         SU l        gU$ )a_  
Record process termination and cancel the timeout call if it is active.

@type result: L{Failure <failure.Failure>}
@param result: The reason the child process terminated.

@rtype: L{None} or L{Failure <failure.Failure>}
@return: None, if the process end is expected, or the reason the child
    process terminated, if the process end is unexpected.
TN)ÚdoneÚ_timeoutCallIDÚcancel)r?   r   s     r"   r�   ÚMessageWrapper._processEnded¨  s:   € ð ˆŒ	Ø×ÑÑ*ð ×Ñ×&Ñ&Ô(Ø"&ˆDÕð ˆMrB   c                 óx   • U R                   (       a  gU R                  R                  R                  US-   5        g)zp
Write a received line to the child process.

@type line: L{bytes}
@param line: A received line of the message.
Nrt   )r¡   r   Ú	transportru   rv   s     r"   rw   ÚMessageWrapper.lineReceived¾  s*   € ð �9�9ØØ�‰×Ñ×%Ñ% d¨T¡kÕ2rB   c                 óî   • U R                   (       dY  U R                  R                  R                  5         U R                  R                  U R                  U R                  5      U l        U R                  $ )zÆ
Disconnect from the child process and set up a timeout to wait for it
to exit.

@rtype: L{Deferred <defer.Deferred>}
@return: A deferred which will be called back when the child process
    exits.
)
r¡   r   r¦   ÚloseConnectionr   Ú	callLaterÚcompletionTimeoutÚ_completionCancelr¢   rš   rE   s    r"   r�   ÚMessageWrapper.eomReceivedÉ  sU   € ð �y�yØ�M‰M×#Ñ#×2Ñ2Ô4Ø"&§,¡,×"8Ñ"8Ø×&Ñ&¨×(>Ñ(>ó#ˆDÔð �‰ÐrB   c                 ó  • SU l         U R                  R                  R                  S5        [	        SU R
                   S35      nSU R                  l        U R                  R                  [        R                  " U5      5        g)z¥
Handle the expiration of the timeout for the child process to exit by
terminating the child process forcefully and issuing a failure to the
L{completion} deferred.
NÚKILLzNo answer after z seconds)r¢   r   r¦   ÚsignalProcessr“   r«   r›   rš   Úerrbackr	   r}   )r?   Úexcs     r"   r¬   Ú MessageWrapper._completionCancelÙ  sf   € ð #ˆÔØ�‰×Ñ×-Ñ-¨fÔ5Ü!Ð$4°T×5KÑ5KÐ4LÈHÐ"UÓVˆØ"ˆ�‰ÔØ�‰×Ñ¤§¢°Ó 4Õ5rB   c                 ó   • g)z)
Ignore notification of lost connection.
NrV   rE   s    r"   r„   ÚMessageWrapper.connectionLostå  s   � rB   r]   c                 ó"   • SU R                    S3$ )z‹
Build a string representation of this L{MessageWrapper} instance.

@rtype: L{bytes}
@return: A string containing the name of the process.
z<ProcessWrapper r_   )r˜   rE   s    r"   ra   ÚMessageWrapper.__str__ê  s   € ð " $×"2Ñ"2Ð!3°1Ð5Ð5rB   )r¢   rš   r¡   r˜   r   r   ©NN)rP   rQ   rR   rS   rT   r¡   r«   r¢   r   r@   r�   rw   r�   r¬   r„   r   ra   rU   rV   rB   r"   r•   r•   l  sH   † ñð< €DàÐØ€Nà€Gô#ò*ò,	3òò 
6òð
6˜÷ 6rB   r•   c                   ó"   • \ rS rSrSrSrS rSrg)ÚProcessAliasProtocoliô  zÑ
A process protocol which errbacks a deferred when the associated
process ends.

@type onEnd: L{None} or L{Deferred <defer.Deferred>}
@ivar onEnd: If set, a deferred on which to errback when the process ends.
Nc                 óV   • U R                   b  U R                   R                  U5        gg)zv
Call an errback.

@type reason: L{Failure <failure.Failure>}
@param reason: The reason the child process terminated.
N)r›   r±   )r?   Úreasons     r"   ÚprocessEndedÚ!ProcessAliasProtocol.processEndedÿ  s%   € ð �:‰:Ñ!Ø�J‰J×Ñ˜vÕ&ð "rB   rV   )rP   rQ   rR   rS   rT   r›   r½   rU   rV   rB   r"   rº   rº   ô  s   † ñð €Eõ'rB   rº   c                   ó<   • \ rS rSrSr\rS rS\4S jrS r	S r
Srg	)
ÚProcessAliasi
  a  
An alias which is handled by the execution of a program.

@type path: L{list} of L{bytes}
@ivar path: The arguments to pass to the process. The first string is
    the executable's name.

@type program: L{bytes}
@ivar program: The path of the program to be executed.

@type reactor: L{IReactorTime <twisted.internet.interfaces.IReactorTime>}
    and L{IReactorProcess <twisted.internet.interfaces.IReactorProcess>}
    provider
@ivar reactor: A reactor which will be used to create and timeout the
    child process.
c                 ó„   • [         R                  " U /UQ76   UR                  5       U l        U R                  S   U l        g)a   
@type path: L{bytes}
@param path: The command to invoke the program consisting of the path
    to the executable followed by any arguments.

@type args: 2-L{tuple} of (0) L{dict} mapping L{bytes} to L{IDomain}
    provider, (1) L{bytes}
@param args: Arguments for L{AliasBase.__init__}.
r   N)r:   r@   r   ÚpathÚprogram)r?   rÂ   r[   s      r"   r@   ÚProcessAlias.__init__  s3   € ô 	×Ò˜4Ð' $Ó'Ø—J‘J“LˆŒ	Ø—y‘y ‘|ˆ�rB   r]   c                 ó"   • SU R                    S3$ )z˜
Build a string representation of this L{ProcessAlias} instance.

@rtype: L{bytes}
@return: A string containing the command used to invoke the process.
z	<Process r_   )rÂ   rE   s    r"   ra   ÚProcessAlias.__str__.  s   € ð ˜4Ÿ9™9˜+ QÐ'Ð'rB   c                 ó:   • U R                   R                  XU5      $ )aÈ  
Spawn a process.

This wraps the L{spawnProcess
<twisted.internet.interfaces.IReactorProcess.spawnProcess>} method on
L{reactor} so that it can be customized for test purposes.

@type proto: L{IProcessProtocol
    <twisted.internet.interfaces.IProcessProtocol>} provider
@param proto: An object which will be notified of all events related to
    the created process.

@type program: L{bytes}
@param program: The full path name of the file to execute.

@type path: L{list} of L{bytes}
@param path: The arguments to pass to the process. The first string
    should be the executable's name.

@rtype: L{IProcessTransport
    <twisted.internet.interfaces.IProcessTransport>} provider
@return: A process transport.
)r   ÚspawnProcess)r?   ÚprotorÃ   rÂ   s       r"   rÈ   ÚProcessAlias.spawnProcess7  s   € ð0 �|‰|×(Ñ(¨¸Ó>Ð>rB   c                 ó¦   • [        5       n[        XR                  U R                  5      nU R	                  XR                  U R
                  5        U$ )z²
Launch a process and create a message receiver to pass a message
to the process.

@rtype: L{MessageWrapper}
@return: A message receiver which delivers a message to the process.
)rº   r•   rÃ   r   rÈ   rÂ   )r?   r   Úms      r"   rI   Ú"ProcessAlias.createMessageReceiverQ  s=   € ô !Ó"ˆÜ˜1Ÿl™l¨D¯L©LÓ9ˆØ×Ñ˜!Ÿ\™\¨4¯9©9Ô5ØˆrB   )rÂ   rÃ   N)rP   rQ   rR   rS   rT   r   r@   r   ra   rÈ   rI   rU   rV   rB   r"   rÀ   rÀ   
  s)   † ñð" €Gò$ð(˜ô (ò?õ4rB   rÀ   c                   ó>   • \ rS rSrSrS rS rS rS rS\	4S jr
S	rg
)ÚMultiWrapperi_  zw
A message receiver which delivers a single message to multiple other
message receivers.

@ivar objs: See L{__init__}.
c                 ó   • Xl         g)z’
@type objs: L{list} of L{IMessage <smtp.IMessage>} provider
@param objs: Message receivers to which the incoming message should be
    directed.
N©Úobjs)r?   rÒ   s     r"   r@   ÚMultiWrapper.__init__h  s	   € ð �	rB   c                 óL   • U R                    H  nUR                  U5        M     g)zj
Pass a received line to the message receivers.

@type line: L{bytes}
@param line: A line of the message.
N)rÒ   rw   )r?   r   Úos      r"   rw   ÚMultiWrapper.lineReceivedp  s   € ð —”ˆAØ�N‰N˜4Ö ò rB   c                 óˆ   • [         R                  " U R                   Vs/ s H  oR                  5       PM     sn5      $ s  snf )a  
Pass the end of message along to the message receivers.

@rtype: L{DeferredList <defer.DeferredList>} whose successful results
    are L{bytes} or L{None}
@return: A deferred list which triggers when all of the message
    receivers have finished handling their end of message.
)r   ÚDeferredListrÒ   r�   ©r?   rÕ   s     r"   r�   ÚMultiWrapper.eomReceivedz  s/   € ô ×!Ò!¸D¿IºIÓ"FºI°q§=¡=¦?¹IÑ"FÓGÐGùÒ"Fs   Ÿ?c                 óJ   • U R                    H  nUR                  5         M     g)zA
Inform the message receivers that the connection has been lost.
N)rÒ   r„   rÙ   s     r"   r„   ÚMultiWrapper.connectionLost…  s   € ð —”ˆAØ×ÑÖò rB   r]   c                 ó@   • S[        [        U R                  5      < S3$ )z‘
Build a string representation of this L{MultiWrapper} instance.

@rtype: L{bytes}
@return: A string containing a list of the message receivers.
z<GroupWrapper r_   )r   r   rÒ   rE   s    r"   ra   ÚMultiWrapper.__str__Œ  s   € ð  ¤¤C¨¯©Ó 3Ñ6°aÐ8Ð8rB   rÑ   Nrˆ   rV   rB   r"   rÏ   rÏ   _  s(   † ñòò!ò	Hòð9˜÷ 9rB   rÏ   c                   óF   • \ rS rSrSr\rS rS rS\	4S jr
S rSS	 jrS
rg)r1   i–  a0  
An alias which points to multiple destination aliases.

@type processAliasFactory: no-argument callable which returns
    L{ProcessAlias}
@ivar processAliasFactory: A factory for process aliases.

@type aliases: L{list} of L{AliasBase} which implements L{IAlias}
@ivar aliases: The destination aliases.
c                 óî  • [         R                  " U /UQ76   / U l        U(       Ga‹  UR                  5       R	                  5       nUR                  S5      (       aj   [        USS 5      nU   SR                  U Vs/ s H  oUR	                  5       PM     sn5      nSSS5        UR                  UR                  S5      5        OâUR                  S5      (       a0  U R                  R                  U R                  " USS /UQ76 5        OœUR                  S5      (       aa  [        R                   R#                  U5      (       a  [        R                  " S	5        OKU R                  R                  [%        U/UQ76 5        O%U R                  R                  ['        U/UQ76 5        U(       a  GMŠ  ggs  snf ! , (       d  f       GN#= f! [         a     [        R                  " SUSS < 35         NLf = f)
a:  
Create a group of aliases.

Parse a list of alias strings and, for each, create an appropriate
alias object.

@type items: L{list} of L{bytes}
@param items: Aliases.

@type args: n-L{tuple} of (0) L{dict} mapping L{bytes} to L{IDomain}
    provider, (1) L{bytes}
@param args: Arguments for L{AliasBase.__init__}.
r   r   Nr(   r   zInvalid filename in alias file Ú|Ú/z Directory delivery not supported)r:   r@   ÚaliasesÚpopr   r.   r*   Újoinr   r   r{   r
   r   ÚappendÚprocessAliasFactoryÚosrÂ   ÚisdirrŠ   rX   )r?   r0   r[   Úaddrr€   Úls         r"   r@   ÚAliasGroup.__init__¥  su  € ô 	×Ò˜4Ð' $Ó'ØˆŒßØ—9‘9“;×$Ñ$Ó&ˆDØ�‰˜s×#Ñ#ð2Ü˜T ! "˜X›�Aò Ø"Ÿx™x¹AÓ(>ºA°q¯©®¹AÑ(>Ó?˜÷ à—L‘L §¡¨C£Õ1Ø—‘ ×%Ñ%Ø—‘×#Ñ# D×$<Ò$<¸TÀ!À"¸XÐ$MÈÒ$MÕNØ—‘ ×%Ñ%Ü—7‘7—=‘= ×&Ñ&Ü—G’GÐ>Õ?à—L‘L×'Ñ'¬	°$Ð(>¸Ò(>Õ?à—‘×#Ñ#¤L°Ð$=¸Ò$=Ô>÷' ‹eùò )?÷ žûô %ó LÜ—G’GÐ=¸dÀ1À2¸h¹\ÐJÖKðLús0   ÁG
 Á,F8Á<F3
ÂF8Æ3F8Æ8
GÇ
'G4Ç3G4c                 ó,   • [        U R                  5      $ )zi
Return the number of aliases in the group.

@rtype: L{int}
@return: The number of aliases in the group.
)r   rã   rE   s    r"   Ú__len__ÚAliasGroup.__len__Ë  s   € ô �4—<‘<Ó Ð rB   r]   c                 óZ   • SSR                  [        [        U R                  5      5      -  $ )zˆ
Build a string representation of this L{AliasGroup} instance.

@rtype: L{bytes}
@return: A string containing the aliases in the group.
z<AliasGroup [%s]>z, )rå   r   r   rã   rE   s    r"   ra   ÚAliasGroup.__str__Ô  s#   € ð # d§i¡i´´C¸¿¹Ó0FÓ&GÑHÐHrB   c                 ór   • [        U R                   Vs/ s H  oR                  5       PM     sn5      $ s  snf )zü
Create a message receiver for each alias and return a message receiver
which will pass on a message to each of those.

@rtype: L{MultiWrapper}
@return: A message receiver which passes a message on to message
    receivers for each alias in the group.
)rÏ   rã   rI   )r?   r7   s     r"   rI   Ú AliasGroup.createMessageReceiverÝ  s,   € ô ÀÇÂÓMÂ¸1×4Ñ4Ö6ÁÑMÓNÐNùÒMs   ”4Nc                 ó    • Uc  0 n/ nU R                    H#  nUR                  UR                  X5      5        M%     [        [	        SU5      5      $ )a)  
Map each of the aliases in the group to its ultimate destination.

@type aliasmap: L{dict} mapping L{bytes} to L{AliasBase}
@param aliasmap: A mapping of username to alias or group of aliases.

@type memo: L{None} or L{dict} of L{AliasBase}
@param memo: A record of the aliases already considered in the
    resolution process.  If provided, C{memo} is modified to include
    this alias.

@rtype: L{MultiWrapper}
@return: A message receiver which passes the message on to message
    receivers for the ultimate destination of each alias in the group.
N)rã   ræ   rM   rÏ   Úfilter)r?   rK   rL   Úrr7   s        r"   rM   ÚAliasGroup.resolveè  sG   € ð  ‰<ØˆDØˆØ—”ˆAØ�H‰H�Q—Y‘Y˜xÓ.Ö/ñ äœF 4¨›OÓ,Ð,rB   )rã   rO   )rP   rQ   rR   rS   rT   rÀ   rç   r@   rî   r   ra   rI   rM   rU   rV   rB   r"   r1   r1   –  s3   † ñ	ð 'Ðò$?òL!ðI˜ô Iò	O÷-rB   r1   r¸   )rT   rè   ro   Úzope.interfacer   Útwisted.internetr   r   r   Útwisted.mailr   Útwisted.mail.interfacesr   Útwisted.pythonr	   r
   r#   r8   r:   rX   ÚIMessagerl   rŠ   Ú	Exceptionr“   r•   ÚProcessProtocolrº   rÀ   rÏ   r1   rV   rB   r"   Ú<module>r      sU  ðñó 
Û å &ç 5Ñ 5Ý Ý *ß 'òUô6E÷P3,ñ 3,ñl ˆVÓôC�9ó Có ðCñL ˆT�]‰]Ó÷B1ð B1ó ðB1ñJ ˆVÓô#*�	ó #*ó ð#*ôL˜)ô ñ ˆT�]‰]Ó÷D6ð D6ó ðD6ôN'˜8×3Ñ3ô 'ñ, ˆVÓôQ�9ó Qó ðQñh ˆT�]‰]Ó÷39ð 39ó ð39ñl ˆVÓôf-�ó f-ó ñf-rB   