
    \d"                        d Z ddlmZ  G d de          Z G d de          Z G d de          Z G d	 d
e          Z G d de          Z G d de          Z	 G d de          Z
 G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d d e          Z G d! d"e          Z G d# d$e          Z G d% d&e          Z G d' d(e          Z G d) d*e          Z G d+ d,e          Z G d- d.e          Z G d/ d0e          Z G d1 d2e          Z G d3 d4e          Z G d5 d6e          Z G d7 d8e          Z G d9 d:e          Z G d; d<e          Z  G d= d>e          Z! G d? d@e!          Z" G dA dBe"          Z# G dC dDe"          Z$ G dE dFe          Z% G dG dHe          Z& G dI dJe          Z' G dK dLe          Z( G dM dNe(          Z) G dO dPe(          Z* G dQ dRe(          Z+ G dS dTe(          Z, G dU dVe(          Z-dWS )Xz 
Exceptions in L{twisted.mail}.
    )Optionalc                       e Zd ZdS )IMAP4ExceptionN__name__
__module____qualname__     4lib/python3.11/site-packages/twisted/mail/_except.pyr   r              Dr   r   c                       e Zd ZdS )IllegalClientResponseNr   r
   r   r   r   r      r   r   r   c                       e Zd ZdS )IllegalOperationNr   r
   r   r   r   r      r   r   r   c                       e Zd ZdS )IllegalMailboxEncodingNr   r
   r   r   r   r      r   r   r   c                       e Zd ZdS )MailboxExceptionNr   r
   r   r   r   r      r   r   r   c                       e Zd ZdefdZdS )MailboxCollisionreturnc                     d| j         z  S )NzMailbox named %s already existsargsselfs    r   __str__zMailboxCollision.__str__    s    049<<r   Nr   r   r	   strr   r
   r   r   r   r      s/        = = = = = = =r   r   c                       e Zd ZdefdZdS )NoSuchMailboxr   c                     d| j         z  S )NzNo mailbox named %s existsr   r   s    r   r   zNoSuchMailbox.__str__%   s    +di77r   Nr   r
   r   r   r"   r"   $   s/        8 8 8 8 8 8 8r   r"   c                       e Zd ZdefdZdS )ReadOnlyMailboxr   c                     dS )NzMailbox open in read-only stater
   r   s    r   r   zReadOnlyMailbox.__str__*   s    00r   Nr   r
   r   r   r%   r%   )   s/        1 1 1 1 1 1 1r   r%   c                       e Zd ZdS )UnhandledResponseNr   r
   r   r   r(   r(   .   r   r   r(   c                       e Zd ZdS )NegativeResponseNr   r
   r   r   r*   r*   2   r   r   r*   c                        e Zd Zd ZdefdZdS )NoSupportedAuthenticationc                 X    t                               | d           || _        || _        d S )Nz-No supported authentication schemes available)r   __init__serverSupportsclientSupports)r   r/   r0   s      r   r.   z"NoSupportedAuthentication.__init__7   s/    &UVVV,,r   r   c                 x    t                               |           d                    | j        | j                  z   S )Nz,: Server supports {!r}, client supports {!r})r   r   formatr/   r0   r   s    r   r   z!NoSupportedAuthentication.__str__<   sA    %%
 
:AA
 

 	
r   Nr   r   r	   r.   r    r   r
   r   r   r,   r,   6   s>        - - -

 
 
 
 
 
 
r   r,   c                       e Zd ZdS )IllegalServerResponseNr   r
   r   r   r5   r5   E   r   r   r5   c                       e Zd ZdS )IllegalIdentifierErrorNr   r
   r   r   r7   r7   I   r   r   r7   c                       e Zd ZdS )IllegalQueryErrorNr   r
   r   r   r9   r9   M   r   r   r9   c                       e Zd ZdS )MismatchedNestingNr   r
   r   r   r;   r;   Q   r   r   r;   c                       e Zd ZdS )MismatchedQuotingNr   r
   r   r   r=   r=   U   r   r   r=   c                       e Zd ZdS )	SMTPErrorNr   r
   r   r   r?   r?   Y   r   r   r?   c                   l    e Zd ZdZ	 	 	 	 ddededee         dee         ded	efd
Z	de
fdZdefdZdS )SMTPClientErrorz,
    Base class for SMTP client errors.
    NFcoderesplog	addressesisFatalretryc                    t          |t                    r|                    d          }t          |t                    r|                    d          }|| _        || _        || _        || _        || _        || _        dS )a  
        @param code: The SMTP response code associated with this error.
        @param resp: The string response associated with this error.
        @param log: A string log of the exchange leading up to and including
            the error.
        @param isFatal: A boolean indicating whether this connection can
            proceed or not. If True, the connection will be dropped.
        @param retry: A boolean indicating whether the delivery should be
            retried. If True and the factory indicates further retries are
            desirable, they will be attempted, otherwise the delivery will be
            failed.
        utf-8N)	
