o
    Òó·iø!  ã                   @   s´  d Z ddlmZ G dd„ deƒZG dd„ deƒZG dd„ deƒZG d	d
„ d
eƒZG dd„ deƒZG dd„ deƒZ	G dd„ deƒZ
G dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd „ d eƒZG d!d"„ d"eƒZG d#d$„ d$eƒZG d%d&„ d&eƒZG d'd(„ d(eƒZG d)d*„ d*eƒZG d+d,„ d,eƒZG d-d.„ d.eƒZG d/d0„ d0eƒZG d1d2„ d2eƒZG d3d4„ d4eƒZG d5d6„ d6eƒZG d7d8„ d8eƒZG d9d:„ d:eƒZG d;d<„ d<eƒZ G d=d>„ d>eƒZ!G d?d@„ d@e!ƒZ"G dAdB„ dBe"ƒZ#G dCdD„ dDe"ƒZ$G dEdF„ dFeƒZ%G dGdH„ dHeƒZ&G dIdJ„ dJeƒZ'G dKdL„ dLeƒZ(G dMdN„ dNe(ƒZ)G dOdP„ dPe(ƒZ*G dQdR„ dRe(ƒZ+G dSdT„ dTe(ƒZ,G dUdV„ dVe(ƒZ-dWS )Xz 
Exceptions in L{twisted.mail}.
é    )ÚOptionalc                   @   ó   e Zd ZdS )ÚIMAP4ExceptionN©Ú__name__Ú
__module__Ú__qualname__© r	   r	   úZC:\Users\psant\Downloads\PAF backend\school\venv\Lib\site-packages\twisted/mail/_except.pyr      ó    r   c                   @   r   )ÚIllegalClientResponseNr   r	   r	   r	   r
   r      r   r   c                   @   r   )ÚIllegalOperationNr   r	   r	   r	   r
   r      r   r   c                   @   r   )ÚIllegalMailboxEncodingNr   r	   r	   r	   r
   r      r   r   c                   @   r   )ÚMailboxExceptionNr   r	   r	   r	   r
   r      r   r   c                   @   ó   e Zd Zdefdd„ZdS )ÚMailboxCollisionÚreturnc                 C   ó
   d| j  S )NzMailbox named %s already exists©Úargs©Úselfr	   r	   r
   Ú__str__    ó   
zMailboxCollision.__str__N©r   r   r   Ústrr   r	   r	   r	   r
   r      ó    r   c                   @   r   )ÚNoSuchMailboxr   c                 C   r   )NzNo mailbox named %s existsr   r   r	   r	   r
   r   %   r   zNoSuchMailbox.__str__Nr   r	   r	   r	   r
   r   $   r   r   c                   @   r   )ÚReadOnlyMailboxr   c                 C   s   dS )NzMailbox open in read-only stater	   r   r	   r	   r
   r   *   s   zReadOnlyMailbox.__str__Nr   r	   r	   r	   r
   r   )   r   r   c                   @   r   )ÚUnhandledResponseNr   r	   r	   r	   r
   r   .   r   r   c                   @   r   )ÚNegativeResponseNr   r	   r	   r	   r
   r    2   r   r    c                   @   ó"   e Zd Zdd„ Zdefdd„ZdS )ÚNoSupportedAuthenticationc                 C   s   t  | d¡ || _|| _d S )Nz-No supported authentication schemes available)r   Ú__init__ÚserverSupportsÚclientSupports)r   r$   r%   r	   r	   r
   r#   7   s   
