/usr/lib/python3/dist-packages/twisted/mail/__pycache__
Edit: /usr/lib/python3/dist-packages/twisted/mail/__pycache__/maildir.cpython-310.pyc (29890B)
o
bMl @ s~ d Z ddlZddlZddlZddlZddlmZ ddlmZ ddl m
Z
ddlmZm
Z
mZ ddlmZ ddlmZmZmZ dd lmZmZmZ dd
lmZ ddlmZ ddlmZmZ d
Z G dd dZ!e!ej"Z#dd Z$G dd dej%Z&e
ej'G dd dZ(e
ej)G dd dZ*G dd dej+Z,e
ej-G dd dZ.e
ej/G dd de(Z0e
ej1G dd dZ2dS ) z
Maildir-style mailbox support.
N)md5)IO)implementer)checkerscredentialsportal)UnauthorizedLogin)defer
interfacesreactor)mailpop3smtpdirdbm)basic)failurelogzFrom: Twisted.mail Internals
Subject: An Error Occurred
An internal server error has occurred. Please contact the
server administrator.
c @ sD e Zd ZdZdZe Ze
dd
ddZdd Zd d
Z
dS )_MaildirNameGeneratoraK
A utility class to generate a unique maildir name.
@type n: L{int}
@ivar n: A counter used to generate unique integers.
@type p: L{int}
@ivar p: The ID of the current process.
@type s: L{bytes}
@ivar s: A representation of the hostname.
@ivar _clock: See C{clock} parameter of L{__init__}.
r /z\057:z\072c C
|| _ dS )z
@type clock: L{IReactorTime
} provider
@param clock: A reactor which will be used to learn the current time.
N)_clock)selfclock r 6/usr/lib/python3/dist-packages/twisted/mail/maildir.py__init__8
z_MaildirNameGenerator.__init__c C sb | j d | _ | j }tt|}dt|t| d f }| d| d| j d| j d| j S )a
Generate a string which is intended to be unique across all calls to
this function (across all processes, reboots, etc).
Strings returned by earlier calls to this method will compare less
than strings returned by later calls as long as the clock provided
doesn't go backwards.
@rtype: L{bytes}
@return: A unique string.
z%07dg cAz.MPQ.)nr secondsstrintps)r tr$ microsecondsr r r generate? s
&z_MaildirNameGenerator.generateN)__name__
__module____qualname____doc__r# osgetpidr' socketgethostnamereplacer( r r+ r r r r r $ s r c C s t | } t j| sAt | d dD ]
}t t j| |d qdD ]}t t j| d|d q#tt j| ddd dS dS )z
Create a maildir user directory if it doesn't already exist.
@type dir: L{bytes}
@param dir: The path name for a user directory.
i )newcurtmp.Trash)r5 r6 r7 r8
maildirfolderwN)r0 fsdecodepathisdirmkdirjoinopenclose)dirsubdirr r r initializeMaildirU s
rD c @ s, e Zd ZdZdZdd Zdd Zdd ZdS ) MaildirMessagez
A message receiver which adds a header and delivers a message to a file
whose name includes the size of the message.
@type size: L{int}
@ivar size: The number of octets in the message.
Nc O s<