isinstancer    encoderB   rC   rD   rE   rF   rG   r   rB   rC   rD   rE   rF   rG   s          r   r.   zSMTPClientError.__init__b   sx    * dC   	(;;w''Dc3 	&**W%%C		"


r   r   c                 P    |                                                      d          S )NrI   )	__bytes__decoder   s    r   r   zSMTPClientError.__str__   s     ~~&&w///r   c                    | j         dk    r'| j         dd                                | j        z   g}n| j        g}| j        r/|                    | j                   |                    d           d                    |          S )Nr   03d r      
)rB   rK   rC   rD   appendjoin)r   ress     r   rN   zSMTPClientError.__bytes__   s~    9q==i&&&&--//$);<CC9+C8 	JJtx   JJsOOOzz#r   )NNFF)r   r   r	   __doc__intbytesr   objectboolr.   r    r   rN   r
   r   r   rA   rA   ]   s           $&*       e_	 
 F#           D0 0 0 0 05      r   rA   c                       e Zd ZdZdS )ESMTPClientErrorz-
    Base class for ESMTP client errors.
    Nr   r   r	   rW   r
   r   r   r]   r]                 r   r]   c                       e Zd ZdZdS )EHLORequiredErrorz{
    The server does not support EHLO.

    This is considered a non-fatal error (the connection will not be dropped).
    Nr^   r
   r   r   ra   ra                 r   ra   c                       e Zd ZdZdS )AUTHRequiredErrorz
    Authentication was required but the server does not support it.

    This is considered a non-fatal error (the connection will not be dropped).
    Nr^   r
   r   r   rd   rd      rb   r   rd   c                       e Zd ZdZdS )TLSRequiredErrorz
    Transport security was required but the server does not support it.

    This is considered a non-fatal error (the connection will not be dropped).
    Nr^   r
   r   r   rf   rf      rb   r   rf   c                       e Zd ZdZdS )AUTHDeclinedErrorz
    The server rejected our credentials.

    Either the username, password, or challenge response
    given to the server was rejected.

    This is considered a non-fatal error (the connection will not be
    dropped).
    Nr^   r
   r   r   rh   rh                 r   rh   c                       e Zd ZdZdS )AuthenticationErrorz
    An error occurred while authenticating.

    Either the server rejected our request for authentication or the
    challenge received was malformed.

    This is considered a non-fatal error (the connection will not be
    dropped).
    Nr^   r
   r   r   rk   rk      ri   r   rk   c                       e Zd ZdZdS )SMTPTLSErrorz
    An error occurred while negiotiating for transport security.

    This is considered a non-fatal error (the connection will not be dropped).
    Nr^   r
   r   r   rm   rm      rb   r   rm   c                       e Zd ZdZddZdS )SMTPConnectErrorzt
    Failed to connect to the mail exchange host.

    This is considered a fatal error.  A retry will be made.
    NTc           	      F    t                               | ||||||           d S NrA   r.   rL   s          r   r.   zSMTPConnectError.__init__   (      tT3	7ERRRRRr   NNTTr   r   r	   rW   r.   r
   r   r   ro   ro      8         S S S S S Sr   ro   c                       e Zd ZdZddZdS )SMTPTimeoutErrorz
    Failed to receive a response from the server in the expected time period.

    This is considered a fatal error.  A retry will be made.
    NTc           	      F    t                               | ||||||           d S rq   rr   rL   s          r   r.   zSMTPTimeoutError.__init__   rs   r   rt   ru   r
   r   r   rx   rx      rv   r   rx   c                       e Zd ZdZddZdS )SMTPProtocolErrorzo
    The server sent a mangled response.

    This is considered a fatal error.  A retry will not be made.
    NTFc           	      F    t                               | ||||||           d S rq   rr   rL   s          r   r.   zSMTPProtocolError.__init__   rs   r   )NNTFru   r
   r   r   r{   r{      rv   r   r{   c                       e Zd ZdZdS )SMTPDeliveryErrorz=
    Indicates that a delivery attempt has had an error.
    Nr^   r
   r   r   r~   r~      r_   r   r~   c                        e Zd Zd ZdefdZdS )SMTPServerErrorc                 "    || _         || _        d S rq   rB   rC   )r   rB   rC   s      r   r.   zSMTPServerError.__init__   s    				r   r   c                 $    d| j         | j        fz  S )Nz%.3d %sr   r   s    r   r   zSMTPServerError.__str__   s    DIty111r   Nr3   r
   r   r   r   r      s>          2 2 2 2 2 2 2r   r   c                        e Zd Zd ZdefdZdS )SMTPAddressErrorc                 j    ddl m} t                              | ||            ||          | _        d S )Nr   )Address)twisted.mail.smtpr   r   r.   addr)r   r   rB   rC   r   s        r   r.   zSMTPAddressError.__init__  s?    ------  tT222GDMM			r   r   c                 0    d| j         | j        | j        fz  S )Nz%.3d <%s>... %s)rB   r   rC   r   s    r   r   zSMTPAddressError.__str__  s     DIty$)#DDDr   Nr3   r
   r   r   r   r      sE        " " "E E E E E E Er   r   c                       e Zd ZddZdS )SMTPBadRcpt&  $Cannot receive for specified addressc                 @    t                               | |||           d S rq   r   r.   r   r   rB   rC   s       r   r.   zSMTPBadRcpt.__init__  "    !!$dD99999r   N)r   r   r   r   r	   r.   r
   r   r   r   r     (        : : : : : :r   r   c                       e Zd ZddZdS )SMTPBadSenderr   Sender not acceptablec                 @    t                               | |||           d S rq   r   r   s       r   r.   zSMTPBadSender.__init__  r   r   N)r   r   r   r
   r   r   r   r     r   r   r   c                       e Zd ZdZdS )AddressErrorz 
    Parse error in address
    Nr^   r
   r   r   r   r     r_   r   r   c                       e Zd ZdZdS )	POP3Errorz)
    The base class for POP3 errors.
    Nr^   r
   r   r   r   r     s          	Dr   r   c                       e Zd ZdZdS )_POP3MessageDeletedzb
    An internal control-flow error which indicates that a deleted message was
    requested.
    Nr^   r
   r   r   r   r   #             r   r   c                       e Zd ZdZdS )POP3ClientErrorzA
    The base class for all exceptions raised by POP3Client.
    Nr^   r
   r   r   r   r   *  r_   r   r   c                       e Zd ZdZdS ) InsecureAuthenticationDisallowedze
    An error indicating secure authentication was required but no mechanism
    could be found.
    Nr^   r
   r   r   r   r   0  r   r   r   c                       e Zd ZdZdS )TLSErrorz
    An error indicating secure authentication was required but either the
    transport does not support TLS or no TLS context factory was supplied.
    Nr^   r
   r   r   r   r   7  r   r   r   c                       e Zd ZdZdS )TLSNotSupportedErrorzi
    An error indicating secure authentication was required but the server does
    not support TLS.
    Nr^   r
   r   r   r   r   >  r   r   r   c                       e Zd ZdZddZdS )ServerErrorResponsez
    An error indicating that the server returned an error response to a
    request.

    @ivar consumer: See L{__init__}
    Nc                 J    t                               | |           || _        dS )a  
        @type reason: L{bytes}
        @param reason: The server response minus the status indicator.

        @type consumer: callable that takes L{object}
        @param consumer: The function meant to handle the values for a
            multi-line response.
        N)r   r.   consumer)r   reasonr   s      r   r.   zServerErrorResponse.__init__M  s%     	  v... r   rq   ru   r
   r   r   r   r   E  s2         
