
    Vh!                        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-yW)Xz 
Exceptions in L{twisted.mail}.
    )Optionalc                       e Zd Zy)IMAP4ExceptionN__name__
__module____qualname__     D/home/dcms/DCMS/lib/python3.12/site-packages/twisted/mail/_except.pyr   r          r   r   c                       e Zd Zy)IllegalClientResponseNr   r
   r   r   r   r      r   r   r   c                       e Zd Zy)IllegalOperationNr   r
   r   r   r   r      r   r   r   c                       e Zd Zy)IllegalMailboxEncodingNr   r
   r   r   r   r      r   r   r   c                       e Zd Zy)MailboxExceptionNr   r
   r   r   r   r      r   r   r   c                       e Zd ZdefdZy)MailboxCollisionreturnc                      d| j                   z  S )NzMailbox named %s already existsargsselfs    r   __str__zMailboxCollision.__str__    s    0499<<r   Nr   r   r	   strr   r
   r   r   r   r      s    = =r   r   c                       e Zd ZdefdZy)NoSuchMailboxr   c                      d| j                   z  S )NzNo mailbox named %s existsr   r   s    r   r   zNoSuchMailbox.__str__%   s    +dii77r   Nr   r
   r   r   r"   r"   $   s    8 8r   r"   c                       e Zd ZdefdZy)ReadOnlyMailboxr   c                      y)NzMailbox open in read-only stater
   r   s    r   r   zReadOnlyMailbox.__str__*   s    0r   Nr   r
   r   r   r%   r%   )   s    1 1r   r%   c                       e Zd Zy)UnhandledResponseNr   r
   r   r   r(   r(   .   r   r   r(   c                       e Zd Zy)NegativeResponseNr   r
   r   r   r*   r*   2   r   r   r*   c                       e Zd Zd ZdefdZy)NoSupportedAuthenticationc                 L    t         j                  | d       || _        || _        y )Nz-No supported authentication schemes available)r   __init__serverSupportsclientSupports)r   r/   r0   s      r   r.   z"NoSupportedAuthentication.__init__7   s#    &UV,,r   r   c                 z    t         j                  |       dj                  | j                  | j                        z   S )Nz,: Server supports {!r}, client supports {!r})r   r   formatr/   r0   r   s    r   r   z!NoSupportedAuthentication.__str__<   s=    %%
:AA

 	
r   Nr   r   r	   r.   r    r   r
   r   r   r,   r,   6   s    -

 
r   r,   c                       e Zd Zy)IllegalServerResponseNr   r
   r   r   r5   r5   E   r   r   r5   c                       e Zd Zy)IllegalIdentifierErrorNr   r
   r   r   r7   r7   I   r   r   r7   c                       e Zd Zy)IllegalQueryErrorNr   r
   r   r   r9   r9   M   r   r   r9   c                       e Zd Zy)MismatchedNestingNr   r
   r   r   r;   r;   Q   r   r   r;   c                       e Zd Zy)MismatchedQuotingNr   r
   r   r   r=   r=   U   r   r   r=   c                       e Zd Zy)	SMTPErrorNr   r
   r   r   r?   r?   Y   r   r   r?   c                   ^    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y)SMTPClientErrorz,
    Base class for SMTP client errors.
    Ncoderesplog	addressesisFatalretryc                     t        |t              r|j                  d      }t        |t              r|j                  d      }|| _        || _        || _        || _        || _        || _        y)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   s^    * dC ;;w'Dc3**W%C		"
r   r   c                 @    | j                         j                  d      S )NrI   )	__bytes__decoder   s    r   r   zSMTPClientError.__str__   s    ~~&&w//r   c                 &   | j                   dkD  r-| j                   ddj                         | j                  z   g}n| j                  g}| j                  r,|j	                  | j                         |j	                  d       dj                  |      S )Nr   03d r      
)rB   rK   rC   rD   appendjoin)r   ress     r   rN   zSMTPClientError.__bytes__   so    99q=ii_A&--/$));<C99+C88JJtxx JJsOzz#r   )NNFF)r   r   r	   __doc__intbytesr   objectboolr.   r    r   rN   r
   r   r   rA   rA   ]   sv      $&*     e_	 
 F#     D0 05 r   rA   c                       e Zd ZdZy)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y)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y)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y)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y)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y)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y)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y)SMTPConnectErrorzt
    Failed to connect to the mail exchange host.

    This is considered a fatal error.  A retry will be made.
    Nc           	      :    t         j                  | ||||||       y NrA   r.   rL   s          r   r.   zSMTPConnectError.__init__         tT3	7ERr   NNTTr   r   r	   rW   r.   r
   r   r   ro   ro          Sr   ro   c                       e Zd ZdZddZy)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.
    Nc           	      :    t         j                  | ||||||       y 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y)SMTPProtocolErrorzo
    The server sent a mangled response.

    This is considered a fatal error.  A retry will not be made.
    Nc           	      :    t         j                  | ||||||       y 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y)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y)SMTPServerErrorc                      || _         || _        y rq   rB   rC   )r   rB   rC   s      r   r.   zSMTPServerError.__init__   s    		r   r   c                 8    d| j                   | j                  fz  S )Nz%.3d %sr   r   s    r   r   zSMTPServerError.__str__   s    DIItyy111r   Nr3   r
   r   r   r   r      s    2 2r   r   c                       e Zd Zd ZdefdZy)SMTPAddressErrorc                 X    ddl m} t        j                  | ||        ||      | _        y )Nr   )Address)twisted.mail.smtpr   r   r.   addr)r   r   rB   rC   r   s        r   r.   zSMTPAddressError.__init__  s"    -  tT2DM	r   r   c                 N    d| j                   | j                  | j                  fz  S )Nz%.3d <%s>... %s)rB   r   rC   r   s    r   r   zSMTPAddressError.__str__  s      DIItyy$))#DDDr   Nr3   r
   r   r   r   r      s    "E Er   r   c                       e Zd ZddZy)SMTPBadRcptc                 4    t         j                  | |||       y rq   r   r.   r   r   rB   rC   s       r   r.   zSMTPBadRcpt.__init__      !!$dD9r   N)&  z$Cannot receive for specified addressr   r   r	   r.   r
   r   r   r   r         :r   r   c                       e Zd ZddZy)SMTPBadSenderc                 4    t         j                  | |||       y rq   r   r   s       r   r.   zSMTPBadSender.__init__  r   r   N)r   zSender not acceptabler   r
   r   r   r   r     r   r   r   c                       e Zd ZdZy)AddressErrorz 
    Parse error in address
    Nr^   r
   r   r   r   r     r_   r   r   c                       e Zd ZdZy)	POP3Errorz)
    The base class for POP3 errors.
    Nr^   r
   r   r   r   r     s     	r   r   c                       e Zd ZdZy)_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y)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y) 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y)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y)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y)ServerErrorResponsez
    An error indicating that the server returned an error response to a
    request.

    @ivar consumer: See L{__init__}
    Nc                 >    t         j                  | |       || _        y)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  s    
!r   r   c                       e Zd ZdZy)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
1& 1
	 		~ 	
 
	N 		^ 		 		 		 			 	2i 2j ( ( ' 	( 		* 	# S SS SS S 2i 2E E:" :
:$ :
9 		 	) i   ? !/ !*/ r   