File: //usr/lib/python3/dist-packages/twisted/mail/__pycache__/interfaces.cpython-38.pyc
U
W[�} � @ s� d Z ddlmZmZ ddlmZ G dd� de�ZG dd� de�ZG dd � d e�ZG d
d� de�Z G dd
� d
e�Z
G dd� de�ZG dd� de
�ZG dd� de�Z
G dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG d d!� d!e�ZG d"d#� d#e�ZG d$d%� d%e�ZG d&d'� d'e�ZG d(d)� d)e�ZG d*d+� d+e�ZG d,d-� d-e�Zd+d)d'd%d!dd#dddd-dddd
dddd dgZd.S )/z/
Interfaces for L{twisted.mail}.
@since: 16.5
� )�absolute_import�division)� Interfacec @ s( e Zd ZdZdd� Zdd� Zdd� ZdS ) �IChallengeResponsez;
An C{IMAPrev4} authorization challenge mechanism.
c C s dS )zd
Return a client challenge.
@return: A challenge.
@rtype: L{bytes}
N� r r r �9/usr/lib/python3/dist-packages/twisted/mail/interfaces.py�getChallenge s zIChallengeResponse.getChallengec C s dS )aL
Extract a username and possibly a password from a response and
assign them to C{username} and C{password} instance variables.
@param response: A decoded response.
@type response: L{bytes}
@see: L{credentials.IUsernamePassword} or
L{credentials.IUsernameHashedPassword}
Nr )Zresponser r r �setResponse s zIChallengeResponse.setResponsec C s dS )a=
Are there more challenges than just the first? If so, callers
should challenge clients with the result of L{getChallenge},
and check their response with L{setResponse} in a loop until
this returns L{False}
@return: Are there more challenges?
@rtype: L{bool}
Nr r r r r �moreChallenges* s z!IChallengeResponse.moreChallengesN)�__name__�
__module__�__qualname__�__doc__r r r
r r r r r s
r c @ s e Zd Zdd� Zdd� ZdS )�IClientAuthenticationc C s dS )zl
Return an identifier associated with this authentication scheme.
@rtype: L{bytes}
Nr r r r r �getName9 s zIClientAuthentication.getNamec C s dS )z7
Generate a challenge response string.
Nr )ZsecretZ challenger r r �challengeResponse@ s z'IClientAuthentication.challengeResponseN)r r r
r r r r r r r 7 s r c @ s8 e Zd ZdZdd� Zdd� Zdd� Zdd � Zd
d� ZdS )
�IServerFactoryPOP3a�
An interface for querying capabilities of a POP3 server.
Any cap_* method may raise L{NotImplementedError} if the particular
capability is not supported. If L{cap_EXPIRE()} does not raise
L{NotImplementedError}, L{perUserExpiration()} must be implemented,
otherwise they are optional. If L{cap_LOGIN_DELAY()} is implemented,
L{perUserLoginDelay()} must be implemented, otherwise they are optional.
@type challengers: L{dict} of L{bytes} -> L{IUsernameHashedPassword
<cred.credentials.IUsernameHashedPassword>}
@ivar challengers: A mapping of challenger names to
L{IUsernameHashedPassword <cred.credentials.IUsernameHashedPassword>}
provider.
c C s dS )z�
Return a string describing the POP3 server implementation.
@rtype: L{bytes}
@return: Server implementation information.
Nr r r r r �cap_IMPLEMENTATIONW s z%IServerFactoryPOP3.cap_IMPLEMENTATIONc C s dS )z�
Return the minimum number of days messages are retained.
@rtype: L{int} or L{None}
@return: The minimum number of days messages are retained or none, if
the server never deletes messages.
Nr r r r r �
cap_EXPIRE` s zIServerFactoryPOP3.cap_EXPIREc C s dS )z�
Indicate whether the message expiration policy differs per user.
@rtype: L{bool}
@return: C{True} when the message expiration policy differs per user,
C{False} otherwise.
Nr r r r r �perUserExpirationj s z$IServerFactoryPOP3.perUserExpirationc C s dS )z�
Return the minimum number of seconds between client logins.
@rtype: L{int}
@return: The minimum number of seconds between client logins.
Nr r r r r �cap_LOGIN_DELAYt s z"IServerFactoryPOP3.cap_LOGIN_DELAYc C s dS )z�
Indicate whether the login delay period differs per user.
@rtype: L{bool}
@return: C{True} when the login delay differs per user, C{False}
otherwise.
Nr r r r r �perUserLoginDelay} s z$IServerFactoryPOP3.perUserLoginDelayN) r r r
r r r r r r r r r r r G s
r c @ sB e Zd ZdZddd�Zdd� Zdd� Zd d
� Zdd� Zd
d� Z dS )�IMailboxPOP3a�
An interface for mailbox access.
Message indices are 0-based.
@type loginDelay: L{int}
@ivar loginDelay: The number of seconds between allowed logins for the
user associated with this mailbox.
@type messageExpiration: L{int}
@ivar messageExpiration: The number of days messages in this mailbox will
remain on the server before being deleted.
Nc C s dS )a
Retrieve the size of a message, or, if none is specified, the size of
each message in the mailbox.
@type index: L{int} or L{None}
@param index: The 0-based index of the message.
@rtype: L{int}, sequence of L{int}, or L{Deferred <defer.Deferred>}
@return: The number of octets in the specified message, or, if an
index is not specified, a sequence of the number of octets for
all messages in the mailbox or a deferred which fires with
one of those. Any value which corresponds to a deleted message
is set to 0.
@raise ValueError or IndexError: When the index does not correspond to
a message in the mailbox. The use of ValueError is preferred.
Nr ��indexr r r �listMessages� s zIMailboxPOP3.listMessagesc C s dS )a�
Retrieve a file containing the contents of a message.
@type index: L{int}
@param index: The 0-based index of a message.
@rtype: file-like object
@return: A file containing the message.
@raise ValueError or IndexError: When the index does not correspond to
a message in the mailbox. The use of ValueError is preferred.
Nr r r r r �
getMessage� s zIMailboxPOP3.getMessagec C s dS )a�
Get a unique identifier for a message.
@type index: L{int}
@param index: The 0-based index of a message.
@rtype: L{bytes}
@return: A string of printable characters uniquely identifying the
message for all time.
@raise ValueError or IndexError: When the index does not correspond to
a message in the mailbox. The use of ValueError is preferred.
Nr r r r r �getUidl� s zIMailboxPOP3.getUidlc C s dS )a�
Mark a message for deletion.
This must not change the number of messages in this mailbox. Further
requests for the size of the deleted message should return 0. Further
requests for the message itself may raise an exception.
@type index: L{int}
@param index: The 0-based index of a message.
@raise ValueError or IndexError: When the index does not correspond to
a message in the mailbox. The use of ValueError is preferred.
Nr r r r r �
deleteMessage� s zIMailboxPOP3.deleteMessagec C s dS )z�
Undelete all messages marked for deletion.
Any message which can be undeleted should be returned to its original
position in the message sequence and retain its original UID.
Nr r r r r �undeleteMessages� s zIMailboxPOP3.undeleteMessagesc C s dS )zJ
Discard the contents of any message marked for deletion.
Nr r r r r �sync� s zIMailboxPOP3.sync)N)
r r r
r r r r r r r r r r r r � s
r c @ s( e Zd ZdZdd� Zdd� Zdd� ZdS ) �IDomainz)
An interface for email domains.
c C s dS )a�
Check whether a user exists in this domain.
@type user: L{User}
@param user: A user.
@rtype: no-argument callable which returns L{IMessageSMTP} provider
@return: A function which takes no arguments and returns a message
receiver for the user.
@raise SMTPBadRcpt: When the given user does not exist in this domain.
Nr ��userr r r �exists� s zIDomain.existsc C s dS )z�
Add a user to this domain.
@type user: L{bytes}
@param user: A username.
@type password: L{bytes}
@param password: A password.
Nr )r# Zpasswordr r r �addUser� s zIDomain.addUserc C s dS )z�
Return credentials checkers for this domain.
@rtype: L{list} of L{ICredentialsChecker
<twisted.cred.checkers.ICredentialsChecker>} provider
@return: Credentials checkers for this domain.
Nr r r r r �getCredentialsCheckers s zIDomain.getCredentialsCheckersN)r r r
r r$ r% r&