! 
! 
! 
! 
! 
!r   r   c                       e Zd ZdZdS )LineTooLongz
    An error indicating that the server sent a line which exceeded the
    maximum line length (L{LineOnlyReceiver.MAX_LENGTH}).
    Nr^   r
   r   r   r   r   Z  r   r   r   N).rW   typingr   	Exceptionr   r   r   r   r   r   r"   r%   r(   r*   r,   r5   r7   r9   r;   r=   r?   rA   r]   ra   rd   rf   rh   rk   rm   ro   rx   r{   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r
   r   r   <module>r      s=         	 	 	 	 	Y 	 	 		 	 	 	 	N 	 	 		 	 	 	 	~ 	 	 		 	 	 	 	^ 	 	 		 	 	 	 	~ 	 	 	= = = = =' = = =
8 8 8 8 8$ 8 8 8
1 1 1 1 1& 1 1 1
	 	 	 	 	 	 	 		 	 	 	 	~ 	 	 	
 
 
 
 
 
 
 
	 	 	 	 	N 	 	 		 	 	 	 	^ 	 	 		 	 	 	 	 	 	 		 	 	 	 	 	 	 		 	 	 	 	 	 	 		 	 	 	 		 	 	 	2 2 2 2 2i 2 2 2j           (       (       '   	 	 	 	 	( 	 	 		 	 	 	 	* 	 	 	    #   S S S S S S S SS S S S S S S SS S S S S S S S       2 2 2 2 2i 2 2 2E E E E E E E E: : : : :" : : :
: : : : :$ : : :
    9   	 	 	 	 		 	 	 	    )       i                     ?   ! ! ! ! !/ ! ! !*    /     r   