+
    Dfj                         R t ^ RIt^ RIt^ RIHt ^ RIHt ^ RIHt  ! R R4      t	 ! R R4      t
 ! R	 R
]
]P                  4      t ! R R]
]P                  4      tR# )z
Support for relaying mail.
N)UNIXAddress)smtp)logc                   @   a  ] tR t^t o RtRR ltR tR tR tRt	V t
R# )	DomainQueuerzE
An SMTP domain which add messages to a queue intended for relaying.
c                    Wn         W n        R # N)serviceauthed)selfr	   authenticateds   &&&4/usr/lib/python3/dist-packages/twisted/mail/relay.py__init__DomainQueuer.__init__   s    #    c                  a a S P                  SP                  SP                  4      '       d   \        R\	        SP
                  4      P                  R^4      4      p\        R\	        SP                  4      P                  R^4      4      p\        V4      ^8X  d   \        V4      ^8X  d   V V3R l# \        P                  ! S4      h)aI  
Check whether mail can be relayed to a user.

@type user: L{User}
@param user: A user.

@rtype: no-argument callable which returns L{IMessage <smtp.IMessage>}
    provider
@return: A function which takes no arguments and returns a message
    receiver for the user.

@raise SMTPBadRcpt: When mail cannot be relayed to the user.
N@c                  &   < S P                  S4      # r   )startMessage)r   users   r   <lambda>%DomainQueuer.exists.<locals>.<lambda>-   s    t006r   )
	willRelaydestprotocolfilterstrorigsplitlenr   SMTPBadRcpt)r   r   r   r   s   ff  r   existsDomainQueuer.exists   s     >>$))T]]33$DII 4 4S! <=D$DII 4 4S! <=D4yA~#d)q.66t$$r   c                    VP                   P                  4       pV P                  ;'       g(    \        V\        4      ;'       g    VP
                  R8H  # )z
Check whether we agree to relay.

The default is to relay for all connections over UNIX
sockets and all connections from localhost.
z	127.0.0.1)	transportgetPeerr
   
isinstancer   host)r   addressr   peers   &&& r   r   DomainQueuer.willRelay0   sB     !!))+{{WWj{;WWtyyK?WWr   c           
        V P                   P                  pVP                  4       w  r4V;_uu_ 4        \        P                  ! R\        VP                  4      : R\        VP                  4      : 24       \        P                  ! \        VP                  4      \        VP                  4      .V4       RRR4       V#   + '       g   i     T# ; i)z
Create an envelope and a message receiver for the relay queue.

@type user: L{User}
@param user: A user.

@rtype: L{IMessage <smtp.IMessage>}
@return: A message receiver.
zQueueing mail z -> N)
r	   queuecreateNewMessager   msgr   r   r   pickledump)r   r   r,   envelopeFilesmtpMessages   &&   r   r   DomainQueuer.startMessage:   s     ""$)$:$:$<!\GGnS^$6d3tyy>:LMNKKTYYTYY8,G   \ s   BCC	)r
   r	   N)F)__name__
__module____qualname____firstlineno____doc__r   r!   r   r   __static_attributes____classdictcell____classdict__s   @r   r   r      s$     $%,X r   r   c                   >   a  ] tR t^Lt o R tR tR tR tR tRt	V t
R# )RelayerMixinc                   . V n         . V n        V F  p\        VR ,           R4      ;_uu_ 4       p\        P                  ! V4      pRRR4       \        VR,           4      pXP                  V4       V P                   P                  V4       V P                  P                  V4       K  	  R#   + '       g   i     Lo; i)-HrbN-D)messagesnamesopenr/   loadappend)r   messagePathsmessagefpmessageContentss   &&   r   loadMessagesRelayerMixin.loadMessagesQ   s    
#Ggnd++r"(++b/ ,gn%B""2&MM  1JJg& $++s   B--B=c                ^    V P                   '       g   R # V P                   ^ ,          ^ ,          # r   rC   r   s   &r   getMailFromRelayerMixin.getMailFrom\   "    }}}}}Q""r   c                `    V P                   '       g   R # V P                   ^ ,          ^,          .# r   rO   rP   s   &r   	getMailToRelayerMixin.getMailToa   s%    }}}a #$$r   c                ^    V P                   '       g   R # V P                   ^ ,          ^,          # r   rO   rP   s   &r   getMailDataRelayerMixin.getMailDataf   rS   r   c                   V\         P                  9   d]   \        P                  ! V P                  ^ ,          R,           4       \        P                  ! V P                  ^ ,          R,           4       V P
                  ^  V P                  ^  R# )zSince we only use one recipient per envelope, this
will be called with 0 or 1 addresses. We probably want
to do something with the error message if we failed.
rB   r@   N)r   SUCCESSosremoverD   rC   )r   coderespnumOk	addressesr   s   &&&&&&r   sentMailRelayerMixin.sentMailk   sY    
 4<<IIdjjmd*+IIdjjmd*+MM!JJqMr   )rC   rD   N)r4   r5   r6   r7   rL   rQ   rU   rX   rb   r9   r:   r;   s   @r   r>   r>   L   s#     
	'#
%
#

 
r   r>   c                   *   a  ] tR t^xt o RtR tRtV tR# )SMTPRelayerz!
A base class for SMTP relayers.
c                p    \         P                  P                  ! V .VO5/ VB  V P                  V4       R# )aN  
@type messagePaths: L{list} of L{bytes}
@param messagePaths: The base filename for each message to be relayed.

@type args: 1-L{tuple} of (0) L{bytes} or 2-L{tuple} of
    (0) L{bytes}, (1) L{int}
@param args: Positional arguments for L{SMTPClient.__init__}

@type kw: L{dict}
@param kw: Keyword arguments for L{SMTPClient.__init__}
N)r   
SMTPClientr   rL   r   rH   argskws   &&*,r   r   SMTPRelayer.__init__}   s.     	  333,'r    Nr4   r5   r6   r7   r8   r   r9   r:   r;   s   @r   re   re   x   s     ( (r   re   c                   *   a  ] tR t^t o RtR tRtV tR# )ESMTPRelayerz"
A base class for ESMTP relayers.
c                p    \         P                  P                  ! V .VO5/ VB  V P                  V4       R# )a(  
@type messagePaths: L{list} of L{bytes}
@param messagePaths: The base filename for each message to be relayed.

@type args: 3-L{tuple} of (0) L{bytes}, (1) L{None} or
    L{ClientContextFactory
    <twisted.internet.ssl.ClientContextFactory>},
    (2) L{bytes} or 4-L{tuple} of (0) L{bytes}, (1) L{None}
    or L{ClientContextFactory
    <twisted.internet.ssl.ClientContextFactory>}, (2) L{bytes},
    (3) L{int}
@param args: Positional arguments for L{ESMTPClient.__init__}

@type kw: L{dict}
@param kw: Keyword arguments for L{ESMTPClient.__init__}
N)r   ESMTPClientr   rL   rh   s   &&*,r   r   ESMTPRelayer.__init__   s0    " 	!!$444,'r   rl   Nrm   r;   s   @r   ro   ro      s     ( (r   ro   )r8   r\   r/   twisted.internet.addressr   twisted.mailr   twisted.pythonr   r   r>   rg   re   rq   ro   rl   r   r   <module>rv      sW   
 
  0  8 8v) )X(, (*(<!1!1 (r   