z"NoSupportedAuthentication.__init__r   c                 C   s   t  | ¡d | j| j¡ S )Nz,: Server supports {!r}, client supports {!r})r   r   Úformatr$   r%   r   r	   r	   r
   r   <   s   ÿþþz!NoSupportedAuthentication.__str__N©r   r   r   r#   r   r   r	   r	   r	   r
   r"   6   s    r"   c                   @   r   )ÚIllegalServerResponseNr   r	   r	   r	   r
   r(   E   r   r(   c                   @   r   )ÚIllegalIdentifierErrorNr   r	   r	   r	   r
   r)   I   r   r)   c                   @   r   )ÚIllegalQueryErrorNr   r	   r	   r	   r
   r*   M   r   r*   c                   @   r   )ÚMismatchedNestingNr   r	   r	   r	   r
   r+   Q   r   r+   c                   @   r   )ÚMismatchedQuotingNr   r	   r	   r	   r
   r,   U   r   r,   c                   @   r   )Ú	SMTPErrorNr   r	   r	   r	   r
   r-   Y   r   r-   c                   @   s`   e Zd ZdZ				ddededee dee ded	efd
d„Z	de
fdd„Zdefdd„ZdS )ÚSMTPClientErrorz,
    Base class for SMTP client errors.
    NFÚcodeÚrespÚlogÚ	addressesÚisFatalÚretryc                 C   sP   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   Úencoder/   r0   r1   r2   r3   r4   ©r   r/   r0   r1   r2   r3   r4   r	   r	   r
   r#   b   s   




zSMTPClientError.__init__r   c                 C   s   |   ¡  d¡S )Nr5   )Ú	__bytes__Údecoder   r	   r	   r
   r   „   s   zSMTPClientError.__str__c                 C   sT   | j dkr| j d›d� ¡ | j g}n| jg}| jr%| | j¡ | d¡ d |¡S )Nr   Z03dú ó    ó   
)r/   r7   r0   r1   ÚappendÚjoin)r   Úresr	   r	   r
   r9   ‡   s   


zSMTPClientError.__bytes__)NNFF)r   r   r   Ú__doc__ÚintÚbytesr   ÚobjectÚboolr#   r   r   r9   r	   r	   r	   r
   r.   ]   s*    ùþýüûú
ù"r.   c                   @   ó   e Zd ZdZdS )ÚESMTPClientErrorz-
    Base class for ESMTP client errors.
    N©r   r   r   rA   r	   r	   r	   r
   rG   ’   ó    rG   c                   @   rF   )ÚEHLORequiredErrorz{
    The server does not support EHLO.

    This is considered a non-fatal error (the connection will not be dropped).
    NrH   r	   r	   r	   r
   rJ   ˜   rI   rJ   c                   @   rF   )ÚAUTHRequiredErrorz™
    Authentication was required but the server does not support it.

    This is considered a non-fatal error (the connection will not be dropped).
    NrH   r	   r	   r	   r
   rK       rI   rK   c                   @   rF   )Ú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).
    NrH   r	   r	   r	   r
   rL   ¨   rI   rL   c                   @   rF   )Ú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).
    NrH   r	   r	   r	   r
   rM   °   rI   rM   c                   @   rF   )Ú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).
    NrH   r	   r	   r	   r
   rN   ¼   rI   rN   c                   @   rF   )ÚSMTPTLSErrorz–
    An error occurred while negiotiating for transport security.

    This is considered a non-fatal error (the connection will not be dropped).
    NrH   r	   r	   r	   r
   rO   È   rI   rO   c                   @   ó   e Zd ZdZd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              	   C   ó   t  | ||||||¡ d S ©N©r.   r#   r8   r	   r	   r
   r#   ×   ó   zSMTPConnectError.__init__©NNTT©r   r   r   rA   r#   r	   r	   r	   r
   rQ   Ð   ó    rQ   c                   @   rP   )Ú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              	   C   rR   rS   rT   r8   r	   r	   r
   r#   â   rU   zSMTPTimeoutError.__init__rV   rW   r	   r	   r	   r
   rY   Û   rX   rY   c                   @   s   e Zd ZdZd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              	   C   rR   rS   rT   r8   r	   r	   r
   r#   í   rU   zSMTPProtocolError.__init__)NNTFrW   r	   r	   r	   r
   rZ   æ   rX   rZ   c                   @   rF   )ÚSMTPDeliveryErrorz=
    Indicates that a delivery attempt has had an error.
    NrH   r	   r	   r	   r
   r[   ñ   rI   r[   c                   @   r!   )ÚSMTPServerErrorc                 C   s   || _ || _d S rS   ©r/   r0   )r   r/   r0   r	   r	   r
   r#   ø   s   
zSMTPServerError.__init__r   c                 C   s   d| j | jf S )Nz%.3d %sr]   r   r	   r	   r
   r   ü   s   zSMTPServerError.__str__Nr'   r	   r	   r	   r
   r\   ÷   s    r\   c                   @   r!   )ÚSMTPAddressErrorc                 C   s(   ddl m} t | ||¡ ||ƒ| _d S )Nr   )ÚAddress)Ztwisted.mail.smtpr_   r\   r#   Úaddr)r   r`   r/   r0   r_   r	   r	   r
   r#     s   zSMTPAddressError.__init__r   c                 C   s   d| j | j| jf S )Nz%.3d <%s>... %s)r/   r`   r0   r   r	   r	   r
   r     ó   zSMTPAddressError.__str__Nr'   r	   r	   r	   r
   r^      s    r^   c                   @   ó   e Zd Zddd„ZdS )ÚSMTPBadRcpté&  ú$Cannot receive for specified addressc                 C   ó   t  | |||¡ d S rS   ©r^   r#   ©r   r`   r/   r0   r	   r	   r
   r#     ra   zSMTPBadRcpt.__init__N)rd   re   ©r   r   r   r#   r	   r	   r	   r
   rc     ó    rc   c                   @   rb   )ÚSMTPBadSenderrd   úSender not acceptablec                 C   rf   rS   rg   rh   r	   r	   r
   r#     ra   zSMTPBadSender.__init__N)rd   rl   ri   r	   r	   r	   r
   rk     rj   rk   c                   @   rF   )ÚAddressErrorz 
    Parse error in address
    NrH   r	   r	   r	   r
   rm     rI   rm   c                   @   rF   )Ú	POP3Errorz)
    The base class for POP3 errors.
    NrH   r	   r	   r	   r
   rn     s    rn   c                   @   rF   )Ú_POP3MessageDeletedzb
    An internal control-flow error which indicates that a deleted message was
    requested.
    NrH   r	   r	   r	   r
   ro   #  rI   ro   c                   @   rF   )ÚPOP3ClientErrorzA
    The base class for all exceptions raised by POP3Client.
    NrH   r	   r	   r	   r
   rp   *  rI   rp   c                   @   rF   )Ú InsecureAuthenticationDisallowedze
    An error indicating secure authentication was required but no mechanism
    could be found.
    NrH   r	   r	   r	   r
   rq   0  rI   rq   c                   @   rF   )ÚTLSErrorzš
    An error indicating secure authentication was required but either the
    transport does not support TLS or no TLS context factory was supplied.
    NrH   r	   r	   r	   r
   rr   7  rI   rr   c                   @   rF   )ÚTLSNotSupportedErrorzi
    An error indicating secure authentication was required but the server does
    not support TLS.
    NrH   r	   r	   r	   r
   rs   >  rI   rs   c                   @   s   e Zd ZdZd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                 C   s   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)rp   r#   Úconsumer)r   Úreasonru   r	   r	   r
   r#   M  s   	
zServerErrorResponse.__init__rS   rW   r	   r	   r	   r
   rt   E  s    rt   c                   @   rF   )ÚLineTooLongz†
    An error indicating that the server sent a line which exceeded the
    maximum line length (L{LineOnlyReceiver.MAX_LENGTH}).
    NrH   r	   r	   r	   r
   rw   Z  rI   rw   N).rA   Útypingr   Ú	Exceptionr   r   r   r   r   r   r   r   r   r    r"   r(   r)   r*   r+   r,   r-   r.   rG   rJ   rK   rL   rM   rN   rO   rQ   rY   rZ   r[   r\   r^   rc   rk   rm   rn   ro   rp   rq   rr   rs   rt   rw   r	   r	   r	   r
   Ú<module>   sX   5	