§
    Ètºf�9 ã            	       ó~  — d Z ddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlmZmZ ddlmZ ddlmZ ddlmZmZmZ ddlmZ ddlmZ dd	lmZmZ dd
lmZm Z m!Z! ddl"m#Z# ddl$m%Z%m&Z&m'Z'm(Z(m)Z) ddl*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z: ddl;m<Z=m>Z>m?Z@mAZBmCZDmEZFmGZHmIZJmKZLmMZNmOZOmPZQ ddlRmSZSmTZT ddlUmVZVmWZW ddlXmYZYmZZZm[Z[m\Z\  e] e^ e_dd¦  «        d `                    ¦   «         ¦  «        ¦  «        Zad„ Zbd„ Zc G d„ d¦  «        Zd G d„ d¦  «        Ze G d„ d¦  «        Zf G d„ d¦  «        Zg G d„ d ¦  «        Zhd!Zi ej e e_d"¦  «         e_d#d$¦  «        ¦  «        ¦  «        Zkd%eiz   ekz   Zlel m                    d&¦  «        Zn ejo        d'enz   d(z   ¦  «        Zp ejd)„  e_d$¦  «        D ¦   «         ¦  «        Zq eeF¦  «         G d*„ d+eSjr        eTjs        ¦  «        ¦   «         Zt e ju        ¦   «         Zv eeF¦  «         G d,„ d-eSjr        eTjs        ¦  «        ¦   «         Zwdxd.„Zxd/Zyd0Zze{Z|dyd1„Z}d2„ Z~d3„ Zdxd4„Z€d5„ Z�d6„ Z‚d7„ Zƒdzd8„Z„d9„ Z…d:ejd;ejfd<„Z† G d=„ d>¦  «        Z‡d?Zˆd@„ Z‰dA„ ZŠdB„ Z‹dC„ ZŒdD„ Z� ee=¦  «         G dE„ dF¦  «        ¦   «         ZŽ eeO¦  «         G dG„ dHeŽ¦  «        ¦   «         Z�dIdJdKdLdMdNœZ�dO„ Z‘dP„ Z’dQ„ Z“dR„ Z”dS„ Z•dT„ Z–dU„ Z— G dV„ dW¦  «        Z˜ G dX„ dYe˜¦  «        Z™ G dZ„ d[e™¦  «        Zš G d\„ d]e™¦  «        Z› G d^„ d_e˜¦  «        Zœd{da„Z�db„ Zždc„ ZŸdd„ Z  G de„ df¦  «        Z¡ G dg„ dh¦  «        Z¢ G di„ dj¦  «        Z£dk„ Z¤ e¥e¦dldm„ ¦  «        Z§dn„ Z¨do„ Z©dxdp„Zªdxdq„Z« G dr„ dsej¬        ¦  «        Z¬ G dt„ duej­        ¦  «        Z­ ej®        eªe«e¬e­¦  «        Z¯dv„ Z° ej±        e°¦  «         g dw¢Z²dS )|aƒ  
An IMAP4 protocol implementation

@author: Jp Calderone

To do::
  Suspend idle timeout while server is processing
  Use an async message parser instead of buffering in memory
  Figure out a way to not queue multi-message client requests (Flow? A simple callback?)
  Clarify some API docs (Query, etc)
  Make APPEND recognize (again) non-existent mailboxes before accepting the literal
é    N)ÚdecodebytesÚencodebytes)ÚBytesIO)Úchain)ÚAnyÚListÚcast)Úimplementer)Úcredentials)ÚUnauthorizedLoginÚUnhandledCredentials)ÚdeferÚerrorÚ
interfaces)ÚmaybeDeferred)ÚCramMD5ClientAuthenticatorÚLOGINAuthenticatorÚLOGINCredentialsÚPLAINAuthenticatorÚPLAINCredentials)ÚIllegalClientResponseÚIllegalIdentifierErrorÚIllegalMailboxEncodingÚIllegalOperationÚIllegalQueryErrorÚIllegalServerResponseÚIMAP4ExceptionÚMailboxCollisionÚMailboxExceptionÚMismatchedNestingÚMismatchedQuotingÚNegativeResponseÚNoSuchMailboxÚNoSupportedAuthenticationÚReadOnlyMailboxÚUnhandledResponse)ÚIAccountIMAPÚIClientAuthenticationÚICloseableMailboxIMAPÚIMailboxIMAPÚIMailboxIMAPInfoÚIMailboxIMAPListenerÚIMessageIMAPÚIMessageIMAPCopierÚIMessageIMAPFileÚIMessageIMAPPartÚINamespacePresenterÚISearchableIMAPMailbox)ÚbasicÚpolicies)ÚlogÚtext)Ú_matchingStringÚ	iterbytesÚnativeStringÚnetworkStringé   é   z/Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Decc                 ó   — | |u r|n| S )zô
    Swap C{this} with C{that} if C{this} is C{ifIs}.

    @param this: The object that may be replaced.

    @param that: The object that may replace C{this}.

    @param ifIs: An object whose identity will be compared to
        C{this}.
    © )ÚthisÚthatÚifIss      úQ/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/twisted/mail/imap4.pyÚ_swaprC   _   s   € ð ˜4�<�<ˆ4ˆ4 TÐ)ó    c                 ó$   ‡‡— ˆˆfd„| D ¦   «         S )a–  
    Swap each element in each pair in C{of} with C{that} it is
    C{ifIs}.

    @param of: A list of 2-L{tuple}s, whose members may be the object
        C{that}
    @type of: L{list} of 2-L{tuple}s

    @param ifIs: An object whose identity will be compared to members
        of each pair in C{of}

    @return: A L{list} of 2-L{tuple}s with all occurences of C{ifIs}
        replaced with C{that}
    c                 óZ   •— g | ]'\  }}t          |‰‰¦  «        t          |‰‰¦  «        f‘Œ(S r>   )rC   )Ú.0ÚfirstÚsecondrA   r@   s      €€rB   ú
<listcomp>z!_swapAllPairs.<locals>.<listcomp>|   sG   ø€ ð ð ð ÙBOÀ%È�ˆu�d˜DÑ	!Ô	!¥5¨°°tÑ#<Ô#<Ð=ðð ð rD   r>   )Úofr@   rA   s    ``rB   Ú_swapAllPairsrL   m   s4   øø€ ðð ð ð ð ØSUðñ ô ð rD   c                   óè   — e Zd ZU dZg Zee         ed<    ed¦  «        Z	eefd„Z
ed„ ¦   «         Zej        d„ ¦   «         Zefd„Zd„ Zd	„ Zd
„ Zd„ Zd„ Zd„ Zd„ Zd„ Zdefd„Zdefd„Zdedefd„ZdS )Ú
MessageSeta

  
    A set of message identifiers usable by both L{IMAP4Client} and
    L{IMAP4Server} via L{IMailboxIMAP.store} and
    L{IMailboxIMAP.fetch}.

    These identifiers can be either message sequence numbers or unique
    identifiers.  See Section 2.3.1, "Message Numbers", RFC 3501.

    This represents the C{sequence-set} described in Section 9,
    "Formal Syntax" of RFC 3501:

        - A L{MessageSet} can describe a single identifier, e.g.
          C{MessageSet(1)}

        - A L{MessageSet} can describe C{*} via L{None}, e.g.
          C{MessageSet(None)}

        - A L{MessageSet} can describe a range of identifiers, e.g.
          C{MessageSet(1, 2)}.  The range is inclusive and unordered
          (see C{seq-range} in RFC 3501, Section 9), so that
          C{Message(2, 1)} is equivalent to C{MessageSet(1, 2)}, and
          both describe messages 1 and 2.  Ranges can include C{*} by
          specifying L{None}, e.g. C{MessageSet(None, 1)}.  In all
          cases ranges are normalized so that the smallest identifier
          comes first, and L{None} always comes last; C{Message(2, 1)}
          becomes C{MessageSet(1, 2)} and C{MessageSet(None, 1)}
          becomes C{MessageSet(1, None)}

        - A L{MessageSet} can describe a sequence of single
          identifiers and ranges, constructed by addition.
          C{MessageSet(1) + MessageSet(5, 10)} refers the message
          identified by C{1} and the messages identified by C{5}
          through C{10}.

    B{NB: The meaning of * varies, but it always represents the
    largest number in use}.

    B{For servers}: Your L{IMailboxIMAP} provider must set
    L{MessageSet.last} to the highest-valued identifier (unique or
    message sequence) before iterating over it.

    B{For clients}: C{*} consumes ranges smaller than it, e.g.
    C{MessageSet(1, 100) + MessageSet(50, None)} is equivalent to
    C{1:*}.

    @type getnext: Function taking L{int} returning L{int}
    @ivar getnext: A function that returns the next message number,
        used when iterating through the L{MessageSet}.  By default, a
        function returning the next integer is supplied, but as this
        can be rather inefficient for sparse UID iterations, it is
        recommended to supply one when messages are requested by UID.
        The argument is provided as a hint to the implementation and
        may be ignored if it makes sense to do so (eg, if an iterator
        is being used that maintains its own state, it is guaranteed
        that it will not be called out-of-order).
    Ú_emptyÚinfc                 óò   — | j         | _        g | _        d„ | _        || j         u rdS t	          |t
          ¦  «        r%|dd…         | _        |                      ¦   «          dS |                      ||¦  «         dS )zÔ
        Create a new MessageSet()

        @type start: Optional L{int}
        @param start: Start of range, or only message number

        @type end: Optional L{int}
        @param end: End of range.
        c                 ó   — | dz   S ©Nr;   r>   ©Úxs    rB   ú<lambda>z%MessageSet.__init__.<locals>.<lambda>Ê   s
   €   Q¡€ rD   N)rO   Ú_lastÚrangesÚgetnextÚ
isinstanceÚlistÚcleanÚadd©ÚselfÚstartÚends      rB   Ú__init__zMessageSet.__init__¾   s}   € ð ”[ˆŒ
ØˆŒØ&�ˆŒð �D”KÐÐØˆFå�e�TÑ"Ô"ð 	!Ø   œ(ˆDŒKØ�JŠJ‰LŒLˆLˆLˆLà�HŠH�U˜CÑ Ô Ð Ð Ð rD   c                 ó   — | j         S )z{
        The largest number in use.
        This is undefined until it has been set by assigning to this property.
        )rW   ©r_   s    rB   ÚlastzMessageSet.lastÖ   s   € ð ŒzÐrD   c                 óì   — | j         | j        urt          d¦  «        ‚|| _         t          | j        ¦  «        D ]&\  }\  }}|€|}|€|}||k    r||}}||f| j        |<   Œ'|                      ¦   «          dS )zø
        Replaces all occurrences of "*".  This should be the
        largest number in use.  Must be set before attempting to
        use the MessageSet as a container.

        @raises ValueError: if a largest value has already been set.
        zlast already setN)rW   rO   Ú
ValueErrorÚ	enumeraterX   r\   )r_   ÚvalueÚiÚlowÚhighs        rB   re   zMessageSet.lastÞ   s’   € ð Œ:˜Tœ[Ð(Ð(ÝÐ/Ñ0Ô0Ð0àˆŒ
Ý'¨¬Ñ4Ô4ð 	)ð 	)‰NˆA‰{��TØˆ{Ø�Øˆ|Ø�Ø�TŠzˆzØ  #�T�Ø! 4˜[ˆDŒK˜‰NˆNØ�
Š
‰ŒˆˆˆrD   c                 ó&  — || j         u r|}| j        | j         ur|€| j        }|€| j        }t          ||gt	          j        t          | j        d¬¦  «        ¬¦  «        \  }}| j         	                    ||f¦  «         |  
                    ¦   «          dS )zÃ
        Add another range

        @type start: L{int}
        @param start: Start of range, or only message number

        @type end: Optional L{int}
        @param end: End of range.
        N©r@   rA   )Úkey)rO   rW   re   ÚsortedÚ	functoolsÚpartialrC   Ú	_infinityrX   Úappendr\   r^   s      rB   r]   zMessageSet.addõ   s    € ð �$”+ÐÐØˆCàŒ:˜Tœ[Ð(Ð(Øˆ}Øœ	�Øˆ{Ø”i�åØ�CˆL�iÔ/µ¸D¼NÐQUÐVÑVÔVð
ñ 
ô 
‰
ˆˆsð 	Œ×Ò˜E 3˜<Ñ(Ô(Ð(Ø�
Š
‰ŒˆˆˆrD   c                 ó*  — t          |t          ¦  «        r| j        |j        z   }t          |¦  «        S t          | j        ¦  «        }| j        | j        ur| j        |_        	  |j        |Ž  n%# t          $ r |                     |¦  «         Y nw xY w|S ©N)rZ   rN   rX   re   rO   r]   Ú	TypeError)r_   ÚotherrX   Úress       rB   Ú__add__zMessageSet.__add__  sž   € Ý�e�ZÑ(Ô(ð 	Ø”[ 5¤<Ñ/ˆFÝ˜fÑ%Ô%Ð%å˜Tœ[Ñ)Ô)ˆCØŒy ¤Ð+Ð+Øœ9�”ðØ�”˜���øÝð ð ð Ø—’˜‘”���ðøøøàˆJs   Á#
A. Á.BÂBc                 óú   — t          |t          ¦  «        r4| j                             |j        ¦  «         |                      ¦   «          n1	  | j        |Ž  n%# t          $ r |                      |¦  «         Y nw xY w| S )zÚ
        Extend our messages with another message or set of messages.

        @param other: The messages to include.
        @type other: L{MessageSet}, L{tuple} of two L{int}s, or a
            single L{int}
        )rZ   rN   rX   Úextendr\   r]   rw   ©r_   rx   s     rB   r|   zMessageSet.extend  s‰   € õ �e�ZÑ(Ô(ð 	 ØŒK×Ò˜uœ|Ñ,Ô,Ð,Ø�JŠJ‰LŒLˆLˆLð Ø�”˜%Ð Ð Ð øÝð  ð  ð  Ø—’˜‘”���ð øøøð ˆs   Á
A ÁA8Á7A8c                 óŒ  — t          t          | j        | j        d¬¦  «        ¦  «        }t	          d¦  «        t	          d¦  «        fg}|D ]T\  }}|d         \  }}||dz
  k     r|                     ||f¦  «         Œ1t          ||¦  «        t          ||¦  «        f|d<   ŒUt          |dd…         d| j        ¬¦  «        | _        dS )z>
        Clean ranges list, combining adjacent ranges
        Nrn   z-inféÿÿÿÿr;   )rp   rL   rX   rs   Úfloatrt   ÚminÚmax)r_   rX   ÚmergedRangesrk   rl   ÚpreviousLowÚpreviousHighs          rB   r\   zMessageSet.clean/  sÖ   € õ
 � d¤k¸¼ÈTÐRÑRÔRÑSÔSˆå˜v™œ­¨f©¬Ð6Ð7ˆàð 	Pð 	P‰IˆC�Ø(4°RÔ(8Ñ%ˆK˜à˜c A™gÒ%Ð%Ø×#Ò# S¨$ KÑ0Ô0Ð0Øå # K°Ñ 5Ô 5µs¸<ÈÑ7NÔ7NÐOˆL˜ÑÐå# L°°°Ô$4¸4ÀdÄnÐUÑUÔUˆŒˆˆrD   c                 ó,   — | j         d         d         du S )a¼  
        Is there a L{None} in our ranges?

        L{MessageSet.clean} merges overlapping or consecutive ranges.
        None is represents a value larger than any number.  There are
        thus two cases:

            1. C{(x, *) + (y, z)} such that C{x} is smaller than C{y}

            2. C{(z, *) + (x, y)} such that C{z} is larger than C{y}

        (Other cases, such as C{y < x < z}, can be split into these
        two cases; for example C{(y - 1, y)} + C{(x, x) + (z, z + 1)})

        In case 1, C{* > y} and C{* > z}, so C{(x, *) + (y, z) = (x,
        *)}

        In case 2, C{z > x and z > y}, so the intervals do not merge,
        and the ranges are sorted as C{[(x, y), (z, *)]}.  C{*} is
        represented as C{(*, *)}, so this is the same as 2.  but with
        a C{z} that is greater than everything.

        The result is that there is a maximum of two L{None}s, and one
        of them has to be the high element in the last tuple in
        C{self.ranges}.  That means checking if C{self.ranges[-1][-1]}
        is L{None} suffices to check if I{any} element is L{None}.

        @return: L{True} if L{None} is in some range in ranges and
            L{False} if otherwise.
        r   N)rX   rd   s    rB   Ú_noneInRangeszMessageSet._noneInRangesC  s   € ð> Œ{˜2Œ˜rÔ" dÐ*Ð*rD   c                 óŒ   — |                       ¦   «         rt          d¦  «        ‚| j        D ]\  }}||cxk    r|k    rn Œ dS ŒdS )z“
        May raise TypeError if we encounter an open-ended range

        @param value: Is this in our ranges?
        @type value: L{int}
        z.Can't determine membership; last value not setTF)r‡   rw   rX   )r_   ri   rk   rl   s       rB   Ú__contains__zMessageSet.__contains__d  sr   € ð ×ÒÑÔð 	NÝÐLÑMÔMÐMàœð 	ð 	‰IˆC�Ø�eÐ#Ð#Ò#Ð#˜tÒ#Ð#Ð#Ð#Ð#Ø�t�tð $ð ˆurD   c              #   óž   K  — | j         D ]B\  }}|                      |dz
  ¦  «        }||k    r|V — |                      |¦  «        }||k    °ŒCd S rS   )rX   rY   )r_   ÚlÚhs      rB   Ú	_iteratorzMessageSet._iteratoru  sg   è è € Ø”Kð 	$ð 	$‰DˆAˆqØ—’˜Q ™UÑ#Ô#ˆAØ�q’&�&Ø���Ø—L’L ‘O”O�ð �q’&�&øð	$ð 	$rD   c                 óp   — |                       ¦   «         rt          d¦  «        ‚|                      ¦   «         S )Nz!Can't iterate; last value not set)r‡   rw   r�   rd   s    rB   Ú__iter__zMessageSet.__iter__|  s6   € Ø×ÒÑÔð 	AÝÐ?Ñ@Ô@Ð@à�~Š~ÑÔÐrD   c                 ól   — d}| j         D ])\  }}|€|dz  }Œ|€t          d¦  «        ‚|||z
  dz   z  }Œ*|S )Nr   r;   z%Can't size object; last value not set)rX   rw   )r_   ry   r‹   rŒ   s       rB   Ú__len__zMessageSet.__len__‚  sY   € ØˆØ”Kð 	#ð 	#‰DˆAˆqØˆyØ�q‘��Ø�ÝÐ GÑHÔHÐHà˜˜A™ ‘{Ñ"��àˆ
rD   Úreturnc                 ó8  — g }| j         D ]|\  }}||k    r;|€|                     d¦  «         Œ#|                     t          |¦  «        ¦  «         ŒF|€|                     d|fz  ¦  «         Œb|                     d||fz  ¦  «         Œ}d                     |¦  «        S )NÚ*z%d:*z%d:%dú,)rX   rt   ÚstrÚjoin)r_   Úprk   rl   s       rB   Ú__str__zMessageSet.__str__Ž  s¤   € ØˆØœð 		0ð 		0‰IˆC�Ø�dŠ{ˆ{Ø�;Ø—H’H˜S‘M”M�M�Mà—H’H�S ™XœXÑ&Ô&Ð&Ð&Ø�Ø—’˜ 3 &™Ñ)Ô)Ð)Ð)à—’˜ C¨ ;Ñ.Ñ/Ô/Ð/Ð/Ø�xŠx˜‰{Œ{ÐrD   c                 ó(   — dt          | ¦  «        › d�S )Nz<MessageSet ú>©r–   rd   s    rB   Ú__repr__zMessageSet.__repr__œ  s   € Ø*�c $™iœiÐ*Ð*Ð*Ð*rD   rx   c                 ó€   — t          |t          ¦  «        r#t          t          | j        |j        k    ¦  «        S t
          S rv   )rZ   rN   r	   ÚboolrX   ÚNotImplementedr}   s     rB   Ú__eq__zMessageSet.__eq__Ÿ  s3   € Ý�e�ZÑ(Ô(ð 	;Ý�˜dœk¨U¬\Ò9Ñ:Ô:Ð:ÝÐrD   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__rO   r   r   Ú__annotations__r€   rs   rb   Úpropertyre   Úsetterr]   rz   r|   r\   r‡   r‰   r�   r�   r‘   r–   r™   r�   ÚobjectrŸ   r¡   r>   rD   rB   rN   rN   �   s‚  € € € € € € ð7ð 7ðr €FˆD�ŒIÐÐÑØ��e‘”€Ià#¨ð !ð !ð !ð !ð0 ðð ñ „Xðð 
„[ðð ñ „[ðð, $ð ð ð ð ð2ð ð ðð ð ð&Vð Vð Vð(+ð +ð +ðBð ð ð"$ð $ð $ð ð  ð  ð
ð 
ð 
ð˜ð ð ð ð ð+˜#ð +ð +ð +ð +ð˜Fð  tð ð ð ð ð ð rD   rN   c                   ó    — e Zd Zd„ Zd„ Zd„ ZdS )ÚLiteralStringc                 ó0   — || _         g | _        || _        d S rv   )ÚsizeÚdatar   ©r_   r­   Údefereds      rB   rb   zLiteralString.__init__¦  s   € ØˆŒ	ØˆŒ	ØˆŒ
ˆ
ˆ
rD   c                 ó  — | xj         t          |¦  «        z  c_         d }| j         dk    r| j                             |¦  «         nD| j         r|d | j         …         || j         d …         }}nd}|r| j                             |¦  «         |S ©Nr   rD   )r­   Úlenr®   rt   ©r_   r®   Úpassons      rB   ÚwritezLiteralString.write«  s”   € Øˆ	Œ	•S˜‘Y”YÑˆ	Œ	ØˆØŒ9�qŠ=ˆ=ØŒI×Ò˜TÑ"Ô"Ð"Ð"àŒyð Ø# K d¤i KÔ0°$°t´y°{°{Ô2C�f��à�Øð 'Ø”	× Ò  Ñ&Ô&Ð&àˆrD   c                 ón   — | j                              d                     | j        ¦  «        |f¦  «         dS )ú:
        Call deferred with data and rest of line
        rD   N)r   Úcallbackr—   r®   ©r_   Úlines     rB   r¹   zLiteralString.callbackº  s3   € ð 	Œ
×Ò˜SŸXšX d¤iÑ0Ô0°$Ð7Ñ8Ô8Ð8Ð8Ð8rD   N)r¢   r£   r¤   rb   r¶   r¹   r>   rD   rB   r«   r«   ¥  sA   € € € € € ðð ð ð
ð ð ð9ð 9ð 9ð 9ð 9rD   r«   c                   ó$   — e Zd ZdZd„ Zd„ Zd„ ZdS )ÚLiteralFileé    c                 ó’   — || _         || _        || j        k    rt          j        ¦   «         | _        d S t          ¦   «         | _        d S rv   )r­   r   Ú_memoryFileLimitÚtempfileÚTemporaryFiler®   r   r¯   s      rB   rb   zLiteralFile.__init__Ä  sA   € ØˆŒ	ØˆŒ
Ø�$Ô'Ò'Ð'Ý Ô.Ñ0Ô0ˆDŒIˆIˆIå™	œ	ˆDŒIˆIˆIrD   c                 ó  — | xj         t          |¦  «        z  c_         d }| j         dk    r| j                             |¦  «         nD| j         r|d | j         …         || j         d …         }}nd}|r| j                             |¦  «         |S r²   )r­   r³   r®   r¶   r´   s      rB   r¶   zLiteralFile.writeÌ  s�   € Øˆ	Œ	•S˜‘Y”YÑˆ	Œ	ØˆØŒ9�qŠ=ˆ=ØŒI�OŠO˜DÑ!Ô!Ð!Ð!àŒyð Ø# K d¤i KÔ0°$°t´y°{°{Ô2C�f��à�Øð &Ø”	—’ Ñ%Ô%Ð%ØˆrD   c                 ó~   — | j                              dd¦  «         | j                             | j         |f¦  «         dS )r¸   r   N)r®   Úseekr   r¹   rº   s     rB   r¹   zLiteralFile.callbackÚ  s=   € ð 	Œ	�Š�q˜!ÑÔÐØŒ
×Ò˜TœY¨Ð-Ñ.Ô.Ð.Ð.Ð.rD   N)r¢   r£   r¤   rÀ   rb   r¶   r¹   r>   rD   rB   r½   r½   Á  sG   € € € € € Ø'Ðð"ð "ð "ðð ð ð/ð /ð /ð /ð /rD   r½   c                   ó&   — e Zd ZdZdd„Zd„ Zd„ ZdS )ÚWriteBufferzU
    Buffer up a bunch of writes before sending them all to a transport at once.
    é    c                 ó>   — || _         || _        d| _        g | _        d S ©Nr   )Ú
bufferSizeÚ	transportÚ_lengthÚ_writes)r_   rÌ   r­   s      rB   rb   zWriteBuffer.__init__ç  s"   € ØˆŒØ"ˆŒØˆŒØˆŒˆˆrD   c                 óÀ   — | xj         t          |¦  «        z  c_         | j                             |¦  «         | j         | j        k    r|                      ¦   «          d S d S rv   )rÍ   r³   rÎ   rt   rË   Úflush©r_   Úss     rB   r¶   zWriteBuffer.writeí  sV   € ØˆŒ�˜A™œÑˆŒØŒ×Ò˜AÑÔÐØŒ<˜$œ/Ò)Ð)Ø�JŠJ‰LŒLˆLˆLˆLð *Ð)rD   c                 ór   — | j         r/| j                             | j         ¦  «         g | _         d| _        d S d S rÊ   )rÎ   rÌ   ÚwriteSequencerÍ   rd   s    rB   rÐ   zWriteBuffer.flushó  s@   € ØŒ<ð 	ØŒN×(Ò(¨¬Ñ6Ô6Ð6ØˆDŒLØˆDŒLˆLˆLð	ð 	rD   N)rÈ   )r¢   r£   r¤   r¥   rb   r¶   rÐ   r>   rD   rB   rÇ   rÇ   â  sP   € € € € € ðð ðð ð ð ðð ð ðð ð ð ð rD   rÇ   c                   óD   — e Zd ZdZdZdZdZ	 	 	 dd„Zdefd„Z	d	„ Z
d
„ ZdS )ÚCommand)ó
   CAPABILITYó   FLAGSó   LISTó   LSUBó   STATUSó   SEARCHó	   NAMESPACE)ó   EXISTSó   EXPUNGEó   FETCHó   RECENT)ó   UIDVALIDITYó   UNSEENó
   READ-WRITEó	   READ-ONLYó   UIDNEXTó   PERMANENTFLAGSNr>   c                 ó\   ‡‡‡— || _         || _        || _        ˆˆˆfd„| _        g | _        d S )Nc                 ó   •—  ‰| g‰¢R i ‰¤ŽS rv   r>   )rU   ÚcontArgsÚcontKwÚcontinuations    €€€rB   rV   z"Command.__init__.<locals>.<lambda>  s!   ø€  l l°1Ð&J°xÐ&JÐ&JÐ&JÀ6Ð&JÐ&J€ rD   )ÚcommandÚargsÚwantResponserì   Úlines)r_   rí   rî   rï   rì   rê   rë   s       ```rB   rb   zCommand.__init__  s?   øøø€ ð ˆŒØˆŒ	Ø(ˆÔØJÐJÐJÐJÐJÐJˆÔØˆŒ
ˆ
ˆ
rD   r’   c                 óf   — d                      | j        | j        | j        | j        | j        ¦  «        S )Nz(<imap4.Command {!r} {!r} {!r} {!r} {!r}>)Úformatrí   rî   rï   rì   rð   rd   s    rB   r�   zCommand.__repr__  s1   € Ø9×@Ò@ØŒL˜$œ) TÔ%6¸Ô8IÈ4Ì:ñ
ô 
ð 	
rD   c                 óŒ   — | j         €d                     || j        f¦  «        S d                     || j        | j         f¦  «        S ©Nó    )rî   r—   rí   ©r_   Útags     rB   rò   zCommand.format#  s@   € ØŒ9ÐØ—9’9˜c 4¤<Ð0Ñ1Ô1Ð1Ø�yŠy˜#˜tœ|¨T¬YÐ7Ñ8Ô8Ð8rD   c                 óö  — g }g }| j         D ]·}t          |¦  «        }t          |¦  «        }|dk    r|d         | j        v sW|dk    r|d         | j        v sB|dk    rR|d         dk    rFt          |d         t          ¦  «        r+|d         d         | j        v r|                     |¦  «         Œ¢|                     |¦  «         Œ¸| j	        d c}| _	        | 
                    ||f¦  «         |r ||¦  «         d S d S )Nr;   r   é   ó   OK)rð   ÚparseNestedParensr³   Ú_1_RESPONSESÚ_2_RESPONSESrZ   r[   Ú_OK_RESPONSESrt   r   r¹   )	r_   ÚlastLineÚunusedCallbackÚsendÚunuseÚLÚnamesÚNÚds	            rB   ÚfinishzCommand.finish(  s'  € ØˆØˆØ”ð 	$ð 	$ˆAÝ% aÑ(Ô(ˆEÝ�E‘
”
ˆAà�Q’�Ø˜!”H Ô 1Ð1Ð1Ø˜’6�6Ø˜!”H Ô 1Ð1Ð1Ø˜’6�6Ø˜!”H Ò%Ð%Ý˜u Qœx­Ñ.Ô.ð &à˜!”H˜Q”K 4Ô#5Ð5Ð5à—’˜EÑ"Ô"Ð"Ð"à—’˜UÑ#Ô#Ð#Ð#Øœ
 Dˆˆˆ4Œ:Ø	�
Š
�D˜(Ð#Ñ$Ô$Ð$Øð 	"ØˆN˜5Ñ!Ô!Ð!Ð!Ð!ð	"ð 	"rD   )Nr>   N)r¢   r£   r¤   rü   rý   rþ   r   rb   r–   r�   rò   r  r>   rD   rB   rÖ   rÖ   ú  s‰   € € € € € ð€Lð @€Lð€Mð €Eð
 ØØðð ð ð ð
˜#ð 
ð 
ð 
ð 
ð
9ð 9ð 9ð
"ð "ð "ð "ð "rD   rÖ   rõ   é!   é€   é   s	   ]\\(){%*"Úcharmapú[ú]c              #   ó,   K  — | ]}|t           v¯|V — Œd S rv   )Ú_nonAtomChars)rG   Úchs     rB   ú	<genexpr>r  Q  s,   è è € ÐHÐH˜"°½-Ð0GÐ0G�2Ð0GÐ0GÐ0GÐ0GÐHÐHrD   c                   óÂ  — e Zd ZdZdZdZdZdZdZdZ	dZ
dZdZdZdZdZdZh d£Zd	Zd
Zd±d„Zd„ Zd„ Zd„ Zd„ Zd„ ZdZd„ Zd„ Zd„ Zd„ Zd²d„Zd„ Z d„ Z!d„ Z"d„ Z#d„ Z$d„ Z%d„ Z&d³d„Z' e(j)        d e(j*        e+¦  «        z   dz   ¦  «        Z,d „ Z-d!„ Z.d"„ Z/d#„ Z0d$„ Z1d%„ Z2d&„ Z3d'„ Z4d(„ Z5d)„ Z6d*„ Z7d+„ Z8d´d-„Z9d´d.„Z:d´d/„Z;d²d0„Z<dµd2„Z=d3„ Z>d4„ Z?d5„ Z@e@fZAeAZBeAZCeAZDd6„ ZEeEfZFeFZGeFZHeFZId7„ ZJeJfZKeKZLeKZMeKZNd8„ ZOeOe-fZPd9„ ZQd:„ ZRd;„ ZSd<„ ZTd=„ ZUd>„ ZVd?„ ZWeWfZXd@„ ZYeYe'e&fZZdA„ Z[dB„ Z\dC„ Z]dD„ Z^e^fZ_e_Z`dE„ ZadF„ ZbdG„ Zceae'dHdIfZdedZeeae'dJdKfZfefZgdL„ ZhdM„ ZiehfZjejZkdN„ Zlele&fZmemZndO„ Zoeoe&fZpepZqdP„ Zrere'e&fZsesZtdQ„ Zueue&fZvevZwdR„ Zxexe&fZyeyZzdS„ Z{dT„ Z|dU„ Z}e{e'e'dJdVfZ~e~Ze{e'e'dHdWfZ€e€Z�dX„ Z‚dY„ ZƒdZ„ Z„e‚e'e.fZ…e…Z†d[„ Z‡d\„ Zˆd]„ Z‰d^„ ZŠd_„ Z‹e‰e'e5e6e/fZŒeŒZ�d`„ ZŽda„ Z�db„ Z�e�fZ‘dc„ Z’dd„ Z“de„ Z”df„ Z•e•fZ–dg„ Z—dh„ Z˜di„ Z™e™fZšdj„ Z›dk„ Zœd¶dl„Z�e�e7e0fZždm„ ZŸd²dn„Z do„ Z¡dp„ Z¢dq„ Z£dr„ Z¤ds„ Z¥dt„ Z¦du„ Z§dv„ Z¨dw„ Z©dx„ Zªdy„ Z«dz„ Z¬d{„ Z­d|„ Z®d}„ Z¯d~„ Z°d„ Z±d€„ Z²d�„ Z³d‚„ Z´dƒ„ Zµd„„ Z¶d…„ Z·d†„ Z¸d‡„ Z¹dˆ„ Zºd‰„ Z»dŠ„ Z¼d‹„ Z½dŒ„ Z¾d�„ Z¿dŽ„ ZÀd�„ ZÁd�„ ZÂd‘„ ZÃd’„ ZÄd“„ ZÅd”„ ZÆd¶d•„ZÇeÇe1e2fZÈd–„ ZÉd—„ ZÊd·d˜„ZËd·d™„ZÌd·dš„ZÍd·d›„ZÎd·dœ„ZÏd·d�„ZÐd·dž„ZÑd·dŸ„ZÒd·d „ZÓd·d¡„ZÔd¢„ ZÕd£„ ZÖd¶d¤„Z×e×e1e-e3fZØd¥„ ZÙd¦„ ZÚd¶d§„ZÛeÛe1e&fZÜd¨„ ZÝd©„ ZÞdª„ Zßd«„ Zàd¬„ Zád­„ Zâeâe-e4fZãd®„ Zäd¯„ Zåd°„ ZædS )¸ÚIMAP4ServerzÀ
    Protocol implementation for an IMAP4rev1 server.

    The server can be in any of four states:
        - Non-authenticated
        - Authenticated
        - Selected
        - Logout
    s   Twisted IMAP4rev1 Readyé<   i  FNi   >   ó   ORó   NOTó   UIDÚunauthrí   c                 óX   — |€i }|| _         || _        |€t          }|| _        g | _        d S rv   )ÚchallengersÚctxÚiterateInReactorÚ
_schedulerÚ_queuedAsync)r_   ÚchalÚcontextFactoryÚ	schedulers       rB   rb   zIMAP4Server.__init__�  s;   € Øˆ<ØˆDØˆÔØ!ˆŒØÐÝ(ˆIØ#ˆŒØˆÔÐÐrD   c                 óÜ   — dt          | j                             ¦   «         ¦  «        i}| j        r2| j        r+| j        s$t          j        | j        d ¦  «        €
d |d<   d |d<   d |d<   d |d<   |S )Nó   AUTHó   LOGINDISABLEDó   STARTTLSrÝ   s   IDLE)	r[   r  Úkeysr  ÚcanStartTLSÚ
startedTLSr   ÚISSLTransportrÌ   )r_   Úcaps     rB   ÚcapabilitieszIMAP4Server.capabilities™  sƒ   € Ø�˜TÔ-×2Ò2Ñ4Ô4Ñ5Ô5Ð6ˆØŒ8ð 	(˜Ô(ð 	(à”Oð(åÔ,¨T¬^¸TÑBÔBÐJà(,�Ð$Ñ%Ø#'��KÑ Ø ˆˆLÑØˆˆG‰Øˆ
rD   c                 ó²   — i | _         t          j        | j        d ¦  «        d u| _        |                      | j        ¦  «         |                      ¦   «          d S rv   )Útagsr   ÚITLSTransportrÌ   r'  Ú
setTimeoutÚtimeOutÚsendServerGreetingrd   s    rB   ÚconnectionMadezIMAP4Server.connectionMade¦  sR   € ØˆŒ	Ý%Ô3°D´NÀDÑIÔIÐQUÐUˆÔØ�Š˜œÑ%Ô%Ð%Ø×ÒÑ!Ô!Ð!Ð!Ð!rD   c                 óx   — |                       d ¦  «         | j        r|                      ¦   «          d | _        d S d S rv   )r/  Ú	_onLogout)r_   Úreasons     rB   ÚconnectionLostzIMAP4Server.connectionLost¬  sC   € Ø�Š˜ÑÔÐØŒ>ð 	"Ø�NŠNÑÔÐØ!ˆDŒNˆNˆNð	"ð 	"rD   c                 óP  — |                       d¦  «         | j                             ¦   «          | j        ri| j                             | ¦  «         t          | j        d ¦  «        }|�1t          |j        ¦  «                             t          j
        ¦  «         d | _        d| _        d S )Ns*   * BYE Autologout; connection idle too longÚtimeout)ÚsendLinerÌ   ÚloseConnectionÚmboxÚremoveListenerÚICloseableMailboxr   ÚcloseÚ
addErrbackr5   ÚerrÚstate)r_   Úcmbxs     rB   ÚtimeoutConnectionzIMAP4Server.timeoutConnection²  s’   € Ø�ŠÐCÑDÔDÐDØŒ×%Ò%Ñ'Ô'Ð'ØŒ9ð 	ØŒI×$Ò$ TÑ*Ô*Ð*Ý$ T¤Y°Ñ5Ô5ˆDØÐÝ˜dœjÑ)Ô)×4Ò4µS´WÑ=Ô=Ð=ØˆDŒIØˆŒ
ˆ
ˆ
rD   c                 ó”   — |                       ¦   «          | j                             |¦  «        }|�|                      |¦  «         d S d S rv   )ÚresetTimeoutÚ_pendingLiteralr¶   ÚsetLineModer´   s      rB   ÚrawDataReceivedzIMAP4Server.rawDataReceived½  sR   € Ø×ÒÑÔÐØÔ%×+Ò+¨DÑ1Ô1ˆØÐØ×Ò˜VÑ$Ô$Ð$Ð$Ð$ð ÐrD   c                 óÜ   — | j         }d | _         |r8| j         €1|                      |                     d¦  «        ¦  «         |r| j         ®1| j         �| j                              |¦  «         d S d S rÊ   )ÚblockedÚlineReceivedÚpopr|   )r_   Úcommandss     rB   Ú_unblockzIMAP4Server._unblockÇ  sz   € Ø”<ˆØˆŒØð 	/˜4œ<Ð/Ø×Ò˜hŸlšl¨1™oœoÑ.Ô.Ð.ð ð 	/˜4œ<Ð/àŒ<Ð#ØŒL×Ò Ñ)Ô)Ð)Ð)Ð)ð $Ð#rD   c           	      óv  — | j         �| j                              |¦  «         d S |                      ¦   «          t          | d| j        z   ¦  «        }	  ||¦  «         d S # t
          $ rP}|                      dt          t          |¦  «        ¦  «        z   ¦  «         t          j
        ¦   «          Y d }~d S d }~ww xY w)NÚparse_s   BAD Server error: )rJ  rt   rE  ÚgetattrÚ
parseStateÚ	ExceptionÚsendUntaggedResponser:   r–   r5   r@  )r_   r»   ÚfÚes       rB   rK  zIMAP4Server.lineReceivedÏ  sÂ   € ØŒ<Ð#ØŒL×Ò Ñ%Ô%Ð%ØˆFà×ÒÑÔÐÝ�D˜( T¤_Ñ4Ñ5Ô5ˆð	ØˆAˆd‰GŒGˆGˆGˆGøÝð 	ð 	ð 	Ø×%Ò%Ð&;½mÍCÐPQÉFÌFÑ>SÔ>SÑ&SÑTÔTÐTÝŒG‰IŒIˆIˆIˆIˆIˆIˆIˆIøøøøð	øøøs   ÁA Á
B8Á(AB3Â3B8c           
      ó4  — |                      d d¦  «        }d }t          |¦  «        dk    r|\  }}}ndt          |¦  «        dk    r|\  }}nKt          |¦  «        dk    r |d         }|                      |d¦  «         d S |                      d d¦  «         d S |                     ¦   «         }	 |                      |||¦  «        S # t
          $ r>}|                      |dt          t          |¦  «        ¦  «        z   ¦  «         Y d }~d S d }~wt          $ r>}|  	                    |dt          t          |¦  «        ¦  «        z   ¦  «         Y d }~d S d }~wt          $ r>}|  	                    |d	t          t          |¦  «        ¦  «        z   ¦  «         Y d }~d S d }~ww xY w)
Nrù   é   r;   r   s   Missing commands   Null commandó   Illegal syntax: ó   Illegal operation: ó   Illegal mailbox name: )Úsplitr³   ÚsendBadResponseÚupperÚdispatchCommandr   r:   r–   r   ÚsendNegativeResponser   )r_   r»   rî   Úrestr÷   ÚcmdrV  s          rB   Úparse_commandzIMAP4Server.parse_commandÜ  só  € Ø�zŠz˜$ Ñ"Ô"ˆØˆÝˆt‰9Œ9˜Š>ˆ>Ø!‰NˆC��d�dÝ�‰YŒY˜!Š^ˆ^Ø‰HˆC��Ý�‰YŒY˜!Š^ˆ^Ø�q”'ˆCØ× Ò  Ð&8Ñ9Ô9Ð9Ø�4à× Ò   Ñ7Ô7Ð7Ø�4à�iŠi‰kŒkˆð	Ø×'Ò'¨¨S°$Ñ7Ô7Ð7øÝ$ð 	Sð 	Sð 	SØ× Ò  Ð&9½MÍ#ÈaÉ&Ì&Ñ<QÔ<QÑ&QÑRÔRÐRÐRÐRÐRÐRÐRÐRøøøøÝð 	ð 	ð 	Ø×%Ò%ØÐ+­m½CÀ¹F¼FÑ.CÔ.CÑCñô ð ð ð ð ð ð ð øøøøõ &ð 	ð 	ð 	Ø×%Ò%ØÐ.µ½sÀ1¹v¼vÑ1FÔ1FÑFñô ð ð ð ð ð ð ð øøøøð	øøøs0   Â,C Ã
FÃ3DÄFÄ3EÅFÅ3FÆFc                 óZ   — | j         }d | _         d| _        |                     |¦  «         d S )Nrí   )rF  rR  r¹   )r_   r»   r  s      rB   Úparse_pendingzIMAP4Server.parse_pendingù  s1   € ØÔ ˆØ#ˆÔØ#ˆŒØ	�
Š
�4ÑÔÐÐÐrD   c                 óÀ   — |                       |¦  «        }|r0|d         }|dd …         }|                      ||| |g|||¦  «         d S |                      |d¦  «         d S )Nr   r;   s   Unsupported command)ÚlookupCommandÚ_IMAP4Server__doCommandr]  )r_   r÷   rb  ra  ÚuidrU  ÚfnÚ	parseargss           rB   r_  zIMAP4Server.dispatchCommandÿ  sx   € Ø×Ò˜sÑ#Ô#ˆØð 	>Ø�1”ˆBØ˜!˜"˜"œˆIØ×Ò˜S " t¨S k°9¸dÀCÑHÔHÐHÐHÐHà× Ò  Ð&<Ñ=Ô=Ð=Ð=Ð=rD   c           
      ó–   — t          | d                     | j        t          |                     ¦   «         ¦  «        f¦  «        d ¦  «        S )NÚ_)rQ  r—   rA  r9   r^  )r_   rb  s     rB   rg  zIMAP4Server.lookupCommand  s8   € Ý�t˜SŸXšX t¤zµ<ÀÇ	Â	ÁÄÑ3LÔ3LÐ&MÑNÔNÐPTÑUÔUÐUrD   c           	      óŠ  — t          |¦  «        D ]€\  }}t          |¦  «        rW||dz   d …         }t          || |¦  «                             | j        |||||¦  «                             | j        |¦  «          d S |                     |¦  «         Œ�|rt          dt          |¦  «        z   ¦  «        ‚|�
 ||d|iŽ d S  ||Ž  d S )Nr;   z Too many arguments for command: ri  )
rh   Úcallabler   ÚaddCallbackÚ_IMAP4Server__cbDispatchr?  Ú_IMAP4Server__ebDispatchrt   r   Úrepr)	r_   r÷   Úhandlerrî   rk  r»   ri  rj   Úargs	            rB   Ú__doCommandzIMAP4Server.__doCommand  sð   € Ý 	Ñ*Ô*ð 	!ð 	!‰FˆAˆsÝ˜‰}Œ}ð !Ø% a¨!¡e g gÔ.�	Ý˜c 4¨Ñ.Ô.×:Ò:ØÔ% s¨G°T¸9Àcñô ç’*˜TÔ.°Ñ4Ô4Ð4Ø��à—’˜CÑ Ô Ð Ð àð 	Yå'Ð(JÍTÐRVÉZÌZÑ(WÑXÔXÐXàˆ?ØˆG˜dÐ#˜Ð#Ð#Ð#Ð#Ð#àˆG�TˆNˆNˆNˆNrD   c                 ón   — |\  }}|                      |¦  «         |                      ||||||¦  «         d S rv   )rt   rh  )	r_   Úresultr÷   rj  rî   rk  ri  ru  ra  s	            rB   Ú__cbDispatchzIMAP4Server.__cbDispatch  sA   € Ø‰ˆˆdØ�Š�CÑÔÐØ×Ò˜˜b $¨	°4¸Ñ=Ô=Ð=Ð=Ð=rD   c           	      ó–  — |                      t          ¦  «        r:|                      |dt          t	          |j        ¦  «        ¦  «        z   ¦  «         d S |                      t          ¦  «        r:|                      |dt          t	          |j        ¦  «        ¦  «        z   ¦  «         d S |                      t          ¦  «        r:|                      |dt          t	          |j        ¦  «        ¦  «        z   ¦  «         d S |                      |dt          t	          |j        ¦  «        ¦  «        z   ¦  «         t          j
        |¦  «         d S )NrY  rZ  r[  ó   Server error: )Úcheckr   r]  r:   r–   ri   r   r`  r   r5   r@  ©r_   Úfailurer÷   s      rB   Ú__ebDispatchzIMAP4Server.__ebDispatch$  sQ  € Ø�=Š=Õ.Ñ/Ô/ð 	Ø× Ò ØÐ(­=½¸W¼]Ñ9KÔ9KÑ+LÔ+LÑLñô ð ð ð ð �]Š]Õ+Ñ,Ô,ð 	Ø×%Ò%ØÐ+­m½CÀÄÑ<NÔ<NÑ.OÔ.OÑOñô ð ð ð ð �]Š]Õ1Ñ2Ô2ð 	Ø×%Ò%ØÐ.µ½sÀ7Ä=Ñ?QÔ?QÑ1RÔ1RÑRñô ð ð ð ð × Ò ØÐ&­µs¸7¼=Ñ7IÔ7IÑ)JÔ)JÑJñô ð õ ŒG�GÑÔÐÐÐrD   c                 ó  — || j         k    rt          d| j         fz  ¦  «        ‚t          j        ¦   «         }d| _        t          ||¦  «        | _        |                      t          d|z  ¦  «        ¦  «         |  	                    ¦   «          |S )Nz,Literal too long! I accept at most %d octetsÚpendingzReady for %d octets of text)
Ú_literalStringLimitr   r   ÚDeferredrR  r«   rF  ÚsendContinuationRequestr:   Ú
setRawMode©r_   r­   r  s      rB   Ú_stringLiteralzIMAP4Server._stringLiteral7  s›   € Ø�$Ô*Ò*Ð*Ý'Ø>ØÔ+Ð-ñ.ñô ð õ ŒNÑÔˆØ#ˆŒÝ,¨T°1Ñ5Ô5ˆÔØ×$Ò$ÝÐ7¸$Ñ>Ñ?Ô?ñ	
ô 	
ð 	
ð 	�ŠÑÔÐØˆrD   c                 óÖ   — t          j        ¦   «         }d| _        t          ||¦  «        | _        |                      t          d|z  ¦  «        ¦  «         |                      ¦   «          |S )Nr�  zReady for %d octets of data)r   rƒ  rR  r½   rF  r„  r:   r…  r†  s      rB   Ú_fileLiteralzIMAP4Server._fileLiteralF  sh   € ÝŒNÑÔˆØ#ˆŒÝ*¨4°Ñ3Ô3ˆÔØ×$Ò$ÝÐ7¸$Ñ>Ñ?Ô?ñ	
ô 	
ð 	
ð 	�ŠÑÔÐØˆrD   c                 ó0   — |                       |d¬¦  «        S )a  
        Parse an astring from line that represents a command's final
        argument.  This special case exists to enable parsing empty
        string literals.

        @param line: A line that contains a string literal.
        @type line: L{bytes}

        @return: A 2-tuple containing the parsed argument and any
            trailing data, or a L{Deferred} that fires with that
            2-tuple
        @rtype: L{tuple} of (L{bytes}, L{bytes}) or a L{Deferred}

        @see: https://twistedmatrix.com/trac/ticket/9207
        T)Úfinal)Úarg_astringrº   s     rB   Úarg_finalastringzIMAP4Server.arg_finalastringP  s   € ð  ×Ò ¨DÐÑ1Ô1Ð1rD   c           	      ó¸  — |                      ¦   «         }|st          d¦  «        ‚d}d\  }}|dd…         dk    rC	 |                     dd¦  «        \  }}}|dd…         }nõ# t          $ r t          d¦  «        ‚w xY w|dd…         d	k    r‡|d
d…         dk    rt          d¦  «        ‚	 t	          |dd
…         ¦  «        }n5# t          $ r( t          dt          |dd
…         ¦  «        z   ¦  «        ‚w xY w|r|sdS |                      |¦  «        }nC|                     dd¦  «        }t          |¦  «        dk    r|                     d¦  «         |\  }}|p||fS )aþ  
        Parse an astring from the line, return (arg, rest), possibly
        via a deferred (to handle literals)

        @param line: A line that contains a string literal.
        @type line: L{bytes}

        @param final: Is this the final argument?
        @type final L{bool}

        @return: A 2-tuple containing the parsed argument and any
            trailing data, or a L{Deferred} that fires with that
            2-tuple
        @rtype: L{tuple} of (L{bytes}, L{bytes}) or a L{Deferred}

        úMissing argumentN©NNr   r;   ó   "rù   zUnmatched quotesó   {r   ó   }úMalformed literalúBad literal size: )rD   rD   rõ   rD   )	Ústripr   r\  rg   Úintrs  r‡  r³   rt   )r_   r»   r‹  r  ru  ra  Úspamr­   s           rB   rŒ  zIMAP4Server.arg_astringb  sª  € ð" �zŠz‰|Œ|ˆØð 	<Ý'Ð(:Ñ;Ô;Ð;ØˆØ‰	ˆˆTØ��!�Œ9˜ÒÐð@Ø"&§*¢*¨T°1Ñ"5Ô"5‘��c˜4Ø˜A˜B˜B”x��øÝð @ð @ð @Ý+Ð,>Ñ?Ô?Ð?ð@øøøà�!�A�#ŒY˜$ÒÐà�B�C�CŒy˜DÒ Ð Ý+Ð,?Ñ@Ô@Ð@ðUÝ˜4  " œ:‘”��øÝð Uð Uð UÝ+Ð,@Å4ÈÈQÈrÈTÌ
ÑCSÔCSÑ,SÑTÔTÐTðUøøøàð "˜Tð "Ø!�zØ×#Ò# DÑ)Ô)ˆAˆAà—*’*˜T 1Ñ%Ô%ˆCÝ�3‰xŒx˜1Š}ˆ}Ø—
’
˜3‘”�Ø‰IˆC�ØÐ�S˜$�KÐs   ¼$A! Á!A;Â*C Ã2C4s
   (?P<atom>[s   ]+)( (?P<rest>.*$)|$)c                 óÎ   — |st          d¦  «        ‚| j                             |¦  «        }|r*|                     d¦  «        |                     d¦  «        fS t          d¦  «        ‚)z-
        Parse an atom from the line
        r�  Úatomra  zMalformed ATOM)r   ÚatomreÚmatchÚgroup)r_   r»   Úms      rB   Úarg_atomzIMAP4Server.arg_atom•  sf   € ð ð 	<Ý'Ð(:Ñ;Ô;Ð;ØŒK×Ò˜dÑ#Ô#ˆØð 	:Ø—7’7˜6‘?”? A§G¢G¨F¡O¤OÐ3Ð3å'Ð(8Ñ9Ô9Ð9rD   c                 óü   — |st          d¦  «        ‚|dd…         dk    rt          d¦  «        ‚|                     d¦  «        }|dk    rt          d¦  «        ‚t          |d|…         d	¦  «        ||d
z   d…         fS )zG
        Parse a (non-nested) parenthesised list from the line
        r�  Nr;   ó   (zMissing parenthesisó   )r   úMismatched parenthesisr   rù   )r   Úfindrû   )r_   r»   rj   s      rB   Ú	arg_plistzIMAP4Server.arg_plist¡  s�   € ð ð 	<Ý'Ð(:Ñ;Ô;Ð;à���Œ8�tÒÐÝ'Ð(=Ñ>Ô>Ð>à�IŠI�d‰OŒOˆà�Š7ˆ7Ý'Ð(@ÑAÔAÐAå! $ q¨ s¤)¨QÑ/Ô/°°a¸!±e°g°g´Ð?Ð?rD   c                 óD  — |st          d¦  «        ‚|dd…         dk    rt          d¦  «        ‚|dd…         dk    rt          d¦  «        ‚	 t          |dd…         ¦  «        }n(# t          $ r t          d	|dd…         ›�¦  «        ‚w xY w|                      |¦  «        S )
z/
        Parse a literal from the line
        r�  Nr;   r’  zMissing literalr   r“  r”  r•  )r   r—  rg   r‰  )r_   r»   r­   s      rB   Úarg_literalzIMAP4Server.arg_literal²  sÎ   € ð ð 	<Ý'Ð(:Ñ;Ô;Ð;à���Œ8�tÒÐÝ'Ð(9Ñ:Ô:Ð:à���Œ9˜ÒÐÝ'Ð(;Ñ<Ô<Ð<ð	MÝ�t˜A˜b˜D”z‘?”?ˆDˆDøÝð 	Mð 	Mð 	MÝ'Ð(K¸TÀ!ÀBÀ$¼ZÐ(KÐ(KÑLÔLÐLð	Møøøð × Ò  Ñ&Ô&Ð&s   ÁA% Á%%B
c                 ó(   — t          |¦  «        }|dfS )z
        searchkeys
        rD   )rû   )r_   r»   Úquerys      rB   Úarg_searchkeyszIMAP4Server.arg_searchkeysÆ  s   € õ " $Ñ'Ô'ˆð �sˆ|ÐrD   c                 óþ   — d}|                      dd¦  «        }t          |¦  «        dk    r|d         }|d         }	 t          |¦  «        |fS # t          $ r$}t	          dt          |¦  «        z   ¦  «        ‚d}~ww xY w)z
        sequence-set
        rD   rõ   r;   rù   r   zBad message number N)r\  r³   ÚparseIdListr   r   r–   )r_   r»   ra  ru  rV  s        rB   Ú
arg_seqsetzIMAP4Server.arg_seqsetÏ  s“   € ð ˆØ�jŠj˜˜qÑ!Ô!ˆÝˆs‰8Œ8�qŠ=ˆ=Ø�q”6ˆDØ�!Œfˆð	HÝ Ñ$Ô$ dÐ+Ð+øÝ%ð 	Hð 	Hð 	HÝ'Ð(=ÅÀAÁÄÑ(FÑGÔGÐGøøøøð	Høøøs   ½A Á
A<ÁA7Á7A<c                 óZ   — t          ¦   «         }|                     |¦  «         |j        dfS )z
        fetch-att
        rD   )Ú_FetchParserÚparseStringrx  )r_   r»   r˜   s      rB   Úarg_fetchattzIMAP4Server.arg_fetchattÞ  s+   € õ ‰NŒNˆØ	�Š�dÑÔÐØ”˜#ˆÐrD   c                 óD  — g }|dd…         dk    r'|dd…         dk    rt          d¦  «        ‚|dd…         }|rä| j                             |¦  «        }|st          d¦  «        ‚|dd…         d	k    rD|                     ¦   «         dk    r,|                     d	|                     d
¦  «        z   ¦  «         nP|                     ¦   «         dk    r)|                     |                     d
¦  «        ¦  «         nt          d¦  «        ‚|                     d¦  «        }|°ä|dfS )z-
        Flag part of store-att-flag
        r   r;   r¡  r   Nr¢  r£  zMalformed flagó   \rš  ra  rD   )r   r›  Úsearchr`   rt   r�  )r_   r»   Úflagsrž  s       rB   Úarg_flaglistzIMAP4Server.arg_flaglistæ  s*  € ð ˆØ��!�Œ9˜ÒÐØ�B�C�CŒy˜DÒ Ð Ý+Ð,DÑEÔEÐEØ˜˜"˜”:ˆDàð 
	#Ø”×"Ò" 4Ñ(Ô(ˆAØð >Ý+Ð,<Ñ=Ô=Ð=Ø�A�a�CŒy˜EÒ!Ð! a§g¢g¡i¤i°1¢n nØ—’˜U Q§W¢W¨V¡_¤_Ñ4Ñ5Ô5Ð5Ð5Ø—’‘”˜a’�Ø—’˜QŸWšW V™_œ_Ñ-Ô-Ð-Ð-å+Ð,<Ñ=Ô=Ð=Ø—7’7˜6‘?”?ˆDð ð 
	#ð �sˆ|ÐrD   c                 ó
   — |dfS )z-
        Command line of UID command
        rD   r>   rº   s     rB   Úarg_linezIMAP4Server.arg_lineþ  s   € ð �cˆ{ÐrD   c                 ó^   — |                      d¦  «        r|                      |¦  «        S d|fS )z-
        Optional parenthesised list
        r¡  N)Ú
startswithr¥  rº   s     rB   Ú	opt_plistzIMAP4Server.opt_plist  s4   € ð �?Š?˜4Ñ Ô ð 	 Ø—>’> $Ñ'Ô'Ð'à˜$�<ÐrD   c                 ó¾   — |                      d¦  «        rE	 |                     dd¦  «        \  }}}n# t          $ r t          d¦  «        ‚w xY w||dd…         fS d|fS )z+
        Optional date-time string
        r‘  rù   zMalformed date-timer;   N)rº  r\  rg   r   )r_   r»   r˜  Údatera  s        rB   Úopt_datetimezIMAP4Server.opt_datetime  s…   € ð �?Š?˜4Ñ Ô ð 	 ðCØ#'§:¢:¨d°AÑ#6Ô#6Ñ ��d˜D˜DøÝð Cð Cð CÝ+Ð,AÑBÔBÐBðCøøøà˜$˜q˜r˜rœ(Ð#Ð#à˜$�<Ðs	   —2 ²Ac                 ó  — |dd…                               ¦   «         dk    rj|                     dd¦  «        }t          |¦  «        dk    rt          d¦  «        ‚t          |¦  «        dk    r|                     d¦  «         |\  }}}||fS d|fS )	z4
        Optional charset of SEARCH command
        Né   s   CHARSETrõ   rù   r;   zMissing charset identifierrD   )r^  r\  r³   r   rt   )r_   r»   ru  r˜  ra  s        rB   Úopt_charsetzIMAP4Server.opt_charset  s�   € ð ���Œ8�>Š>ÑÔ˜zÒ)Ð)Ø—*’*˜T 1Ñ%Ô%ˆCÝ�3‰xŒx˜1Š}ˆ}Ý+Ð,HÑIÔIÐIÝ�3‰xŒx˜1Š}ˆ}Ø—
’
˜3‘”�Ø!‰OˆD�#�tØ˜�;Ðà˜$�<ÐrD   c                 óœ   — dd                      |                      ¦   «         ¦  «        z   dz   | j        z   }|                      |¬¦  «         d S )Ns   [CAPABILITY rõ   ó   ] )Úmessage)r—   ÚlistCapabilitiesÚIDENTÚsendPositiveResponse©r_   Úmsgs     rB   r1  zIMAP4Server.sendServerGreeting)  sM   € Ø §	¢	¨$×*?Ò*?Ñ*AÔ*AÑ BÔ BÑBÀUÑJÈTÌZÑWˆØ×!Ò!¨#Ð!Ñ.Ô.Ð.Ð.Ð.rD   rD   c                 ó4   — |                       d||¦  «         d S )Nó   BAD©Ú_respond©r_   r÷   rÄ  s      rB   r]  zIMAP4Server.sendBadResponse-  s   € Ø�Š�f˜c 7Ñ+Ô+Ð+Ð+Ð+rD   c                 ó4   — |                       d||¦  «         d S )Nrú   rÌ  rÎ  s      rB   rÇ  z IMAP4Server.sendPositiveResponse0  ó   € Ø�Š�e˜S 'Ñ*Ô*Ð*Ð*Ð*rD   c                 ó4   — |                       d||¦  «         d S )Nó   NOrÌ  rÎ  s      rB   r`  z IMAP4Server.sendNegativeResponse3  rÐ  rD   c                 ó~   — |r| j         €|                      |d d ¦  «         d S | j                             |¦  «         d S rv   )rJ  rÍ  r  rt   )r_   rÄ  ÚisAsyncs      rB   rT  z IMAP4Server.sendUntaggedResponse6  sJ   € Øð 	.˜4œ<Ð/Ø�MŠM˜' 4¨Ñ.Ô.Ð.Ð.Ð.àÔ×$Ò$ WÑ-Ô-Ð-Ð-Ð-rD   ó!   Ready for additional command textc                 óh   — |r|                       d|z   ¦  «         d S |                       d¦  «         d S )Ns   + ó   +©r9  rÈ  s     rB   r„  z#IMAP4Server.sendContinuationRequest<  s>   € Øð 	 Ø�MŠM˜% #™+Ñ&Ô&Ð&Ð&Ð&à�MŠM˜$ÑÔÐÐÐrD   c                 ó*  — |dv r1| j         r*| j         }g | _         |D ]}|                      |d d ¦  «         Œ|sd}|r-|                      d                     |||f¦  «        ¦  «         d S |                      d                     ||f¦  «        ¦  «         d S )N)rú   rÒ  rË  ó   *rõ   )r  rÍ  r9  r—   )r_   rA  r÷   rÄ  rð   rÉ  s         rB   rÍ  zIMAP4Server._respondB  s¶   € ØÐ*Ð*Ð*¨tÔ/@Ð*ØÔ%ˆEØ "ˆDÔØð /ð /�Ø—’˜c 4¨Ñ.Ô.Ð.Ð.Øð 	ØˆCØð 	3Ø�MŠM˜$Ÿ)š) S¨%°Ð$9Ñ:Ô:Ñ;Ô;Ð;Ð;Ð;à�MŠM˜$Ÿ)š) S¨% LÑ1Ô1Ñ2Ô2Ð2Ð2Ð2rD   c                 óö   ‡— dg}|                       ¦   «                              ¦   «         D ]M\  Š}|€|                     ‰¦  «         Œt          |¦  «        r!|                     ˆfd„|D ¦   «         ¦  «         ŒN|S )Ns	   IMAP4rev1c                 ó    •— g | ]
}‰d z   |z   ‘ŒS )ó   =r>   )rG   r*  Úcs     €rB   rJ   z0IMAP4Server.listCapabilities.<locals>.<listcomp>U  s!   ø€ Ð;Ð;Ð;°#˜a $™h¨™nÐ;Ð;Ð;rD   )r+  Úitemsrt   r³   r|   )r_   ÚcapsÚvrÞ  s      @rB   rÅ  zIMAP4Server.listCapabilitiesO  s†   ø€ Øˆ~ˆØ×%Ò%Ñ'Ô'×-Ò-Ñ/Ô/ð 	=ð 	=‰DˆAˆqØˆyØ—’˜A‘”��Ý�Q‘”ð =Ø—’Ð;Ð;Ð;Ð;¸Ð;Ñ;Ô;Ñ<Ô<Ð<øØˆrD   c                 ó¬   — |                       dd                     |                      ¦   «         ¦  «        z   ¦  «         |                      |d¦  «         d S )Ns   CAPABILITY rõ   s   CAPABILITY completed)rT  r—   rÅ  rÇ  rö   s     rB   Údo_CAPABILITYzIMAP4Server.do_CAPABILITYX  sP   € Ø×!Ò! .°4·9²9¸T×=RÒ=RÑ=TÔ=TÑ3UÔ3UÑ"UÑVÔVÐVØ×!Ò! #Ð'>Ñ?Ô?Ð?Ð?Ð?rD   c                 óŽ   — |                       d¦  «         |                      |d¦  «         | j                             ¦   «          d S )Ns   BYE Nice talking to yous   LOGOUT successful)rT  rÇ  rÌ   r:  rö   s     rB   Ú	do_LOGOUTzIMAP4Server.do_LOGOUTa  sH   € Ø×!Ò!Ð"<Ñ=Ô=Ð=Ø×!Ò! #Ð';Ñ<Ô<Ð<ØŒ×%Ò%Ñ'Ô'Ð'Ð'Ð'rD   c                 ó2   — |                       |d¦  «         d S )Ns   NOOP No operation performed©rÇ  rö   s     rB   Údo_NOOPzIMAP4Server.do_NOOPk  s   € Ø×!Ò! #Ð'EÑFÔFÐFÐFÐFrD   c                 óæ   — |                      ¦   «                              ¦   «         }|| j        vr|                      |d¦  «         d S |                       | j        |         ¦   «         |¦  «         d S )Ns   AUTHENTICATE method unsupported)r^  r–  r  r`  Úauthenticate)r_   r÷   rî   s      rB   Údo_AUTHENTICATEzIMAP4Server.do_AUTHENTICATEs  ss   € Ø�zŠz‰|Œ|×!Ò!Ñ#Ô#ˆØ�tÔ'Ð'Ð'Ø×%Ò% cÐ+MÑNÔNÐNÐNÐNà×ÒÐ4˜dÔ.¨tÔ4Ñ6Ô6¸Ñ<Ô<Ð<Ð<Ð<rD   c                 óp   — | j         €|                      |d¦  «         d S |                      ||¦  «         d S )Ns    Temporary authentication failure)Úportalr`  Ú_setupChallenge)r_   r  r÷   s      rB   rê  zIMAP4Server.authenticate|  sB   € ØŒ;ÐØ×%Ò% cÐ+NÑOÔOÐOØˆFà×Ò˜T 3Ñ'Ô'Ð'Ð'Ð'rD   c           
      óÞ  — 	 |                      ¦   «         }t          |¦  «        d d…         }d| _        t          j        ¦   «         | _        |                      |¦  «         | j                             | j        ||¦  «         | j         	                    | j
        |¦  «         d S # t          $ r>}|                      |dt          t          |¦  «        ¦  «        z   ¦  «         Y d }~d S d }~ww xY w)Nr   r�  r{  )ÚgetChallenger   rR  r   rƒ  rF  r„  rp  Ú_IMAP4Server__cbAuthChunkr?  Ú_IMAP4Server__ebAuthChunkrS  r]  r:   r–   )r_   r  r÷   Ú	challengeÚcodedrV  s         rB   rî  zIMAP4Server._setupChallengeƒ  sý   € ð
	EØ×)Ò)Ñ+Ô+ˆIõ   	Ñ*Ô*¨3¨B¨3Ô/ˆEØ'ˆDŒOÝ#(¤>Ñ#3Ô#3ˆDÔ Ø×(Ò(¨Ñ/Ô/Ð/ØÔ ×,Ò,¨TÔ-?ÀÀsÑKÔKÐKØÔ ×+Ò+¨DÔ,>ÀÑDÔDÐDÐDÐDøõ ð 	Qð 	Qð 	QØ× Ò  Ð&7½-ÍÈAÉÌÑ:OÔ:OÑ&OÑPÔPÐPÐPÐPÐPÐPÐPÐPøøøøð	Qøøøs   ‚B$ Â$
C,Â.3C'Ã'C,c                 óx  — 	 t          |¦  «        }n"# t          j        $ r t          d¦  «        ‚w xY w|                     |¦  «         |                     ¦   «         r|                      ||¦  «         d S | j                             |d t          ¦  «         
                    | j        | j        |fd |fd ¦  «         d S )NzMalformed Response - not base64)r   ÚbinasciiÚErrorr   ÚsetResponseÚmoreChallengesrî  rí  ÚloginÚIAccountÚaddCallbacksÚ_IMAP4Server__cbAuthRespÚ_IMAP4Server__ebAuthResp)r_   rx  r  r÷   Úuncodeds        rB   Ú__cbAuthChunkzIMAP4Server.__cbAuthChunk�  sÚ   € ð	KÝ! &Ñ)Ô)ˆGˆGøÝŒ~ð 	Kð 	Kð 	KÝ'Ð(IÑJÔJÐJð	Køøøð 	×Ò˜Ñ!Ô!Ð!Ø×ÒÑ Ô ð 	Ø× Ò   sÑ+Ô+Ð+Ð+Ð+àŒK×Ò˜d D­(Ñ3Ô3×@Ò@ØÔ! 4Ô#4°s°f¸dÀSÀFÈDñô ð ð ð s   ‚ ’1c                 óÂ   — |\  }}}|t           u s
J d¦   «         ‚|| _        d| _        || _        |                      |d¦  «         |                      | j        ¦  «         d S )Nz(IAccount is the only supported interfaceÚauths   Authentication successful)rû  ÚaccountrA  r4  rÇ  r/  ÚPOSTAUTH_TIMEOUT©r_   rx  r÷   ÚifaceÚavatarÚlogouts         rB   Ú__cbAuthRespzIMAP4Server.__cbAuthRespž  so   € Ø"(Ñˆ�˜Ø�Ð Ð Ð Ð"LÑ Ô Ð ØˆŒØˆŒ
ØˆŒØ×!Ò! #Ð'CÑDÔDÐDØ�Š˜Ô-Ñ.Ô.Ð.Ð.Ð.rD   c                 ó"  — |                      t          ¦  «        r|                      |d¦  «         d S |                      t          ¦  «        r|                      |d¦  «         d S |                      |d¦  «         t          j        |¦  «         d S )Ns#   Authentication failed: unauthorizeds+   Authentication failed: server misconfigureds'   Server error: login failed unexpectedly)r|  r   r`  r   r]  r5   r@  r}  s      rB   Ú__ebAuthRespzIMAP4Server.__ebAuthResp§  s    € Ø�=Š=Õ*Ñ+Ô+ð 	Ø×%Ò% cÐ+QÑRÔRÐRÐRÐRØ�]Š]Õ/Ñ0Ô0ð 	Ø×%Ò%ØÐCñô ð ð ð ð × Ò  Ð&PÑQÔQÐQÝŒG�GÑÔÐÐÐrD   c           	      óv   — |                       |dt          t          |j        ¦  «        ¦  «        z   ¦  «         d S )Ns   Authentication failed: )r`  r:   r–   ri   r}  s      rB   Ú__ebAuthChunkzIMAP4Server.__ebAuthChunk²  sA   € Ø×!Ò!ØÐ+­m½CÀÄÑ<NÔ<NÑ.OÔ.OÑOñ	
ô 	
ð 	
ð 	
ð 	
rD   c                 ó¨  — | j         r|                      |d¦  «         d S | j        r•| j        rŽ|                      |d¦  «         | j                             | j        ¦  «         d| _         | j                             ¦   «         | _        d| j        vrt          | j        d<   d| j        vrt          | j        d<   d S d S |                      |d¦  «         d S )Ns   TLS already negotiateds   Begin TLS negotiation nowTó   LOGINs   PLAINs   TLS not available)r(  r`  r  r'  rÇ  rÌ   ÚstartTLSr  Úcopyr   r   rö   s     rB   Údo_STARTTLSzIMAP4Server.do_STARTTLS·  sð   € ØŒ?ð 	AØ×%Ò% cÐ+DÑEÔEÐEÐEÐEØŒXð 
	A˜$Ô*ð 
	AØ×%Ò% cÐ+GÑHÔHÐHØŒN×#Ò# D¤HÑ-Ô-Ð-Ø"ˆDŒOØ#Ô/×4Ò4Ñ6Ô6ˆDÔØ˜tÔ/Ð/Ð/Ý-=�Ô  Ñ*Ø˜tÔ/Ð/Ð/Ý-=�Ô  Ñ*Ð*Ð*ð 0Ð/ð ×%Ò% cÐ+?Ñ@Ô@Ð@Ð@Ð@rD   c                 óò   — d|                       ¦   «         v r|                      |d¦  «         d S t          | j        ||¦  «                             | j        |¦  «                             | j        |¦  «         d S )Nr$  s!   LOGIN is disabled before STARTTLS)r+  r]  r   ÚauthenticateLoginrp  Ú_IMAP4Server__cbLoginr?  Ú_IMAP4Server__ebLogin)r_   r÷   ÚuserÚpasswds       rB   Údo_LOGINzIMAP4Server.do_LOGINÈ  sx   € Ø˜t×0Ò0Ñ2Ô2Ð2Ð2Ø× Ò  Ð&JÑKÔKÐKØˆFå�dÔ,¨d°FÑ;Ô;×GÒGØŒN˜Cñ	
ô 	
ç
Š*�T”^ SÑ
)Ô
)Ð
)Ð
)Ð
)rD   c                 ó”   — | j         r4| j                              t          j        ||¦  «        dt          ¦  «        S t          ¦   «         ‚)a´  
        Lookup the account associated with the given parameters

        Override this method to define the desired authentication behavior.

        The default behavior is to defer authentication to C{self.portal}
        if it is not None, or to deny the login otherwise.

        @type user: L{str}
        @param user: The username to lookup

        @type passwd: L{str}
        @param passwd: The password to login with
        N)rí  rú  r   ÚUsernamePasswordrû  r   )r_   r  r  s      rB   r  zIMAP4Server.authenticateLoginÓ  sJ   € ð Œ;ð 	Ø”;×$Ò$ÝÔ,¨T°6Ñ:Ô:¸DÅ(ñô ð õ  Ñ!Ô!Ð!rD   c                 ó  — |\  }}}|t           ur0|                      |d¦  «         t          j        d|›d�¦  «         d S || _        || _        |                      |d¦  «         d| _        |                      | j	        ¦  «         d S )Ns-   Server error: login returned unexpected valuez__cbLogin called with z, IAccount expecteds   LOGIN succeededr  )
rû  r]  r5   r@  r  r4  rÇ  rA  r/  r  r  s         rB   Ú	__cbLoginzIMAP4Server.__cbLoginè  s™   € Ø"(Ñˆ�˜Ø�Ð Ð Ø× Ò  Ð&VÑWÔWÐWÝŒGÐI¨UÐIÐIÐIÑJÔJÐJÐJÐJà!ˆDŒLØ#ˆDŒNØ×%Ò% cÐ+=Ñ>Ô>Ð>ØˆDŒJØ�OŠO˜DÔ1Ñ2Ô2Ð2Ð2Ð2rD   c           	      ó  — |                      t          ¦  «        r|                      |d¦  «         d S |                      |dt	          t          |j        ¦  «        ¦  «        z   ¦  «         t          j        |¦  «         d S )Ns   LOGIN failedr{  )	r|  r   r`  r]  r:   r–   ri   r5   r@  r}  s      rB   Ú	__ebLoginzIMAP4Server.__ebLoginô  s€   € Ø�=Š=Õ*Ñ+Ô+ð 	Ø×%Ò% c¨?Ñ;Ô;Ð;Ð;Ð;à× Ò ØÐ&­µs¸7¼=Ñ7IÔ7IÑ)JÔ)JÑJñô ð õ ŒG�GÑÔÐÐÐrD   c                 ó4  — d x}x}}t          | j        d ¦  «        }|�<|                     ¦   «         }|                     ¦   «         }|                     ¦   «         }|                      dt          |||g¦  «        z   ¦  «         |                      |d¦  «         d S )Ns
   NAMESPACE s   NAMESPACE command completed)r1   r  ÚgetPersonalNamespacesÚgetSharedNamespacesrT  ÚcollapseNestedListsrÇ  )r_   r÷   ÚpersonalÚpublicÚsharedÚnps         rB   Údo_NAMESPACEzIMAP4Server.do_NAMESPACEý  s©   € Ø%)Ð)ˆÐ)�6˜FÝ  ¤¨tÑ4Ô4ˆØˆ>Ø×/Ò/Ñ1Ô1ˆHØ×+Ò+Ñ-Ô-ˆFØ×+Ò+Ñ-Ô-ˆFØ×!Ò!ØÕ/°¸6À6Ð0JÑKÔKÑKñ	
ô 	
ð 	
ð 	×!Ò! #Ð'EÑFÔFÐFÐFÐFrD   c                 óÊ  — | j         rp| j                              | ¦  «         t          | j         d ¦  «        }|�1t          |j        ¦  «                             t          j        ¦  «         d | _         d| _        t          |¦  «        }t          | j
        j        t          |¦  «        |¦  «                             | j        ||¦  «                             | j        ||¦  «         d S )Nr  )r;  r<  r=  r   r>  r?  r5   r@  rA  Ú
_parseMboxr  Úselectrp  Ú_cbSelectWorkÚ_ebSelectWork)r_   r÷   ÚnameÚrwÚcmdNamerB  s         rB   Ú_selectWorkzIMAP4Server._selectWork  sÇ   € ØŒ9ð 	 ØŒI×$Ò$ TÑ*Ô*Ð*Ý$ T¤Y°Ñ5Ô5ˆDØÐÝ˜dœjÑ)Ô)×4Ò4µS´WÑ=Ô=Ð=ØˆDŒIØˆDŒJå˜$ÑÔˆÝ�d”lÔ)­:°dÑ+;Ô+;¸RÑ@Ô@×LÒLØÔ ¨ñ	
ô 	
ç
Š*�TÔ'¨°#Ñ
6Ô
6Ð
6Ð
6Ð
6rD   c                 ó`   — |                       ||dz   ¦  «         t          j        |¦  «         d S )Ns    failed: Server error©r]  r5   r@  )r_   r~  r0  r÷   s       rB   r-  zIMAP4Server._ebSelectWork  s4   € Ø×Ò˜S 'Ð,DÑ"DÑEÔEÐEÝŒ�ÑÔÐÐÐrD   c                 ó   — |€|                       |d¦  «         d S dd„ |                     ¦   «         D ¦   «         v r|                       |d¦  «         d S d„ |                     ¦   «         D ¦   «         }|                      d|                     ¦   «         fz  ¦  «         |                      d|                     ¦   «         fz  ¦  «         |                      dd	                     |¦  «        z   d
z   ¦  «         |                      d d|                     ¦   «         fz  ¦  «         |                     ¦   «         rdpd}| 	                    | ¦  «         |                      |d|z   dz   |z   dz   ¦  «         d| _
        || _        d S )Ns   No such mailboxz	\noselectc                 ó6   — g | ]}|                      ¦   «         ‘ŒS r>   )Úlower©rG   rÒ   s     rB   rJ   z-IMAP4Server._cbSelectWork.<locals>.<listcomp>"  s    € Ð?Ð?Ð?¨!˜AŸGšG™IœIÐ?Ð?Ð?rD   zMailbox cannot be selectedc                 ó,   — g | ]}t          |¦  «        ‘ŒS r>   ©r:   ©rG   Úflags     rB   rJ   z-IMAP4Server._cbSelectWork.<locals>.<listcomp>&  s    € ÐAÐAÐA¨•˜tÑ$Ô$ÐAÐAÐArD   ó	   %d EXISTSó	   %d RECENTó   FLAGS (rõ   r¢  s   [UIDVALIDITY %d]rä   rå   ó   [rÃ  s    successfulr+  )r`  ÚgetFlagsrT  ÚgetMessageCountÚgetRecentCountr—   rÇ  ÚgetUIDValidityÚisWriteableÚaddListenerrA  r;  )r_   r;  r0  r÷   rµ  rÒ   s         rB   r,  zIMAP4Server._cbSelectWork  s‹  € Øˆ<Ø×%Ò% cÐ+=Ñ>Ô>Ð>ØˆFØÐ?Ð?¨t¯}ª}©¬Ð?Ñ?Ô?Ð?Ð?Ø×%Ò% cÐ+GÑHÔHÐHØˆFàAÐA°·²±´ÐAÑAÔAˆØ×!Ò! ,°$×2FÒ2FÑ2HÔ2HÐ1JÑ"JÑKÔKÐKØ×!Ò! ,°$×2EÒ2EÑ2GÔ2GÐ1IÑ"IÑJÔJÐJØ×!Ò! *¨t¯yªy¸Ñ/?Ô/?Ñ"?À$Ñ"FÑGÔGÐGØ×!Ò! $Ð(;¸t×?RÒ?RÑ?TÔ?TÐ>VÑ(VÑWÔWÐWà×ÒÑÔÐ0 =Ð@°LˆØ×Ò˜ÑÔÐØ×!Ò! # t¨a¡x°%Ñ'7¸'Ñ'AÀNÑ'RÑSÔSÐSØˆŒ
ØˆŒ	ˆ	ˆ	rD   r;   ó   SELECTr   ó   EXAMINEc                 ód   — |                       d ¦  «         || _        | j        | _        d| _        d S )NÚidle)r„  ÚparseTagrR  Ú	lastStaterö   s     rB   Údo_IDLEzIMAP4Server.do_IDLE8  s1   € Ø×$Ò$ TÑ*Ô*Ð*ØˆŒØœˆŒØ ˆŒˆˆrD   c                 ó\   — | j         | _        | ` |                      | j        d¦  «         | `d S )Ns   IDLE terminated)rK  rR  rÇ  rJ  )r_   rî   s     rB   Ú
parse_idlezIMAP4Server.parse_idle>  s2   € Øœ.ˆŒØˆNØ×!Ò! $¤-Ð1CÑDÔDÐDØˆMˆMˆMrD   c           	      ó´  — t          |¦  «        }	 | j                             |¦  «        }|r|                      |d¦  «         d S |                      |d¦  «         d S # t
          $ r;}|                      |t          t          |¦  «        ¦  «        ¦  «         Y d }~d S d }~wt          $ r- |  	                    |d¦  «         t          j        ¦   «          Y d S w xY w)Ns   Mailbox createds   Mailbox not createds/   Server error encountered while creating mailbox)r*  r  ÚcreaterÇ  r`  r   r:   r–   ÚBaseExceptionr]  r5   r@  )r_   r÷   r.  rx  rÞ  s        rB   Ú	do_CREATEzIMAP4Server.do_CREATEG  s  € Ý˜$ÑÔˆð	GØ”\×(Ò(¨Ñ.Ô.ˆFð ð GØ×)Ò)¨#Ð/AÑBÔBÐBÐBÐBà×)Ò)¨#Ð/EÑFÔFÐFÐFÐFøõ  ð 	Bð 	Bð 	BØ×%Ò% c­=½¸Q¹¼Ñ+@Ô+@ÑAÔAÐAÐAÐAÐAÐAÐAÐAøøøøÝð 	ð 	ð 	Ø× Ò ØÐGñô ð õ ŒG‰IŒIˆIˆIˆIˆIð		øøøs   ‘A Á
CÁ'0BÂ6CÃCc                 óì  — t          |¦  «        }|                     ¦   «         dk    r|                      |d¦  «         d S 	 | j                             |¦  «         |                      |d¦  «         d S # t          $ rA}|                      |t          |¦  «                             d¦  «        ¦  «         Y d }~d S d }~wt          $ r- |  
                    |d¦  «         t          j        ¦   «          Y d S w xY w)NÚinboxs   You cannot delete the inboxs   Mailbox deletedúimap4-utf-7s/   Server error encountered while deleting mailbox)r*  r6  r`  r  ÚdeleterÇ  r   r–   ÚencoderQ  r]  r5   r@  ©r_   r÷   r.  rž  s       rB   Ú	do_DELETEzIMAP4Server.do_DELETE[  s  € Ý˜$ÑÔˆØ�:Š:‰<Œ<˜7Ò"Ð"Ø×%Ò% cÐ+IÑJÔJÐJØˆFð
	?ØŒL×Ò Ñ%Ô%Ð%ð ×%Ò% cÐ+=Ñ>Ô>Ð>Ð>Ð>øõ  ð 	Ið 	Ið 	IØ×%Ò% c­3¨q©6¬6¯=ª=¸Ñ+GÔ+GÑHÔHÐHÐHÐHÐHÐHÐHÐHøøøøÝð 	ð 	ð 	Ø× Ò ØÐGñô ð õ ŒG‰IŒIˆIˆIˆIˆIð		øøøs   ÁA3 Á3
C3Á=6B9Â96C3Ã2C3c           	      óZ  — d„ ||fD ¦   «         \  }}|                      ¦   «         dk    s|                      ¦   «         dk    r|                      |d¦  «         d S 	 | j                             ||¦  «         |                      |d¦  «         d S # t
          $ r |                      |d¦  «         Y d S t          $ r;}|                      |t          t          |¦  «        ¦  «        ¦  «         Y d }~d S d }~wt          $ r- |                      |d¦  «         t          j        ¦   «          Y d S w xY w)Nc              3   ó4   K  — | ]}t          |¦  «        V — Œd S rv   )r*  )rG   Úns     rB   r  z(IMAP4Server.do_RENAME.<locals>.<genexpr>p  s(   è è € ÐFÐF¨a�J q™MœMÐFÐFÐFÐFÐFÐFrD   rT  s@   You cannot rename the inbox, or rename another mailbox to inbox.s   Mailbox renameds   Invalid command syntaxs/   Server error encountered while renaming mailbox)r6  r`  r  ÚrenamerÇ  rw   r]  r   r:   r–   rQ  r5   r@  )r_   r÷   ÚoldnameÚnewnamerž  s        rB   Ú	do_RENAMEzIMAP4Server.do_RENAMEo  sw  € ØFÐF°G¸WÐ3EÐFÑFÔFÑˆ�Ø�=Š=‰?Œ?˜gÒ%Ð%¨¯ª©¬¸GÒ)CÐ)CØ×%Ò%ØÐXñô ð ð ˆFð	?ØŒL×Ò ¨Ñ1Ô1Ð1ð ×%Ò% cÐ+=Ñ>Ô>Ð>Ð>Ð>øõ ð 	Að 	Að 	AØ× Ò  Ð&?Ñ@Ô@Ð@Ð@Ð@Ð@Ýð 	Bð 	Bð 	BØ×%Ò% c­=½¸Q¹¼Ñ+@Ô+@ÑAÔAÐAÐAÐAÐAÐAÐAÐAøøøøÝð 	ð 	ð 	Ø× Ò ØÐGñô ð õ ŒG‰IŒIˆIˆIˆIˆIð		øøøs$   ÁB Â D*Â1	D*Â:0C0Ã06D*Ä)D*c           	      ó€  — t          |¦  «        }	 | j                             |¦  «         |                      |d¦  «         d S # t          $ r;}|                      |t          t          |¦  «        ¦  «        ¦  «         Y d }~d S d }~wt          $ r- |  	                    |d¦  «         t          j        ¦   «          Y d S w xY w)Ns
   Subscribeds5   Server error encountered while subscribing to mailbox)r*  r  Ú	subscriberÇ  r   r`  r:   r–   rQ  r]  r5   r@  rX  s       rB   Údo_SUBSCRIBEzIMAP4Server.do_SUBSCRIBE‡  så   € Ý˜$ÑÔˆð
	:ØŒL×"Ò" 4Ñ(Ô(Ð(ð ×%Ò% c¨=Ñ9Ô9Ð9Ð9Ð9øõ  ð 	Bð 	Bð 	BØ×%Ò% c­=½¸Q¹¼Ñ+@Ô+@ÑAÔAÐAÐAÐAÐAÐAÐAÐAøøøøÝð 	ð 	ð 	Ø× Ò ØÐMñô ð õ ŒG‰IŒIˆIˆIˆIˆIð		øøøó   ‘A Á
B=Á0BÂ6B=Â<B=c           	      ó€  — t          |¦  «        }	 | j                             |¦  «         |                      |d¦  «         d S # t          $ r;}|                      |t          t          |¦  «        ¦  «        ¦  «         Y d }~d S d }~wt          $ r- |  	                    |d¦  «         t          j        ¦   «          Y d S w xY w)Ns   Unsubscribeds9   Server error encountered while unsubscribing from mailbox)r*  r  ÚunsubscriberÇ  r   r`  r:   r–   rQ  r]  r5   r@  rX  s       rB   Údo_UNSUBSCRIBEzIMAP4Server.do_UNSUBSCRIBE˜  så   € Ý˜$ÑÔˆð
	<ØŒL×$Ò$ TÑ*Ô*Ð*ð ×%Ò% c¨?Ñ;Ô;Ð;Ð;Ð;øõ  ð 	Bð 	Bð 	BØ×%Ò% c­=½¸Q¹¼Ñ+@Ô+@ÑAÔAÐAÐAÐAÐAÐAÐAÐAøøøøÝð 	ð 	ð 	Ø× Ò ØÐQñô ð õ ŒG‰IŒIˆIˆIˆIˆIð		øøørd  c                 óà   — t          |¦  «        }t          |¦  «        }t          | j        j        ||¦  «                             | j        |||¦  «                             | j        |¦  «         d S rv   )r*  r   r  ÚlistMailboxesrp  Ú_cbListWorkr?  Ú_ebListWork)r_   r÷   Úrefr;  Úsubr0  s         rB   Ú	_listWorkzIMAP4Server._listWork©  se   € Ý˜$ÑÔˆÝ˜‰oŒoˆÝ�d”lÔ0°#°tÑ<Ô<×HÒHØÔ˜c 3¨ñ	
ô 	
ç
Š*�TÔ% sÑ
+Ô
+Ð
+Ð
+Ð
+rD   c                 óÀ  — |D ]Á\  }}|r| j                              |¦  «        r d„ |                     ¦   «         D ¦   «         }|                     ¦   «                              d¦  «        }t          |¦  «        t          t
          |¦  «        ||                     d¦  «        f}	|                      t          |	¦  «        ¦  «         ŒÂ|  	                    ||dz   ¦  «         d S )Nc                 ó,   — g | ]}t          |¦  «        ‘ŒS r>   r9  r:  s     rB   rJ   z+IMAP4Server._cbListWork.<locals>.<listcomp>³  s    € ÐHÐHÐH°� tÑ,Ô,ÐHÐHÐHrD   rU  s
    completed)
r  ÚisSubscribedr@  ÚgetHierarchicalDelimiterrW  ÚDontQuoteMeÚmaprT  r#  rÇ  )
r_   Ú	mailboxesr÷   rm  r0  r.  Úboxrµ  ÚdelimÚresps
             rB   rj  zIMAP4Server._cbListWork°  sä   € Ø"ð 
	Eð 
	E‰IˆD�#Øð 	E˜$œ,×3Ò3°DÑ9Ô9ð 	EØHÐH¸¿º¹¼ÐHÑHÔH�Ø×4Ò4Ñ6Ô6×=Ò=¸mÑLÔL�å Ñ(Ô(Ý� UÑ+Ô+ØØ—K’K Ñ.Ô.ð	�ð ×)Ò)Õ*=¸dÑ*CÔ*CÑDÔDÐDøØ×!Ò! # w°Ñ'>Ñ?Ô?Ð?Ð?Ð?rD   c                 óZ   — |                       |d¦  «         t          j        |¦  «         d S )Ns1   Server error encountered while listing mailboxes.r3  r}  s      rB   rk  zIMAP4Server._ebListWork¾  s/   € Ø×Ò˜SÐ"VÑWÔWÐWÝŒ�ÑÔÐÐÐrD   rÙ   rÚ   c                 ó  — g }|D ]$}|                      t          |¦  «        ¦  «         Œ%t          |¦  «        }t          | j        j        |d¦  «                             | j        |||¦  «                             | j	        |¦  «         d S rÊ   )
rt   r9   r*  r   r  r+  rp  Ú_cbStatusGotMailboxr?  Ú_ebStatusGotMailbox)r_   r÷   Úmailboxr  ÚnativeNamesr.  s         rB   Ú	do_STATUSzIMAP4Server.do_STATUSÈ  s�   € ØˆØð 	3ð 	3ˆDØ×Ò�|¨DÑ1Ô1Ñ2Ô2Ð2Ð2å˜WÑ%Ô%ˆå�d”lÔ)¨7°AÑ6Ô6×BÒBØÔ$ c¨7°Kñ	
ô 	
ç
Š*�TÔ-¨sÑ
3Ô
3Ð
3Ð
3Ð
3rD   c                 ó°   — |r=t          |j        |¦  «                             | j        | j        ||fd ||fd ¦  «         d S |                      |d¦  «         d S )Ns   Could not open mailbox)r   ÚrequestStatusrü  Ú_IMAP4Server__cbStatusÚ_IMAP4Server__ebStatusr`  )r_   r;  r÷   r}  r  s        rB   r{  zIMAP4Server._cbStatusGotMailboxÓ  sw   € Øð 
	FÝ˜$Ô,¨eÑ4Ô4×AÒAØ”Ø”Ø�g�ØØ�g�Øñô ð ð ð ð ×%Ò% cÐ+DÑEÔEÐEÐEÐErD   c                 óZ   — |                       |d¦  «         t          j        |¦  «         d S ©Ns/   Server error encountered while opening mailbox.r3  r}  s      rB   r|  zIMAP4Server._ebStatusGotMailboxà  ó/   € Ø×Ò˜SÐ"TÑUÔUÐUÝŒ�ÑÔÐÐÐrD   c                 ó  — t          d                     d„ |                     ¦   «         D ¦   «         ¦  «        ¦  «        }|                      d|                     d¦  «        z   dz   |z   dz   ¦  «         |                      |d¦  «         d S )Nú c                 ó   — g | ]}d |z  ‘ŒS )z%s %sr>   ©rG   rU   s     rB   rJ   z*IMAP4Server.__cbStatus.<locals>.<listcomp>é  s   € Ð&KÐ&KÐ&K°q w°¡{Ð&KÐ&KÐ&KrD   ó   STATUS rU  ó    (r¢  s   STATUS complete)r:   r—   rß  rT  rW  rÇ  )r_   Ústatusr÷   rv  r»   s        rB   Ú
__cbStatuszIMAP4Server.__cbStatusç  sŒ   € å˜SŸXšXÐ&KÐ&K¸F¿LºL¹N¼NÐ&KÑ&KÔ&KÑLÔLÑMÔMˆØ×!Ò!Ø˜Ÿš MÑ2Ô2Ñ2°UÑ:¸TÑAÀDÑHñ	
ô 	
ð 	
ð 	×!Ò! #Ð'9Ñ:Ô:Ð:Ð:Ð:rD   c           	      ó‚   — |                       |d|z   dz   t          t          |j        ¦  «        ¦  «        z   ¦  «         d S )Nr‹  s	    failed: ©r]  r:   r–   ri   )r_   r~  r÷   rv  s       rB   Ú
__ebStatuszIMAP4Server.__ebStatusï  sJ   € Ø×ÒØ�˜cÑ! LÑ0µ=ÅÀWÄ]ÑASÔASÑ3TÔ3TÑTñ	
ô 	
ð 	
ð 	
ð 	
rD   c                 óÂ   — t          |¦  «        }t          | j        j        |¦  «                             | j        ||||¦  «                             | j        |¦  «         d S rv   )r*  r   r  r+  rp  Ú_cbAppendGotMailboxr?  Ú_ebAppendGotMailbox)r_   r÷   r}  rµ  r½  rÄ  s         rB   Ú	do_APPENDzIMAP4Server.do_APPENDô  sZ   € Ý˜WÑ%Ô%ˆÝ�d”lÔ)¨7Ñ3Ô3×?Ò?ØÔ$ c¨5°$¸ñ	
ô 	
ç
Š*�TÔ-¨sÑ
3Ô
3Ð
3Ð
3Ð
3rD   c                 óî   — |s|                       |d¦  «         d S d„ |D ¦   «         }|                     |||¦  «        }|                     | j        ||¦  «         |                     | j        |¦  «         d S )Nz[TRYCREATE] No such mailboxc                 ó,   — g | ]}t          |¦  «        ‘ŒS r>   ©r9   r:  s     rB   rJ   z3IMAP4Server._cbAppendGotMailbox.<locals>.<listcomp>ÿ  s    € Ð=Ð=Ð=¨t� TÑ*Ô*Ð=Ð=Ð=rD   )r`  Ú
addMessagerp  Ú_IMAP4Server__cbAppendr?  Ú_IMAP4Server__ebAppend)r_   r;  r÷   rµ  r½  rÄ  ÚdecodedFlagsr  s           rB   r“  zIMAP4Server._cbAppendGotMailboxú  s‚   € Øð 	Ø×%Ò% cÐ+HÑIÔIÐIØˆFà=Ð=°uÐ=Ñ=Ô=ˆØ�OŠO˜G \°4Ñ8Ô8ˆØ	�Š�d”o s¨DÑ1Ô1Ð1Ø	�Š�T”_ cÑ*Ô*Ð*Ð*Ð*rD   c                 óZ   — |                       |d¦  «         t          j        |¦  «         d S r…  r3  r}  s      rB   r”  zIMAP4Server._ebAppendGotMailbox  r†  rD   c                 óˆ   — |                       d|                     ¦   «         fz  ¦  «         |                      |d¦  «         d S )Nr<  s   APPEND complete)rT  rA  rÇ  )r_   rx  r÷   r;  s       rB   Ú
__cbAppendzIMAP4Server.__cbAppend  sG   € Ø×!Ò! ,°$×2FÒ2FÑ2HÔ2HÐ1JÑ"JÑKÔKÐKØ×!Ò! #Ð'9Ñ:Ô:Ð:Ð:Ð:rD   c           	      óv   — |                       |dt          t          |j        ¦  «        ¦  «        z   ¦  «         d S )Ns   APPEND failed: r�  r}  s      rB   Ú
__ebAppendzIMAP4Server.__ebAppend  sA   € Ø×ÒØÐ#¥mµC¸¼Ñ4FÔ4FÑ&GÔ&GÑGñ	
ô 	
ð 	
ð 	
ð 	
rD   c                 ó¬   — |                       ¦   «         }|€|                      d |¦  «         d S |                     | j        | j        |f|f¬¦  «         d S )N)ÚcallbackArgsÚerrbackArgs)Ú
checkpointÚ_IMAP4Server__cbCheckrü  Ú_IMAP4Server__ebCheck)r_   r÷   r  s      rB   Údo_CHECKzIMAP4Server.do_CHECK  sh   € Ø�OŠOÑÔˆØˆ9Ø�NŠN˜4 Ñ%Ô%Ð%Ð%Ð%à�NŠNØ” ¤¸c¸VÐRUÐQWð ñ ô ð ð ð rD   c                 ó2   — |                       |d¦  «         d S )Ns   CHECK completedrç  ©r_   rx  r÷   s      rB   Ú	__cbCheckzIMAP4Server.__cbCheck  s   € Ø×!Ò! #Ð'9Ñ:Ô:Ð:Ð:Ð:rD   c           	      óv   — |                       |dt          t          |j        ¦  «        ¦  «        z   ¦  «         d S )Ns   CHECK failed: r�  r}  s      rB   Ú	__ebCheckzIMAP4Server.__ebCheck"  ó6   € Ø×Ò˜SÐ"3µmÅCÈÌÑDVÔDVÑ6WÔ6WÑ"WÑXÔXÐXÐXÐXrD   c                 ó   — dS )ah  
        Called when the client issues a CHECK command.

        This should perform any checkpoint operations required by the server.
        It may be a long running operation, but may not block.  If it returns
        a deferred, the client will only be informed of success (or failure)
        when the deferred's callback (or errback) is invoked.
        Nr>   rd   s    rB   r¥  zIMAP4Server.checkpoint%  s	   € ð ˆtrD   c                 ó|  ‡— d }| j                              ¦   «         rt          | j         j        ¦  «        }t	          | j         d ¦  «        Š‰�/|�|                     ˆfd„¦  «         nt          ‰j        ¦  «        }|�(|                     | j        | j	        |fd |fd ¦  «         d S |                      d |¦  «         d S )Nc                 ó,   •— ‰                      ¦   «         S rv   )r>  )rx  rB  s    €rB   rV   z&IMAP4Server.do_CLOSE.<locals>.<lambda>7  s   ø€ ¨T¯ZªZ©\¬\€ rD   )
r;  rD  r   Úexpunger=  rp  r>  rü  Ú_IMAP4Server__cbCloseÚ_IMAP4Server__ebClose)r_   r÷   r  rB  s      @rB   Údo_CLOSEzIMAP4Server.do_CLOSE0  sÄ   ø€ ØˆØŒ9× Ò Ñ"Ô"ð 	1Ý˜dœiÔ/Ñ0Ô0ˆAÝ  ¤¨DÑ1Ô1ˆØÐØˆ}Ø—’Ð9Ð9Ð9Ð9Ñ:Ô:Ð:Ð:å! $¤*Ñ-Ô-�Øˆ=Ø�NŠN˜4œ>¨4¬>¸C¸6À4È#ÈÐQUÑVÔVÐVÐVÐVà�NŠN˜4 Ñ%Ô%Ð%Ð%Ð%rD   c                 ó‚   — |                       |d¦  «         | j                             | ¦  «         d | _        d| _        d S )Ns   CLOSE completedr  )rÇ  r;  r<  rA  rª  s      rB   Ú	__cbClosezIMAP4Server.__cbCloseA  sA   € Ø×!Ò! #Ð'9Ñ:Ô:Ð:ØŒ	× Ò  Ñ&Ô&Ð&ØˆŒ	ØˆŒ
ˆ
ˆ
rD   c           	      óv   — |                       |dt          t          |j        ¦  «        ¦  «        z   ¦  «         d S )Ns   CLOSE failed: r�  r}  s      rB   Ú	__ebClosezIMAP4Server.__ebCloseG  r®  rD   c                 óâ   — | j                              ¦   «         r?t          | j         j        ¦  «                             | j        | j        |fd |fd ¦  «         d S |                      |d¦  «         d S )Ns$   EXPUNGE ignored on read-only mailbox)r;  rD  r   r²  rü  Ú_IMAP4Server__cbExpungeÚ_IMAP4Server__ebExpunger`  rö   s     rB   Ú
do_EXPUNGEzIMAP4Server.do_EXPUNGEJ  s~   € ØŒ9× Ò Ñ"Ô"ð 	TÝ˜$œ)Ô+Ñ,Ô,×9Ò9ØÔ  $Ô"2°S°F¸DÀ3À&È$ñô ð ð ð ð ×%Ò% cÐ+RÑSÔSÐSÐSÐSrD   c                 ón   — |D ]}|                       d|fz  ¦  «         Œ|                      |d¦  «         d S )Ns
   %d EXPUNGEs   EXPUNGE completed)rT  rÇ  )r_   rx  r÷   rV  s       rB   Ú__cbExpungezIMAP4Server.__cbExpungeT  sL   € Øð 	<ð 	<ˆAØ×%Ò% m°q°dÑ&:Ñ;Ô;Ð;Ð;Ø×!Ò! #Ð';Ñ<Ô<Ð<Ð<Ð<rD   c           	      óž   — |                       |dt          t          |j        ¦  «        ¦  «        z   ¦  «         t	          j        |¦  «         d S )Ns   EXPUNGE failed: ©r]  r:   r–   ri   r5   r@  r}  s      rB   Ú__ebExpungezIMAP4Server.__ebExpungeY  sO   € Ø×ÒØÐ$¥}µS¸¼Ñ5GÔ5GÑ'HÔ'HÑHñ	
ô 	
ð 	
õ 	Œ�ÑÔÐÐÐrD   c                 ó¢  — t          | j        d ¦  «        }|�Rt          |j        ||¬¦  «                             | j        || j        |¦  «                             | j        |¦  «         d S t          d¦  «        }t          | j        j	        ||¬¦  «                             | j
        || j        ||¦  «                             | j        |¦  «         d S )N©ri  s   1:*)ÚISearchableMailboxr;  r   r´  rp  Ú_IMAP4Server__cbSearchr?  Ú_IMAP4Server__ebSearchr¬  ÚfetchÚ_IMAP4Server__cbManualSearch)r_   r÷   Úcharsetr©  ri  ÚsmrÒ   s          rB   Ú	do_SEARCHzIMAP4Server.do_SEARCH_  sÂ   € Ý ¤	¨4Ñ0Ô0ˆØˆ>Ý˜"œ) U°Ð4Ñ4Ô4×@Ò@Ø”  d¤i°ñô çŠj˜œ¨#Ñ.Ô.Ð.Ð.Ð.õ ˜FÑ#Ô#ˆAÝ˜$œ)œ/¨1°#Ð6Ñ6Ô6×BÒBØÔ% s¨D¬I°u¸cñô çŠj˜œ¨#Ñ.Ô.Ð.Ð.Ð.rD   c                 óè   — |rt          |j        |¦  «        }t          d                     d„ |D ¦   «         ¦  «        ¦  «        }|                      d|z   ¦  «         |                      |d¦  «         d S )Nrˆ  c                 ó,   — g | ]}t          |¦  «        ‘ŒS r>   rœ   ©rG   rj   s     rB   rJ   z*IMAP4Server.__cbSearch.<locals>.<listcomp>r  s   € Ð%=Ð%=Ð%=°¥c¨!¡f¤fÐ%=Ð%=Ð%=rD   ó   SEARCH ó   SEARCH completed)rt  ÚgetUIDr:   r—   rT  rÇ  )r_   rx  r÷   r;  ri  Úidss         rB   Ú
__cbSearchzIMAP4Server.__cbSearcho  sy   € Øð 	.Ý˜œ fÑ-Ô-ˆFÝ˜CŸHšHÐ%=Ð%=°fÐ%=Ñ%=Ô%=Ñ>Ô>Ñ?Ô?ˆØ×!Ò! *¨sÑ"2Ñ3Ô3Ð3Ø×!Ò! #Ð':Ñ;Ô;Ð;Ð;Ð;rD   c           
      óž  — |€g }d}|o|d         d         }|o|d         d                               ¦   «         }	t          t          t          d¦  «        |¦  «        ¦  «        D ]b\  }\  }
}|                      t          j        |¦  «        |
|||	¦  «        r/|                     d|r|                      ¦   «         n|
fz  ¦  «         Œc|dk    r>ddlm	} | 
                    d| j        t          |dd…         ¦  «        |||||¦  «         dS |r+|                      d	d
                     |¦  «        z   ¦  «         |                      |d¦  «         dS )aL  
        Apply the search filter to a set of messages. Send the response to the
        client.

        @type result: L{list} of L{tuple} of (L{int}, provider of
            L{imap4.IMessage})
        @param result: A list two tuples of messages with their sequence ids,
            sorted by the ids in descending order.

        @type tag: L{str}
        @param tag: A command tag.

        @type mbox: Provider of L{imap4.IMailbox}
        @param mbox: The searched mailbox.

        @type query: L{list}
        @param query: A list representing the parsed form of the search query.

        @param uid: A flag indicating whether the search is over message
            sequence numbers or UIDs.

        @type searchResults: L{list}
        @param searchResults: The search results so far or L{None} if no
            results yet.
        Nr   r   r;   é   s   %dé   ©ÚreactorrÐ  rõ   rÑ  )rÒ  r[   ÚzipÚrangeÚ_searchFilterr  Údeepcopyrt   Útwisted.internetrÙ  Ú	callLaterrÉ  rT  r—   rÇ  )r_   rx  r÷   r;  r©  ri  ÚsearchResultsrj   ÚlastSequenceIdÚlastMessageIdÚmsgIdrÉ  rÙ  s                rB   Ú__cbManualSearchzIMAP4Server.__cbManualSearchv  sŒ  € ð4 Ð ØˆMØˆð  Ð1 F¨2¤J¨q¤MˆØÐ9 6¨"¤:¨a¤=×#7Ò#7Ñ#9Ô#9ˆÝ#¥C­¨a©¬°&Ñ$9Ô$9Ñ:Ô:ð 	Pð 	P‰OˆA‰|��sð ×!Ò!Ý”˜eÑ$Ô$ e¨S°.À-ñô ð Pð ×$Ò$ U¸cÐ.L¨c¯jªj©l¬l¨lÀuÐ-NÑ%NÑOÔOÐOøà�Š6ˆ6Ø0Ð0Ð0Ð0Ð0Ð0à×ÒØØÔ%Ý�V˜A˜B˜B”ZÑ Ô ØØØØØñ	ô 	ð 	ð 	ð 	ð ð QØ×)Ò)¨*°t·y²yÀÑ7OÔ7OÑ*OÑPÔPÐPØ×%Ò% cÐ+>Ñ?Ô?Ð?Ð?Ð?rD   c                 óD   — |r|                       |||||¦  «        sdS |°dS )aÙ  
        Pop search terms from the beginning of C{query} until there are none
        left and apply them to the given message.

        @param query: A list representing the parsed form of the search query.

        @param id: The sequence number of the message being checked.

        @param msg: The message being checked.

        @type lastSequenceId: L{int}
        @param lastSequenceId: The highest sequence number of any message in
            the mailbox being searched.

        @type lastMessageId: L{int}
        @param lastMessageId: The highest UID of any message in the mailbox
            being searched.

        @return: Boolean indicating whether all of the query terms match the
            message.
        FT©Ú_singleSearchStep)r_   r©  ÚidrÉ  rá  râ  s         rB   rÜ  zIMAP4Server._searchFilter²  sG   € ð, ð 	Ø×)Ò)Ø�r˜3 °ñô ð ð �uð	 ð 	ð
 ˆtrD   c                 óô  — |                      d¦  «        }t          |t          ¦  «        r|                      |||||¦  «        sdS n±|                     ¦   «         }|dd…                              ¦   «         st          ||¦  «        }||v S t          | dt          |¦  «        z   d¦  «        }	|	€t          dt          |¦  «        z  ¦  «        ‚|| j
        v r |	|||||f¦  «        }
n |	|||¦  «        }
|
sdS dS )a—  
        Pop one search term from the beginning of C{query} (possibly more than
        one element) and return whether it matches the given message.

        @param query: A list representing the parsed form of the search query.

        @param msgId: The sequence number of the message being checked.

        @param msg: The message being checked.

        @param lastSequenceId: The highest sequence number of any message in
            the mailbox being searched.

        @param lastMessageId: The highest UID of any message in the mailbox
            being searched.

        @return: Boolean indicating whether the query term matched the message.
        r   FNr;   Úsearch_zInvalid search command %sT)rL  rZ   r[   rÜ  r^  Úisalphar¬  rQ  r9   r   Ú_requiresLastMessageInfo)r_   r©  rã  rÉ  rá  râ  ÚqrÞ  Ú
messageSetrU  rx  s              rB   rç  zIMAP4Server._singleSearchStepÏ  s"  € ð( �IŠI�a‰LŒLˆÝ�a�ÑÔð 	!Ø×%Ò% a¨°°^À]ÑSÔSð Ø�uðð —’‘	”	ˆAØ�R�a�R”5—=’=‘?”?ð !õ )¨¨NÑ;Ô;�
Ø 
Ð*Ð*å˜D )­l¸1©o¬oÑ"=¸tÑDÔD�Ø�9Ý+Ø3µlÀ1±o´oÑEñô ð ð ˜Ô5Ð5Ð5Ø˜Q˜u e¨S°>À=Ð2QÑRÔR�F�Fà˜Q˜u e¨SÑ1Ô1�Fàð !Ø ˜5ØˆtrD   c                 ó   — dS )aS  
        Returns C{True} if the message matches the ALL search key (always).

        @type query: A L{list} of L{str}
        @param query: A list representing the parsed query string.

        @type id: L{int}
        @param id: The sequence number of the message being checked.

        @type msg: Provider of L{imap4.IMessage}
        Tr>   ©r_   r©  rè  rÉ  s       rB   Ú
search_ALLzIMAP4Server.search_ALLÿ  s	   € ð ˆtrD   c                 ó.   — d|                      ¦   «         v S )aA  
        Returns C{True} if the message has been answered.

        @type query: A L{list} of L{str}
        @param query: A list representing the parsed query string.

        @type id: L{int}
        @param id: The sequence number of the message being checked.

        @type msg: Provider of L{imap4.IMessage}
        ú	\Answered©r@  rð  s       rB   Úsearch_ANSWEREDzIMAP4Server.search_ANSWERED  s   € ð ˜sŸ|š|™~œ~Ð-Ð-rD   c                 óö   — |                      dd¦  «                             dd¦  «        }|                     ¦   «                              |                     d¦  «                             ¦   «         ¦  «        dk    S )aR  
        Returns C{True} if the message has a BCC address matching the query.

        @type query: A L{list} of L{str}
        @param query: A list whose first element is a BCC L{str}

        @type id: L{int}
        @param id: The sequence number of the message being checked.

        @type msg: Provider of L{imap4.IMessage}
        FÚbccÚ r   r   ©Ú
getHeadersÚgetr6  r¤  rL  )r_   r©  rè  rÉ  r÷  s        rB   Ú
search_BCCzIMAP4Server.search_BCC  s^   € ð �nŠn˜U EÑ*Ô*×.Ò.¨u°bÑ9Ô9ˆØ�yŠy‰{Œ{×Ò §	¢	¨!¡¤× 2Ò 2Ñ 4Ô 4Ñ5Ô5¸Ò;Ð;rD   c                 óÊ   — t          |                     d¦  «        ¦  «        }t          j                             t          |                     ¦   «         ¦  «        ¦  «        |k     S rÊ   )Ú	parseTimerL  ÚemailÚutilsÚ	parsedater9   ÚgetInternalDate©r_   r©  rè  rÉ  r½  s        rB   Úsearch_BEFOREzIMAP4Server.search_BEFORE*  sH   € Ý˜Ÿš 1™œÑ&Ô&ˆÝŒ{×$Ò$¥\°#×2EÒ2EÑ2GÔ2GÑ%HÔ%HÑIÔIÈDÒPÐPrD   c                 ó    — |                      d¦  «                             ¦   «         }t          j        ||                     ¦   «         d¦  «        S ©Nr   F©rL  r6  r6   ÚstrFileÚgetBodyFile©r_   r©  rè  rÉ  Úbodys        rB   Úsearch_BODYzIMAP4Server.search_BODY.  s;   € Ø�yŠy˜‰|Œ|×!Ò!Ñ#Ô#ˆÝŒ|˜D #§/¢/Ñ"3Ô"3°UÑ;Ô;Ð;rD   c                 óö   — |                      dd¦  «                             dd¦  «        }|                     ¦   «                              |                     d¦  «                             ¦   «         ¦  «        dk    S )NFÚccrø  r   r   rù  )r_   r©  rè  rÉ  r  s        rB   Ú	search_CCzIMAP4Server.search_CC2  óZ   € Ø�^Š^˜E 4Ñ(Ô(×,Ò,¨T°2Ñ6Ô6ˆØ�xŠx‰zŒz�Š˜uŸyšy¨™|œ|×1Ò1Ñ3Ô3Ñ4Ô4¸Ò:Ð:rD   c                 ó.   — d|                      ¦   «         v S ©Nz\Deletedrô  rð  s       rB   Úsearch_DELETEDzIMAP4Server.search_DELETED6  ó   € Ø˜cŸlšl™nœnÐ,Ð,rD   c                 ó.   — d|                      ¦   «         v S ©Nz\Draftrô  rð  s       rB   Úsearch_DRAFTzIMAP4Server.search_DRAFT9  s   € Ø˜CŸLšL™NœNÐ*Ð*rD   c                 ó.   — d|                      ¦   «         v S ©Nz\Flaggedrô  rð  s       rB   Úsearch_FLAGGEDzIMAP4Server.search_FLAGGED<  r  rD   c                 óö   — |                      dd¦  «                             dd¦  «        }|                     ¦   «                              |                     d¦  «                             ¦   «         ¦  «        dk    S )NFÚfromrø  r   r   rù  )r_   r©  rè  rÉ  Úfms        rB   Úsearch_FROMzIMAP4Server.search_FROM?  sZ   € Ø�^Š^˜E 6Ñ*Ô*×.Ò.¨v°rÑ:Ô:ˆØ�xŠx‰zŒz�Š˜uŸyšy¨™|œ|×1Ò1Ñ3Ô3Ñ4Ô4¸Ò:Ð:rD   c                 óD  — |                      d¦  «                             ¦   «         }|                     d|¦  «                             |d¦  «        }|                     ¦   «                              |                      d¦  «                             ¦   «         ¦  «        dk    S )Nr   Frø  r   )rL  r6  rú  rû  r¤  )r_   r©  rè  rÉ  Úhdrs        rB   Úsearch_HEADERzIMAP4Server.search_HEADERC  sw   € Ø�iŠi˜‰lŒl× Ò Ñ"Ô"ˆØ�nŠn˜U CÑ(Ô(×,Ò,¨S°"Ñ5Ô5ˆØ�yŠy‰{Œ{×Ò §	¢	¨!¡¤× 2Ò 2Ñ 4Ô 4Ñ5Ô5¸Ò;Ð;rD   c                 ó0   — |                      d¦  «         dS r  ©rL  rð  s       rB   Úsearch_KEYWORDzIMAP4Server.search_KEYWORDH  ó   € Ø�	Š	�!‰ŒˆØˆurD   c                 ór   — t          |                     d¦  «        ¦  «        |                     ¦   «         k     S rÊ   ©r—  rL  ÚgetSizerð  s       rB   Úsearch_LARGERzIMAP4Server.search_LARGERL  ó'   € Ý�5—9’9˜Q‘<”<Ñ Ô  3§;¢;¡=¤=Ò0Ð0rD   c                 óZ   — d|                      ¦   «         v od|                      ¦   «         vS )Nú\Recentú\Seenrô  rð  s       rB   Ú
search_NEWzIMAP4Server.search_NEWO  s'   € Ø˜SŸ\š\™^œ^Ð+ÐN°ÀÇÂÁÄÐ0NÐNrD   c                 ó@   — |\  }}|                       |||||¦  «         S )aÊ  
        Returns C{True} if the message does not match the query.

        @type query: A L{list} of L{str}
        @param query: A list representing the parsed form of the search query.

        @type id: L{int}
        @param id: The sequence number of the message being checked.

        @type msg: Provider of L{imap4.IMessage}
        @param msg: The message being checked.

        @type lastIDs: L{tuple}
        @param lastIDs: A tuple of (last sequence id, last message id).
        The I{last sequence id} is an L{int} containing the highest sequence
        number of a message in the mailbox.  The I{last message id} is an
        L{int} containing the highest UID of a message in the mailbox.
        ræ  )r_   r©  rè  rÉ  ÚlastIDsrá  râ  s          rB   Ú
search_NOTzIMAP4Server.search_NOTR  s-   € ð& +2Ñ'ˆ˜Ø×)Ò)¨%°°S¸.È-ÑXÔXÐXÐXrD   c                 ó.   — d|                      ¦   «         vS ©Nr,  rô  rð  s       rB   Ú
search_OLDzIMAP4Server.search_OLDh  s   € Ø §¢¡¤Ð/Ð/rD   c                 ó°   — t          |                     d¦  «        ¦  «        }t          j                             |                     ¦   «         ¦  «        |k    S rÊ   ©rþ  rL  rÿ  r   r  r  r  s        rB   Ú	search_ONzIMAP4Server.search_ONk  s@   € Ý˜Ÿš 1™œÑ&Ô&ˆÝŒ{×$Ò$ S×%8Ò%8Ñ%:Ô%:Ñ;Ô;¸tÒCÐCrD   c                 óx   — |\  }}|                       |||||¦  «        }|                       |||||¦  «        }|p|S )aâ  
        Returns C{True} if the message matches any of the first two query
        items.

        @type query: A L{list} of L{str}
        @param query: A list representing the parsed form of the search query.

        @type id: L{int}
        @param id: The sequence number of the message being checked.

        @type msg: Provider of L{imap4.IMessage}
        @param msg: The message being checked.

        @type lastIDs: L{tuple}
        @param lastIDs: A tuple of (last sequence id, last message id).
        The I{last sequence id} is an L{int} containing the highest sequence
        number of a message in the mailbox.  The I{last message id} is an
        L{int} containing the highest UID of a message in the mailbox.
        ræ  )	r_   r©  rè  rÉ  r0  rá  râ  ÚaÚbs	            rB   Ú	search_ORzIMAP4Server.search_ORo  sM   € ð( +2Ñ'ˆ˜Ø×"Ò" 5¨"¨c°>À=ÑQÔQˆØ×"Ò" 5¨"¨c°>À=ÑQÔQˆØˆv�AˆrD   c                 ó.   — d|                      ¦   «         v S r3  rô  rð  s       rB   Úsearch_RECENTzIMAP4Server.search_RECENTˆ  s   € Ø˜SŸ\š\™^œ^Ð+Ð+rD   c                 ó.   — d|                      ¦   «         v S ©Nr-  rô  rð  s       rB   Úsearch_SEENzIMAP4Server.search_SEEN‹  s   € Ø˜3Ÿ<š<™>œ>Ð)Ð)rD   c                 óà   — |                      dd¦  «                             dd¦  «        }t          j                             |¦  «        }|t          |                     d¦  «        ¦  «        k     S )aÿ  
        Returns C{True} if the message date is earlier than the query date.

        @type query: A L{list} of L{str}
        @param query: A list whose first element starts with a stringified date
            that is a fragment of an L{imap4.Query()}. The date must be in the
            format 'DD-Mon-YYYY', for example '03-March-2003' or '03-Mar-2003'.

        @type id: L{int}
        @param id: The sequence number of the message being checked.

        @type msg: Provider of L{imap4.IMessage}
        Fr½  rø  r   ©rú  rû  rÿ  r   r  rþ  rL  r  s        rB   Úsearch_SENTBEFOREzIMAP4Server.search_SENTBEFOREŽ  sY   € ð �~Š~˜e VÑ,Ô,×0Ò0°¸Ñ<Ô<ˆÝŒ{×$Ò$ TÑ*Ô*ˆØ•i §	¢	¨!¡¤Ñ-Ô-Ò-Ð-rD   c                 ó   — |                      dd¦  «                             dd¦  «        }t          j                             |¦  «        }|dd…         t          |                     d¦  «        ¦  «        dd…         k    S )aŸ  
        Returns C{True} if the message date is the same as the query date.

        @type query: A L{list} of L{str}
        @param query: A list whose first element starts with a stringified date
            that is a fragment of an L{imap4.Query()}. The date must be in the
            format 'DD-Mon-YYYY', for example '03-March-2003' or '03-Mar-2003'.

        @type msg: Provider of L{imap4.IMessage}
        Fr½  rø  NrX  r   rB  r  s        rB   Úsearch_SENTONzIMAP4Server.search_SENTON   sj   € ð �~Š~˜e VÑ,Ô,×0Ò0°¸Ñ<Ô<ˆÝŒ{×$Ò$ TÑ*Ô*ˆØ�B�Q�BŒx�9 U§Y¢Y¨q¡\¤\Ñ2Ô2°2°A°2Ô6Ò6Ð6rD   c                 óà   — |                      dd¦  «                             dd¦  «        }t          j                             |¦  «        }|t          |                     d¦  «        ¦  «        k    S )až  
        Returns C{True} if the message date is later than the query date.

        @type query: A L{list} of L{str}
        @param query: A list whose first element starts with a stringified date
            that is a fragment of an L{imap4.Query()}. The date must be in the
            format 'DD-Mon-YYYY', for example '03-March-2003' or '03-Mar-2003'.

        @type msg: Provider of L{imap4.IMessage}
        Fr½  rø  r   rB  r  s        rB   Úsearch_SENTSINCEzIMAP4Server.search_SENTSINCE¯  sY   € ð �~Š~˜e VÑ,Ô,×0Ò0°¸Ñ<Ô<ˆÝŒ{×$Ò$ TÑ*Ô*ˆØ•i §	¢	¨!¡¤Ñ-Ô-Ò-Ð-rD   c                 ó°   — t          |                     d¦  «        ¦  «        }t          j                             |                     ¦   «         ¦  «        |k    S rÊ   r6  r  s        rB   Úsearch_SINCEzIMAP4Server.search_SINCE¾  s@   € Ý˜Ÿš 1™œÑ&Ô&ˆÝŒ{×$Ò$ S×%8Ò%8Ñ%:Ô%:Ñ;Ô;¸dÒBÐBrD   c                 ór   — t          |                     d¦  «        ¦  «        |                     ¦   «         k    S rÊ   r'  rð  s       rB   Úsearch_SMALLERzIMAP4Server.search_SMALLERÂ  r*  rD   c                 óö   — |                      dd¦  «                             dd¦  «        }|                     ¦   «                              |                     d¦  «                             ¦   «         ¦  «        dk    S )NFÚsubjectrø  r   r   rù  )r_   r©  rè  rÉ  Úsubjs        rB   Úsearch_SUBJECTzIMAP4Server.search_SUBJECTÅ  s\   € Ø�~Š~˜e YÑ/Ô/×3Ò3°I¸rÑBÔBˆØ�zŠz‰|Œ|× Ò  §¢¨1¡¤×!3Ò!3Ñ!5Ô!5Ñ6Ô6¸"Ò<Ð<rD   c                 ó    — |                      d¦  «                             ¦   «         }t          j        ||                     ¦   «         d¦  «        S r  r  r
  s        rB   Úsearch_TEXTzIMAP4Server.search_TEXTÉ  s;   € à�yŠy˜‰|Œ|×!Ò!Ñ#Ô#ˆÝŒ|˜D #§/¢/Ñ"3Ô"3°UÑ;Ô;Ð;rD   c                 óö   — |                      dd¦  «                             dd¦  «        }|                     ¦   «                              |                     d¦  «                             ¦   «         ¦  «        dk    S )NFÚtorø  r   r   rù  )r_   r©  rè  rÉ  rS  s        rB   Ú	search_TOzIMAP4Server.search_TOÎ  r  rD   c                 ó‚   — |\  }}|                      d¦  «        }t          ||¦  «        }|                     ¦   «         |v S )al  
        Returns C{True} if the message UID is in the range defined by the
        search query.

        @type query: A L{list} of L{bytes}
        @param query: A list representing the parsed form of the search
            query. Its first element should be a L{str} that can be interpreted
            as a sequence range, for example '2:4,5:*'.

        @type id: L{int}
        @param id: The sequence number of the message being checked.

        @type msg: Provider of L{imap4.IMessage}
        @param msg: The message being checked.

        @type lastIDs: L{tuple}
        @param lastIDs: A tuple of (last sequence id, last message id).
        The I{last sequence id} is an L{int} containing the highest sequence
        number of a message in the mailbox.  The I{last message id} is an
        L{int} containing the highest UID of a message in the mailbox.
        r   )rL  r¬  rÒ  )	r_   r©  rè  rÉ  r0  rá  râ  rÞ  rž  s	            rB   Ú
search_UIDzIMAP4Server.search_UIDÒ  s?   € ð, +2Ñ'ˆ˜Ø�IŠI�a‰LŒLˆÝ˜˜=Ñ)Ô)ˆØ�zŠz‰|Œ|˜qÐ Ð rD   c                 ó.   — d|                      ¦   «         vS )Nró  rô  rð  s       rB   Úsearch_UNANSWEREDzIMAP4Server.search_UNANSWEREDí  s   € Ø 3§<¢<¡>¤>Ð1Ð1rD   c                 ó.   — d|                      ¦   «         vS r  rô  rð  s       rB   Úsearch_UNDELETEDzIMAP4Server.search_UNDELETEDð  ó   € Ø #§,¢,¡.¤.Ð0Ð0rD   c                 ó.   — d|                      ¦   «         vS r  rô  rð  s       rB   Úsearch_UNDRAFTzIMAP4Server.search_UNDRAFTó  s   € Ø §¢¡¤Ð.Ð.rD   c                 ó.   — d|                      ¦   «         vS r  rô  rð  s       rB   Úsearch_UNFLAGGEDzIMAP4Server.search_UNFLAGGEDö  r[  rD   c                 ó0   — |                      d¦  «         dS r  r#  rð  s       rB   Úsearch_UNKEYWORDzIMAP4Server.search_UNKEYWORDù  r%  rD   c                 ó.   — d|                      ¦   «         vS r?  rô  rð  s       rB   Úsearch_UNSEENzIMAP4Server.search_UNSEENý  s   € Ø˜sŸ|š|™~œ~Ð-Ð-rD   c           	      óž   — |                       |dt          t          |j        ¦  «        ¦  «        z   ¦  «         t	          j        |¦  «         d S )Ns   SEARCH failed: rÁ  r}  s      rB   Ú
__ebSearchzIMAP4Server.__ebSearch   sO   € Ø×ÒØÐ#¥mµC¸¼Ñ4FÔ4FÑ&GÔ&GÑGñ	
ô 	
ð 	
õ 	Œ�ÑÔÐÐÐrD   c                 ó>  — |r„|                       d ¦  «        | _        t          | j        j        ||¬¦  «                             t          ¦  «                             | j        |||¦  «                             | j	        |¦  «         d S |  
                    |d¦  «         d S )NrÄ  s   FETCH complete)r/  Ú_oldTimeoutr   r;  rÈ  rp  ÚiterÚ_IMAP4Server__cbFetchr?  Ú_IMAP4Server__ebFetchrÇ  )r_   r÷   Úmessagesr©  ri  s        rB   Údo_FETCHzIMAP4Server.do_FETCH  sŸ   € Øð 	>Ø#Ÿš¨tÑ4Ô4ˆDÔÝ˜$œ)œ/¨8¸Ð=Ñ=Ô=×IÒIÝñô çŠk˜$œ.¨#¨u°cÑ:Ô:¿:º:Ø” ñ<ô <ð <ð <ð <ð ×%Ò% cÐ+<Ñ=Ô=Ð=Ð=Ð=rD   c                 ó”  ‡ ‡‡‡‡— ‰ j         €g ‰ _         	 t          ‰¦  «        \  }}‰                      ||‰‰¦  «                             ˆˆˆ ˆˆfd„¦  «                             ‰ j        ¦  «         d S # t          $ rJ ‰                      ‰ j        ¦  «         ‰ `‰  	                    ‰d¦  «         ‰  
                    ¦   «          Y d S w xY w)Nc                 ó4   •— ‰                      ‰‰‰‰¦  «        S rv   )ri  )rm  r©  Úresultsr_   r÷   ri  s    €€€€€rB   rV   z'IMAP4Server.__cbFetch.<locals>.<lambda>2  s   ø€ ˜$Ÿ.š.¨°#°u¸cÑBÔB€ rD   s   FETCH completed)rJ  ÚnextÚspewMessagerp  r?  Ú_IMAP4Server__ebSpewMessageÚStopIterationr/  rg  rÇ  rN  )r_   ro  r÷   r©  ri  rè  rÉ  s   `````  rB   Ú	__cbFetchzIMAP4Server.__cbFetch  sì   øøøøø€ ØŒ<ÐØˆDŒLð	/Ý˜7‘m”m‰GˆB�ð4 ×Ò˜R  e¨SÑ1Ô1×=Ò=ØBÐBÐBÐBÐBÐBÐBÐBñô çŠj˜Ô-Ñ.Ô.Ð.Ð.Ð.øõ7 ð 	ð 	ð 	ð �OŠO˜DÔ,Ñ-Ô-Ð-ØÐ ð ×%Ò% cÐ+=Ñ>Ô>Ð>ð
 �MŠM‰OŒOˆOˆOˆOˆOð/	øøøs   •A3 Á3ACÃCc                 ó`   — t          j        |¦  «         | j                             ¦   «          d S rv   )r5   r@  rÌ   r:  ©r_   r~  s     rB   Ú__ebSpewMessagezIMAP4Server.__ebSpewMessage5  s.   € õ
 	Œ�ÑÔÐØŒ×%Ò%Ñ'Ô'Ð'Ð'Ð'rD   c                 ót   — |€| j         j        } |dt          t          |¦  «        g¦  «        z   ¦  «         d S )Ns	   ENVELOPE )rÌ   r¶   r#  ÚgetEnvelope©r_   rè  rÉ  Ú_wÚ_fs        rB   Úspew_envelopezIMAP4Server.spew_envelope=  s@   € Øˆ:Ø”Ô%ˆBØ
ˆˆ<Õ-­{¸3Ñ/?Ô/?Ð.@ÑAÔAÑAÑBÔBÐBÐBÐBrD   c                 ó¦   — |€| j         j        }d„ |                     ¦   «         D ¦   «         } |dd                     |¦  «        z   dz   ¦  «         d S )Nc                 ó,   — g | ]}t          |¦  «        ‘ŒS r>   r9  r:  s     rB   rJ   z*IMAP4Server.spew_flags.<locals>.<listcomp>E  s    € ÐGÐGÐG°� dÑ+Ô+ÐGÐGÐGrD   r>  rõ   r¢  )rÌ   Úwritenr@  r—   )r_   rè  rÉ  r{  r|  ÚencodedFlagss         rB   Ú
spew_flagszIMAP4Server.spew_flagsB  sY   € Øˆ:Ø”Ô&ˆBØGÐG¸¿º¹¼ÐGÑGÔGˆØ
ˆÐ˜dŸiši¨Ñ5Ô5Ñ5¸Ñ<Ñ=Ô=Ð=Ð=Ð=rD   c                 óp  — |€| j         j        }|                     ¦   «         }t          j                             t          |¦  «        ¦  «        }|€)t          j        d|||fz  ¦  «         t          d¦  «        ‚t          j        d|d d…         ¦  «        }t          |t          |d                  fz  ¦  «        }|d         €|dz   }nR|d         dk    rd}	nd	}	||	z   d
t          |d         ¦  «        dz  dz  t          |d         ¦  «        dz  dz  z   fz  z   } |dt          |¦  «        z   ¦  «         d S )Nz$%d:%r: unpareseable internaldate: %rz(Internal failure generating INTERNALDATEz%d-%%s-%Y %H:%M:%S é	   r;   s   +0000r   r×  ó   -s   %04di  éd   r  s   INTERNALDATE )rÌ   r¶   r  rÿ  r   Úparsedate_tzr9   r5   rÉ  r   ÚtimeÚstrftimer:   Ú_MONTH_NAMESÚabsÚ_quote)
r_   rè  rÉ  r{  r|  ÚidateÚttupÚstrdateÚodateÚsigns
             rB   Úspew_internaldatezIMAP4Server.spew_internaldateH  sN  € Øˆ:Ø”Ô%ˆBØ×#Ò#Ñ%Ô%ˆÝŒ{×'Ò'­°UÑ(;Ô(;Ñ<Ô<ˆØˆ<ÝŒGÐ:¸bÀ#ÀuÐ=MÑMÑNÔNÐNÝ Ð!KÑLÔLÐLõ ”-Ð 5°t¸B¸Q¸B´xÑ@Ô@ˆÝ˜g­°d¸1´gÔ)>Ð(@Ñ@ÑAÔAˆØ�Œ7ˆ?Ø˜HÑ$ˆEˆEà�AŒw˜!Š|ˆ|Ø��à�àØñàÝ˜˜Qœ‘L”L DÑ(¨CÑ/µ3°t¸A´w±<´<À$Ñ3FÈ2Ñ2MÑMÐOñPñPð ð 	ˆÐ�f U™mœmÑ+Ñ,Ô,Ð,Ð,Ð,rD   c                 óœ   — |€| j         j        }t          |                     d¦  «        ¦  «        } |dt	          |¦  «        z   ¦  «         d S )NTs   RFC822.HEADER )rÌ   r¶   Ú_formatHeadersrú  Ú_literal)r_   rè  rÉ  r{  r|  Úhdrss         rB   Úspew_rfc822headerzIMAP4Server.spew_rfc822headerc  sL   € Øˆ:Ø”Ô%ˆBÝ˜cŸnšn¨TÑ2Ô2Ñ3Ô3ˆØ
ˆÐ�x¨™~œ~Ñ-Ñ.Ô.Ð.Ð.Ð.rD   c                 óº   — |€| j         j        } |d¦  «          |¦   «          t          |                     ¦   «         ¦  «                             | j         ¦  «        S )Ns   RFC822.TEXT )rÌ   r¶   ÚFileProducerr	  ÚbeginProducingrz  s        rB   Úspew_rfc822textzIMAP4Server.spew_rfc822texti  sT   € Øˆ:Ø”Ô%ˆBØ
ˆˆ?ÑÔÐØ
ˆ‰ŒˆÝ˜CŸOšOÑ-Ô-Ñ.Ô.×=Ò=¸d¼nÑMÔMÐMrD   c                 ód   — |€| j         j        } |d|                     ¦   «         fz  ¦  «         d S )Ns   RFC822.SIZE %d)rÌ   r¶   r(  rz  s        rB   Úspew_rfc822sizezIMAP4Server.spew_rfc822sizep  s8   € Øˆ:Ø”Ô%ˆBØ
ˆÐ §¢¡¤Ð/Ñ/Ñ0Ô0Ð0Ð0Ð0rD   c                 ó:  — |€| j         j        } |d¦  «          |¦   «          t          |d ¦  «        }|�9t          |                     ¦   «         ¦  «                             | j         ¦  «        S t          |d | j        ¦  «                             | j         ¦  «        S )Ns   RFC822 )rÌ   r¶   ÚIMessageFiler™  Úopenrš  ÚMessageProducerr  )r_   rè  rÉ  r{  r|  Úmfs         rB   Úspew_rfc822zIMAP4Server.spew_rfc822u  sŽ   € Øˆ:Ø”Ô%ˆBØ
ˆˆ:‰ŒˆØ
ˆ‰ŒˆÝ˜#˜tÑ$Ô$ˆØˆ>Ý §¢¡	¤	Ñ*Ô*×9Ò9¸$¼.ÑIÔIÐIÝ˜s D¨$¬/Ñ:Ô:×IÒIØŒNñ
ô 
ð 	
rD   c                 ód   — |€| j         j        } |d|                     ¦   «         fz  ¦  «         d S )Ns   UID %d)rÌ   r¶   rÒ  rz  s        rB   Úspew_uidzIMAP4Server.spew_uid�  s6   € Øˆ:Ø”Ô%ˆBØ
ˆˆ9˜Ÿ
š
™œ�Ñ&Ñ'Ô'Ð'Ð'Ð'rD   c           	      óZ   —  |dt          t          |d¦  «        g¦  «        z   ¦  «         d S )Ns   BODYSTRUCTURE T)r#  ÚgetBodyStructurerz  s        rB   Úspew_bodystructurezIMAP4Server.spew_bodystructure†  s5   € Ø
ˆÐÕ2Õ4DÀSÈ$Ñ4OÔ4OÐ3PÑQÔQÑQÑRÔRÐRÐRÐRrD   c                 ó8  — |€| j         j        }|j        D ]A}|                     ¦   «         r|                     |¦  «        }Œ,|dk    rt          d¦  «        ‚ŒB|j        rc |j        |j        j        g|j        j	        ¢R Ž }t          |¦  «        } ||                     ¦   «         dz   t          |¦  «        z   ¦  «         d S |j        rc ||                     ¦   «         dz   ¦  «          |¦   «          t          |                     ¦   «         ¦  «                             | j         ¦  «        S |j        rTt          |                     d¦  «        ¦  «        } ||                     ¦   «         dz   t          |¦  «        z   ¦  «         d S |j        rã ||                     ¦   «         dz   ¦  «          |¦   «          |j        r9t          |                     ¦   «         ¦  «                             | j         ¦  «        S t'          |d ¦  «        }|�9t          |                     ¦   «         ¦  «                             | j         ¦  «        S t+          |d | j        ¦  «                             | j         ¦  «        S  |dt/          t1          |¦  «        g¦  «        z   ¦  «         d S )Nr   z*Requested subpart of non-multipart messagerõ   Ts   BODY )rÌ   r¶   ÚpartÚisMultipartÚ
getSubPartrw   Úheaderrú  ÚnegateÚfieldsr”  Ú	__bytes__r•  r6   r™  r	  rš  ÚmimeÚemptyrŸ  r   r¡  r  r#  r§  )	r_   rª  rè  rÉ  r{  r|  r˜   r–  r¢  s	            rB   Ú	spew_bodyzIMAP4Server.spew_body‰  s…  € Øˆ:Ø”Ô%ˆBØ”ð 	Nð 	NˆAØ�ŠÑ Ô ð NØ—n’n QÑ'Ô'��Ø�Q’�õ  Ð LÑMÔMÐMð ð
 Œ;ð 	HØ!�3”> $¤+Ô"4ÐJ°t´{Ô7IÐJÐJÐJˆDÝ! $Ñ'Ô'ˆDØˆBˆt�~Š~ÑÔ $Ñ&­°$©¬Ñ7Ñ8Ô8Ð8Ð8Ð8ØŒYð 	HØˆBˆt�~Š~ÑÔ $Ñ&Ñ'Ô'Ð'ØˆB‰DŒDˆDÝ §¢Ñ 1Ô 1Ñ2Ô2×AÒAÀ$Ä.ÑQÔQÐQØŒYð 	HÝ! #§.¢.°Ñ"6Ô"6Ñ7Ô7ˆDØˆBˆt�~Š~ÑÔ $Ñ&­°$©¬Ñ7Ñ8Ô8Ð8Ð8Ð8ØŒZð 	HØˆBˆt�~Š~ÑÔ $Ñ&Ñ'Ô'Ð'ØˆB‰DŒDˆDØŒyð Ý# C§O¢OÑ$5Ô$5Ñ6Ô6×EÒEÀdÄnÑUÔUÐUå! # tÑ,Ô,�Ø�>Ý'¨¯ª©	¬	Ñ2Ô2×AÒAÀ$Ä.ÑQÔQÐQÝ& s¨D°$´/ÑBÔB×QÒQØ”Nñô ð ð
 ˆBˆxÕ-Õ/?ÀÑ/DÔ/DÐ.EÑFÔFÑFÑGÔGÐGÐGÐGrD   c           
      óÐ   ‡ ‡‡‡‡‡‡‡	‡
‡— t          ‰ j        ¦  «        }|j        Š|j        Šˆˆfd„Š
ˆfd„Šˆfd„Š	ˆˆˆˆˆˆ ˆ	ˆ
ˆˆf
d„}‰                       |¦   «         ¦  «        S )Nc                  ó&   •—  ‰d‰ fz  ¦  «         d S )Ns   * %d FETCH (r>   )rè  r¶   s   €€rB   r`   z&IMAP4Server.spewMessage.<locals>.start´  s    ø€ ØˆE�/ R EÑ)Ñ*Ô*Ð*Ð*Ð*rD   c                  ó   •—  ‰ d¦  «         d S )Ns   )
r>   ©r¶   s   €rB   r  z'IMAP4Server.spewMessage.<locals>.finish·  s   ø€ ØˆE�(‰OŒOˆOˆOˆOrD   c                  ó   •—  ‰ d¦  «         d S rô   r>   r·  s   €rB   Úspacez&IMAP4Server.spewMessage.<locals>.spaceº  s   ø€ ØˆE�$‰KŒKˆKˆKˆKrD   c               3   ó†  •
K  — d}  ‰
¦   «          ‰D ]r}|j         dk    rd} |j         dk    r‰                     |‰‰‰‰¦  «        V — n(t          ‰d|j         z   ¦  «        } |‰‰‰‰¦  «        V — |‰d         ur
 ‰	¦   «          Œs‰r&| s$ ‰	¦   «          ‰                     ‰‰‰‰¦  «        V —  ‰¦   «           ‰¦   «          d S )NFri  Tr  Úspew_r   )Útyper³  rQ  r¥  )ÚseenUIDrª  rU  r  rÐ   rè  rÉ  r©  r_   r¹  r`   ri  r¶   s      €€€€€€€€€€rB   Úspewz%IMAP4Server.spewMessage.<locals>.spew½  s  øè è € ØˆGØˆE‰GŒGˆGØð 	ð 	�Ø”9 Ò%Ð%Ø"�GØ”9 Ò&Ð&ØŸ.š.¨¨r°3¸¸uÑEÔEÐEÐEÐEÐEå  g°´	Ñ&9Ñ:Ô:�AØ˜!˜B  U¨EÑ2Ô2Ð2Ð2Ð2Ø˜u RœyÐ(Ð(Ø�E‘G”G�GøØð ;˜7ð ;Ø�‘”�Ø—m’m B¨¨U°EÑ:Ô:Ð:Ð:Ð:ØˆF‰HŒHˆHØˆE‰GŒGˆGˆGˆGrD   )rÇ   rÌ   r¶   rÐ   r  )r_   rè  rÉ  r©  ri  Úwbufr¾  r  rÐ   r¹  r`   r¶   s   `````  @@@@@rB   rq  zIMAP4Server.spewMessage¯  sÙ   øøøøøøøøøø€ Ý˜4œ>Ñ*Ô*ˆØ”
ˆØ”
ˆð	+ð 	+ð 	+ð 	+ð 	+ð 	+ð	ð 	ð 	ð 	ð 	ð	ð 	ð 	ð 	ð 	ð	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð& �Š˜t˜t™vœvÑ&Ô&Ð&rD   c           	      óÖ   — |                       | j        ¦  «         | `t          j        |¦  «         |                      |dt          t          |j        ¦  «        ¦  «        z   ¦  «         d S )Ns   FETCH failed: )r/  rg  r5   r@  r]  r:   r–   ri   r}  s      rB   Ú	__ebFetchzIMAP4Server.__ebFetchÒ  sa   € Ø�Š˜Ô(Ñ)Ô)Ð)ØÐÝŒ�ÑÔÐØ×Ò˜SÐ"3µmÅCÈÌÑDVÔDVÑ6WÔ6WÑ"WÑXÔXÐXÐXÐXrD   c                 óh  — |                      ¦   «         }|                     d¦  «        }|                     d¦  «        rd}n|                     d¦  «        rd}nd}d„ |D ¦   «         }t          | j        j        ||||¬¦  «                             | j        | j        || j        ||fd |fd ¦  «         d S )	Ns   SILENTr×  r;   r…  r   r   c                 ó,   — g | ]}t          |¦  «        ‘ŒS r>   r˜  r:  s     rB   rJ   z(IMAP4Server.do_STORE.<locals>.<listcomp>â  s    € Ð6Ð6Ð6¨•˜dÑ#Ô#Ð6Ð6Ð6rD   rÄ  )	r^  Úendswithrº  r   r;  Ústorerü  Ú_IMAP4Server__cbStoreÚ_IMAP4Server__ebStore)r_   r÷   rk  Úmoderµ  ri  Úsilents          rB   Údo_STOREzIMAP4Server.do_STOREØ  sÊ   € Ø�zŠz‰|Œ|ˆØ—’˜yÑ)Ô)ˆØ�?Š?˜4Ñ Ô ð 	ØˆDˆDØ�_Š_˜TÑ"Ô"ð 	ØˆDˆDàˆDà6Ð6°Ð6Ñ6Ô6ˆÝ�d”i”o x°¸À#ÐFÑFÔF×SÒSØŒNØŒNØ�$”)˜S &Ð)ØØˆFØñ	
ô 	
ð 	
ð 	
ð 	
rD   c                 ó  — |rt|sr|                      ¦   «         D ]]\  }}|rd|                     |¦  «        fz  }nd}d„ |D ¦   «         }	|                      d|d                     |	¦  «        |fz  ¦  «         Œ^|                      |d¦  «         d S )Ns    UID %drD   c                 ó,   — g | ]}t          |¦  «        ‘ŒS r>   r9  r:  s     rB   rJ   z)IMAP4Server.__cbStore.<locals>.<listcomp>ö  s    € Ð;Ð;Ð;°� tÑ,Ô,Ð;Ð;Ð;rD   s   %d FETCH (FLAGS (%b)%b)rõ   s   STORE completed)rß  rÒ  rT  r—   rÇ  )
r_   rx  r÷   r;  ri  rÉ  Úkrá  Úuidstrrµ  s
             rB   Ú	__cbStorezIMAP4Server.__cbStoreî  s¼   € Øð 
	˜&ð 
	ØŸš™œð 	ð 	‘��1Øð !Ø'¨4¯;ª;°q©>¬>Ð*;Ñ;�F�Fà �Fà;Ð;¸Ð;Ñ;Ô;�Ø×)Ò)Ø.°!°T·Y²Y¸uÑ5EÔ5EÀvÐ1NÑNñô ð ð ð 	×!Ò! #Ð'9Ñ:Ô:Ð:Ð:Ð:rD   c           	      óv   — |                       |dt          t          |j        ¦  «        ¦  «        z   ¦  «         d S ©Nr{  r�  r}  s      rB   Ú	__ebStorezIMAP4Server.__ebStoreü  r®  rD   c                 óÂ   — t          |¦  «        }t          | j        j        |¦  «                             | j        ||||¦  «                             | j        |¦  «         d S rv   )r*  r   r  r+  rp  Ú_cbCopySelectedMailboxr?  Ú_ebCopySelectedMailbox)r_   r÷   rk  r}  ri  s        rB   Údo_COPYzIMAP4Server.do_COPYÿ  sZ   € Ý˜WÑ%Ô%ˆÝ�d”lÔ)¨7Ñ3Ô3×?Ò?ØÔ'¨¨h¸Àñ	
ô 	
ç
Š*�TÔ0°#Ñ
6Ô
6Ð
6Ð
6Ð
6rD   c                 ó  — |s|                       |d|z   ¦  «         d S t          | j        j        ||¦  «                             | j        ||¦  «                             | j        ||¦  «                             | j        |¦  «         d S )NzNo such mailbox: )	r`  r   r;  rÈ  rp  Ú_IMAP4Server__cbCopyÚ_IMAP4Server__cbCopiedr?  Ú_IMAP4Server__ebCopy)r_   r;  r÷   rk  r}  ri  s         rB   rÔ  z"IMAP4Server._cbCopySelectedMailbox	  s†   € Øð 	UØ×%Ò% cÐ+>ÀÑ+HÑIÔIÐIÐIÐIå˜$œ)œ/¨8°SÑ9Ô9×EÒEØ”˜s Dñô çŠk˜$œ/¨3°Ñ5Ô5·j²jÀÄÐPSÑ6TÔ6TÐ6TÐ6TÐ6TrD   c           	      óv   — |                       |dt          t          |j        ¦  «        ¦  «        z   ¦  «         d S rÑ  r�  r}  s      rB   rÕ  z"IMAP4Server._ebCopySelectedMailbox	  r®  rD   c                 ój  ‡‡— g }t          ‰d ¦  «        }|D �]\  }}|�+t          |j        |¦  «        }|                     |¦  «         Œ3|                     ¦   «         }	|                     ¦   «         }
t          |d ¦  «        }|�,|                     ¦   «         }t          ‰j        ||	|
¦  «        }nZd„ Št          j
        ¦   «         }t          ||| j        ¦  «                             d ¦  «                             ||	|
fˆˆfd„	¦  «        }|                     |¦  «         �Œ
t          j        |¦  «        S )Nc                 ó0   — |                       d¦  «         | S rÊ   )rÅ   ©rU  s    rB   Úrewindz$IMAP4Server.__cbCopy.<locals>.rewind)	  s   € Ø—F’F˜1‘I”I�IØ�HrD   c                 óD   •— ‰                       ‰|¦  «        ||¦  «        S rv   )r™  )rm  r:  rU  r  r;  rß  s       €€rB   rV   z&IMAP4Server.__cbCopy.<locals>.<lambda>2	  s$   ø€ ¸T¿_º_Ø"˜F 1™IœI q¨!ñ>ô >€ rD   )ÚIMessageCopierr   r  rt   r@  r  rŸ  r   r™  rÁ   rÂ   r¡  r  rš  rp  r   ÚDeferredList)r_   rk  r÷   r;  ÚaddedDeferredsÚfastCopyMboxrè  rÉ  r  rµ  r½  r  ÚbodyFileÚbufferrß  s      `          @rB   Ú__cbCopyzIMAP4Server.__cbCopy	  sS  øø€ àˆå% d¨DÑ1Ô1ˆØð  	%ñ  	%‰GˆB�ØÐ'Ý! ,Ô"3°SÑ9Ô9�Ø×%Ò% aÑ(Ô(Ð(Øð
 —L’L‘N”NˆEØ×&Ò&Ñ(Ô(ˆDå  TÑ*Ô*ˆDØÐØŸ9š9™;œ;�Ý! $¤/°8¸UÀDÑIÔI��ðð ð õ "Ô/Ñ1Ô1�å# C¨°´ÑAÔAß#’^ DÑ)Ô)ß ’[Ø$*¨e°tð ð ð ð ð ð ñô ð ð ×!Ò! !Ñ$Ô$Ð$Ñ$ÝÔ! .Ñ1Ô1Ð1rD   c                 óâ   — g }g }|D ]7\  }}|r|                      |¦  «         Œ|                      |j        ¦  «         Œ8|r|                      |d¦  «         d S |                      |d¦  «         d S )Nz%[ALERT] Some messages were not copieds   COPY completed)rt   ri   r`  rÇ  )r_   ÚdeferredIdsr÷   r;  rÓ  Úfailuresr�  rx  s           rB   Ú
__cbCopiedzIMAP4Server.__cbCopied:	  s•   € ØˆØˆØ)ð 	.ð 	.‰NˆF�FØð .Ø—
’
˜6Ñ"Ô"Ð"Ð"à—’ ¤Ñ-Ô-Ð-Ð-Øð 	>Ø×%Ò% cÐ+RÑSÔSÐSÐSÐSà×%Ò% cÐ+<Ñ=Ô=Ð=Ð=Ð=rD   c           	      óž   — |                       |dt          t          |j        ¦  «        ¦  «        z   ¦  «         t	          j        |¦  «         d S )Ns   COPY failed:rÁ  r}  s      rB   Ú__ebCopyzIMAP4Server.__ebCopyG	  sE   € Ø×Ò˜S /µMÅ#ÀgÄmÑBTÔBTÑ4UÔ4UÑ"UÑVÔVÐVÝŒ�ÑÔÐÐÐrD   c                 ó†   — |                      ¦   «         }|dvrt          |¦  «        ‚|                      |||d¬¦  «         d S )N)ó   COPYrà   ó   STORErÜ   r;   rÄ  )r^  r   r_  )r_   r÷   rí   r»   s       rB   Údo_UIDzIMAP4Server.do_UIDK	  sL   € Ø—-’-‘/”/ˆàÐBÐBÐBÝ'¨Ñ0Ô0Ð0à×Ò˜S '¨4°QÐÑ7Ô7Ð7Ð7Ð7rD   c                 ój   — |r|                       dd¬¦  «         d S |                       dd¬¦  «         d S )Ns   [READ-WRITE]T)rÄ  rÔ  s   [READ-ONLY]©rT  ©r_   Ú	writeables     rB   ÚmodeChangedzIMAP4Server.modeChangedX	  sI   € Øð 	LØ×%Ò%¨oÀtÐ%ÑLÔLÐLÐLÐLà×%Ò%¨nÀdÐ%ÑKÔKÐKÐKÐKrD   c                 ó´   — |                      ¦   «         D ]B\  }}d„ |D ¦   «         }d|d                     |¦  «        fz  }|                      |d¬¦  «         ŒCd S )Nc                 ó,   — g | ]}t          |¦  «        ‘ŒS r>   r9  r:  s     rB   rJ   z,IMAP4Server.flagsChanged.<locals>.<listcomp>`	  s    € ÐBÐBÐB°D�M¨$Ñ/Ô/ÐBÐBÐBrD   s   %d FETCH (FLAGS (%b))rõ   T©rÔ  )rß  r—   rT  )r_   ÚnewFlagsÚmIdrµ  r�  rÉ  s         rB   ÚflagsChangedzIMAP4Server.flagsChanged^	  ss   € Ø"Ÿ.š.Ñ*Ô*ð 	9ð 	9‰JˆC�ØBÐB¸EÐBÑBÔBˆLØ*¨c°4·9²9¸\Ñ3JÔ3JÐ-KÑKˆCØ×%Ò% c°4Ð%Ñ8Ô8Ð8Ð8ð	9ð 	9rD   c                 ó~   — |�|                       d|fz  d¬¦  «         |�|                       d|fz  d¬¦  «         d S d S )Nr<  Trù  r=  ró  ©r_   ÚexistsÚrecents      rB   ÚnewMessageszIMAP4Server.newMessagesd	  s\   € ØÐØ×%Ò% l°f°YÑ&>ÈÐ%ÑMÔMÐMØÐØ×%Ò% l°f°YÑ&>ÈÐ%ÑMÔMÐMÐMÐMð ÐrD   ©NNNrv   ©F©NrD   )rÕ  ©r   r�  )çr¢   r£   r¤   r¥   rÆ  r0  r  r(  r'  r-  rí  r  r4  r;  rF  r‚  r  rì  rA  rR  rb   r+  r2  r6  rC  rH  rJ  rN  rK  rc  re  r_  rg  rh  rq  rr  r‡  r‰  r�  rŒ  ÚreÚcompileÚescapeÚ
_atomCharsr›  rŸ  r¥  r§  rª  r­  r±  r¶  r¸  r»  r¾  rÁ  r1  r]  rÇ  r`  rT  r„  rÍ  rÅ  rã  Úunauth_CAPABILITYÚauth_CAPABILITYÚselect_CAPABILITYÚlogout_CAPABILITYrå  Úunauth_LOGOUTÚauth_LOGOUTÚselect_LOGOUTÚlogout_LOGOUTrè  Úunauth_NOOPÚ	auth_NOOPÚselect_NOOPÚlogout_NOOPrë  Úunauth_AUTHENTICATErê  rî  rñ  rý  rþ  rò  r  Úunauth_STARTTLSr  Úunauth_LOGINr  r  r  r(  Úauth_NAMESPACEÚselect_NAMESPACEr1  r-  r,  Úauth_SELECTÚselect_SELECTÚauth_EXAMINEÚselect_EXAMINErL  rN  Úselect_IDLEÚ	auth_IDLErR  Úauth_CREATEÚselect_CREATErY  Úauth_DELETEÚselect_DELETEr`  Úauth_RENAMEÚselect_RENAMErc  Úauth_SUBSCRIBEÚselect_SUBSCRIBErg  Úauth_UNSUBSCRIBEÚselect_UNSUBSCRIBErn  rj  rk  Ú	auth_LISTÚselect_LISTÚ	auth_LSUBÚselect_LSUBr  r{  r|  Úauth_STATUSÚselect_STATUSr‚  rƒ  r•  r“  r”  Úauth_APPENDÚselect_APPENDrš  r›  r¨  Úselect_CHECKr¦  r§  r¥  rµ  Úselect_CLOSEr³  r´  r½  Úselect_EXPUNGEr»  r¼  rÌ  Úselect_SEARCHrÆ  rÉ  rÜ  rç  rñ  rõ  rü  r  r  r  r  r  r  r  r!  r$  r)  r.  r1  r4  r7  r;  r=  r@  rC  rE  rG  rI  rK  rO  rQ  rT  rV  rX  rZ  r]  r_  ra  rc  rÇ  rl  Úselect_FETCHri  rr  r}  r‚  r’  r—  r›  r�  r£  r¥  r¨  r³  rq  rj  rÊ  Úselect_STORErÆ  rÇ  rÖ  Úselect_COPYrÔ  rÕ  rØ  rÙ  rÚ  rñ  Ú
select_UIDrö  rü  r  r>   rD   rB   r  r  T  s•  € € € € € ðð ð '€Eð €GàÐð €Jð €Kð €Dð €Fð €Gð €Ið €Dð €Oð Ðð €Kð  7Ð6Ð6Ðà€Eà€Jðð ð ð ðð ð ð"ð "ð "ð"ð "ð "ð	ð 	ð 	ð%ð %ð %ð €Gð*ð *ð *ðð ð ðð ð ð:ð ð ð>ð >ð >ð >ðVð Vð Vðð ð ð(>ð >ð >ð
ð ð ð&ð ð ðð ð ð2ð 2ð 2ð$, ð , ð , ð , ð^ ˆRŒZØ˜	˜œ	 *Ñ-Ô-Ñ-Ð0HÑHñô €Fð
:ð 
:ð 
:ð@ð @ð @ð"'ð 'ð 'ð(ð ð ðHð Hð Hðð ð ðð ð ð0ð ð ð ð  ð  ð ð  ð  ð ð  ð  ð/ð /ð /ð,ð ,ð ,ð ,ð+ð +ð +ð +ð+ð +ð +ð +ð.ð .ð .ð .ð ð  ð  ð  ð3ð 3ð 3ðð ð ð@ð @ð @ð 'Ð(ÐØ'€OØ)ÐØ)Ðð(ð (ð (ð
 �L€MØ€KØ!€MØ!€MðGð Gð Gð �*€KØ€IØ€KØ€Kð=ð =ð =ð +¨HÐ5Ðð(ð (ð (ðEð Eð Eðð ð ð/ð /ð /ð	ð 	ð 	ð
ð 
ð 
ð
Að Að Að #�n€Oð*ð *ð *ð ˜kÐ+;Ð<€Lð"ð "ð "ð*
3ð 
3ð 
3ðð ð ð
Gð 
Gð 
Gð #�_€NØ%Ðð7ð 7ð 7ðð ð ðð ð ð(  ¨Q°	Ð:€KØ€Mà ¨a°Ð<€LØ!€Nð!ð !ð !ðð ð ð �*€KØ€IðGð Gð Gð" Ð.Ð/€KØ€Mð?ð ?ð ?ð" Ð.Ð/€KØ€Mð?ð ?ð ?ð* ˜kÐ+;Ð<€KØ€Mð:ð :ð :ð #Ð$4Ð5€NØ%Ðð<ð <ð <ð 'Ð(8Ð9ÐØ)Ðð,ð ,ð ,ð@ð @ð @ðð ð ð ˜K¨°a¸ÐA€IØ€Kà˜K¨°a¸ÐA€IØ€Kð	4ð 	4ð 	4ðFð Fð Fðð ð ð ˜k¨9Ð5€KØ€Mð;ð ;ð ;ð
ð 
ð 
ð
4ð 4ð 4ð+ð +ð +ðð ð ð ˜k¨9°lÀKÐP€KØ€Mð;ð ;ð ;ð
ð 
ð 
ð
ð ð ð �;€Lð;ð ;ð ;ðYð Yð Yð	ð 	ð 	ð&ð &ð &ð �;€Lðð ð ðYð Yð YðTð Tð Tð !�]€Nð=ð =ð =ð
ð ð ð/ð /ð /ð /ð  ¨^Ð<€Mð<ð <ð <ð:@ð :@ð :@ð :@ðxð ð ð:.ð .ð .ð`ð ð ð.ð .ð .ð<ð <ð <ðQð Qð Qð<ð <ð <ð;ð ;ð ;ð-ð -ð -ð+ð +ð +ð-ð -ð -ð;ð ;ð ;ð<ð <ð <ð
ð ð ð1ð 1ð 1ðOð Oð OðYð Yð Yð,0ð 0ð 0ðDð Dð Dðð ð ð2,ð ,ð ,ð*ð *ð *ð.ð .ð .ð$7ð 7ð 7ð.ð .ð .ðCð Cð Cð1ð 1ð 1ð=ð =ð =ð<ð <ð <ð
;ð ;ð ;ð!ð !ð !ð62ð 2ð 2ð1ð 1ð 1ð/ð /ð /ð1ð 1ð 1ðð ð ð.ð .ð .ðð ð ð	>ð 	>ð 	>ð 	>ð ˜j¨,Ð7€Lð /ð  /ð  /ðD(ð (ð (ðCð Cð Cð Cð
>ð >ð >ð >ð-ð -ð -ð -ð6/ð /ð /ð /ðNð Nð Nð Nð1ð 1ð 1ð 1ð


ð 

ð 

ð 

ð(ð (ð (ð (ð
Sð Sð Sð Sð$Hð $Hð $Hð $HðL!'ð !'ð !'ðFYð Yð Yð
ð 
ð 
ð 
ð( ˜j¨(°LÐA€Lð;ð ;ð ;ðYð Yð Yð7ð 7ð 7ð 7ð ˜JÐ(8Ð9€KðUð Uð UðYð Yð Yð&2ð &2ð &2ðP>ð >ð >ðð ð ð8ð 8ð 8ð ˜( HÐ-€Jð
Lð Lð Lð9ð 9ð 9ðNð Nð Nð Nð NrD   r  c                   óª  — e Zd ZdZdZdZdZdZdZdZ	dZ
dZdZdZdZeeedœZdZdcd	„Zd
„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z d„ Z!d„ Z"d„ Z#ddd„Z$d„ Z%d„ Z&d„ Z'd„ Z(d „ Z)dcd!„Z*d"„ Z+d#„ Z,d$„ Z-d%„ Z.d&„ Z/d'„ Z0d(„ Z1d)„ Z2d*„ Z3d+„ Z4d,„ Z5d-„ Z6d.„ Z7d/„ Z8d0„ Z9d1„ Z:d2„ Z;d3„ Z<d4„ Z=d5„ Z>d6„ Z?d7„ Z@d8„ ZAd9„ ZBd:„ ZCd;„ d<D ¦   «         ZDd=„ ZEd>„ ZFded@„ZGdA„ ZHdB„ ZIdC„ ZJdD„ ZKdE„ ZLdF„ ZMddGœdH„ZNdI„ ZOdfdJ„ZPdfdK„ZQdfdL„ZRdfdM„ZSdfdN„ZTdfdO„ZUdfdP„ZVdfdQ„ZWdfdR„ZXdfdS„ZYdfdT„ZZdfdU„Z[dfdV„Z\dW„ Z]dX„ Z^	 	 	 	 	 	 	 dgdY„Z_dfdZ„Z`dhd[„Zadhd\„Zbdhd]„Zcd^„ Zdd_„ Zed`„ Zfda„ Zgdb„ ZhdS )iÚIMAP4ClientzIMAP4 client protocol implementation

    @ivar state: A string representing the state the connection is currently
    in.
    Nr;   Fr   r¾   )ÚOKÚNOÚBADÚPREAUTHÚBYE)ÚMESSAGESÚRECENTÚUNSEENc                 óh   — i | _         g | _        i | _        || _        d | _        d | _        d | _        d S rv   )r-  ÚqueuedÚauthenticatorsÚcontextÚ_tagÚ_partsÚ_lastCmd)r_   r   s     rB   rb   zIMAP4Client.__init__“	  s8   € ØˆŒ	ØˆŒØ ˆÔØ%ˆŒàˆŒ	ØˆŒØˆŒˆˆrD   c                 ób   — || j         |                     ¦   «                              ¦   «         <   dS )a»  
        Register a new form of authentication

        When invoking the authenticate() method of IMAP4Client, the first
        matching authentication scheme found will be used.  The ordering is
        that in which the server lists support authentication schemes.

        @type auth: Implementor of C{IClientAuthentication}
        @param auth: The object to use to perform the client
        side of this authentication scheme.
        N)rG  ÚgetNamer^  )r_   r  s     rB   ÚregisterAuthenticatorz!IMAP4Client.registerAuthenticator�	  s+   € ð 7;ˆÔ˜DŸLšL™NœN×0Ò0Ñ2Ô2Ñ3Ð3Ð3rD   c                 óT  — | j         dk    r|                      ¦   «          | xj        t          |¦  «        z  c_        | j        dk    r| j                             |¦  «         d S d}| j        dk     r|d | j        …         || j        d …         }}| j                             |¦  «         | j        }d | _        d | _        |                     dd¦  «         | j                             | 	                    ¦   «         ¦  «         |  
                    |                     d¦  «        ¦  «         d S )Nr   rD   ó   
)r8  rE  Ú_pendingSizer³   Ú_pendingBufferr¶   rÅ   rJ  rt   ÚreadrG  Úlstrip)r_   r®   rµ   ra  s       rB   rH  zIMAP4Client.rawDataReceived«	  s"  € ØŒ<˜!ÒÐØ×ÒÑÔÐàÐÔ�S ™YœYÑ&ÐÔØÔ˜qÒ Ð ØÔ×%Ò% dÑ+Ô+Ð+Ð+Ð+àˆFØÔ  1Ò$Ð$Ø#Ð$7 dÔ&7Ð$7Ô8¸$¸tÔ?PÐ?RÐ?RÔ:S�f�ØÔ×%Ò% dÑ+Ô+Ð+ØÔ&ˆDØ"&ˆDÔØ $ˆDÔØ�IŠI�a˜‰OŒOˆOØŒK×Ò˜tŸyšy™{œ{Ñ+Ô+Ð+Ø×Ò˜VŸ]š]¨7Ñ3Ô3Ñ4Ô4Ð4Ð4Ð4rD   c                 óÊ   — |                       |¦  «        | _        || _        | j        €
|dg| _        n| j                             |dg¦  «         |                      ¦   «          d S )NrP  )ÚmessageFilerR  rQ  rJ  r|   r…  )r_   ra  Úoctetss      rB   Ú_setupForLiteralzIMAP4Client._setupForLiteralÂ	  se   € Ø"×.Ò.¨vÑ6Ô6ˆÔØ"ˆÔØŒ;ÐØ ˜/ˆDŒKˆKàŒK×Ò  g˜Ñ/Ô/Ð/Ø�ŠÑÔÐÐÐrD   c                 óT   — | j         dk    r|                      | j         ¦  «         d S d S rÊ   )r8  r/  rd   s    rB   r2  zIMAP4Client.connectionMadeË	  s1   € ØŒ<˜!ÒÐØ�OŠO˜DœLÑ)Ô)Ð)Ð)Ð)ð ÐrD   c                 óP  — | j         dk    r|                      d¦  «         | j        �-| j        }d| _        |D ]}|j                             |¦  «         Œ| j        �H| j        }d| _        |                     ¦   «         D ]'}|�!|j        �|j                             |¦  «         Œ&dS dS )z,
        We are no longer connected
        r   N)r8  r/  rF  r   Úerrbackr-  Úvalues)r_   r5  rF  rb  r-  s        rB   r6  zIMAP4Client.connectionLostÏ	  sÃ   € ð Œ<˜!ÒÐØ�OŠO˜DÑ!Ô!Ð!ØŒ;Ð"Ø”[ˆFØˆDŒKØð *ð *�Ø”	×!Ò! &Ñ)Ô)Ð)Ð)ØŒ9Ð Ø”9ˆDØˆDŒIØ—{’{‘}”}ð .ð .�Ø�? s¤yÐ'<Ø”I×%Ò% fÑ-Ô-Ð-øð !Ð ð.ð .rD   c                 ó¤  — | j         dk    r|                      ¦   «          |                     d¦  «        }|dk    r˜||dz   d…         }|                     d¦  «        rv	 t	          |dd…         ¦  «        }n# t
          $ r t          |¦  «        ‚w xY w| j        €|                     dd¦  «        \  | _	        }n|}|  
                    ||¦  «         dS | j        €|                      |¦  «         dS | j                             |¦  «         | j	        d                     | j        ¦  «        }}dx| _	        | _        |                      ||¦  «         dS )aF  
        Attempt to parse a single line from the server.

        @type line: L{bytes}
        @param line: The line from the server, without the line delimiter.

        @raise IllegalServerResponse: If the line or some part of the line
            does not represent an allowed message from the server at this time.
        r   r’  r   r;   Nr“  rD   )r8  rE  ÚrfindrÄ  r—  rg   r   rJ  r\  rI  rX  Ú_regularDispatchrt   r—   r_  )r_   r»   ÚlastPartrW  Úpartsr÷   ra  s          rB   rK  zIMAP4Client.lineReceivedá	  sk  € ð Œ<˜!ÒÐØ×ÒÑÔÐà—:’:˜dÑ#Ô#ˆØ�rŠ>ˆ>Ø˜H q™L˜N˜NÔ+ˆHØ× Ò  Ñ&Ô&ð ð6Ý  ¨#¨2¨#¤Ñ/Ô/�F�FøÝ!ð 6ð 6ð 6Ý/°Ñ5Ô5Ð5ð6øøøà”;Ð&Ø'+§z¢z°$¸Ñ':Ô':Ñ$�D”I˜u˜uà �EØ×%Ò% e¨VÑ4Ô4Ð4Ø�àŒ;Ðà×!Ò! $Ñ'Ô'Ð'Ð'Ð'ð
 ŒK×Ò˜tÑ$Ô$Ð$Øœ	 3§8¢8¨D¬KÑ#8Ô#8�ˆCØ&*Ð*ˆDŒI˜œØ× Ò   dÑ+Ô+Ð+Ð+Ð+s   ÁA6 Á6Bc                 óF  — | j         r?| j         j        �3| j         j        d c}| j         _        |                     t          ¦  «         | j        r:| j        D ]2}|j        �)|j        |c}|_        |                     t          ¦  «         Œ3| j                             ¦   «          d S rv   )rK  r   r[  ÚTIMEOUT_ERRORrF  rÌ   r:  )r_   r  rb  s      rB   rC  zIMAP4Client.timeoutConnection
  s�   € ØŒ=ð 	%˜Tœ]Ô0Ð<Ø%)¤]Ô%8¸$Ð"ˆAˆtŒ}Ô"Ø�IŠI•mÑ$Ô$Ð$àŒ;ð 	-Ø”{ð -ð -�Ø”9Ð(Ø#&¤9¨a�L�A�s”yØ—I’I�mÑ,Ô,Ð,øàŒ×%Ò%Ñ'Ô'Ð'Ð'Ð'rD   c                 ó¸   — |                      d d¦  «        }t          |¦  «        dk    r|                     d¦  «         |\  }}|                      ||¦  «         d S )Nr;   rù   rD   )r\  r³   rt   r_  )r_   r»   ra  r÷   ra  s        rB   r_  zIMAP4Client._regularDispatch
  s[   € Ø—
’
˜4 Ñ#Ô#ˆÝˆu‰:Œ:˜Š?ˆ?Ø�LŠL˜ÑÔÐØ‰	ˆˆTØ×Ò˜S $Ñ'Ô'Ð'Ð'Ð'rD   c                 óZ   — || j         k    rt          j        ¦   «         S t          ¦   «         S )a8  
        Create a file to which an incoming message may be written.

        @type octets: L{int}
        @param octets: The number of octets which will be written to the file

        @rtype: Any object which implements C{write(string)} and
        C{seek(int, int)}
        @return: A file-like object
        )rÀ   rÁ   rÂ   r   )r_   rW  s     rB   rV  zIMAP4Client.messageFile
  s+   € ð �DÔ)Ò)Ð)ÝÔ)Ñ+Ô+Ð+å‘9”9ÐrD   c                 ó`   — d| j         z                       d¦  «        }| xj         dz  c_         |S )Nz%0.4XÚasciir;   )ÚtagIDrW  rö   s     rB   ÚmakeTagzIMAP4Client.makeTag/
  s0   € Ø˜œÑ#×+Ò+¨GÑ4Ô4ˆØˆ
Œ
�a‰ˆ
Œ
Øˆ
rD   c                 óŒ  — | j         €| j        }n+t          | d| j                              ¦   «         z   d ¦  «        }|rL	  |||¦  «         d S # t          $ r0 t          j        ¦   «          | j                             ¦   «          Y d S w xY wt          j        d| j         › d|›d|›�¦  «         | j                             ¦   «          d S )NÚ	response_zCannot dispatch: z, )	rA  Úresponse_UNAUTHrQ  r^  rQ  r5   r@  rÌ   r:  )r_   r÷   ra  rU  s       rB   r_  zIMAP4Client.dispatchCommand4
  sâ   € ØŒ:ÐØÔ$ˆAˆAå˜˜k¨D¬J×,<Ò,<Ñ,>Ô,>Ñ>ÀÑEÔEˆAØð 	,ð0Ø��#�t‘”���øÝ ð 0ð 0ð 0Ý”‘	”	�	Ø”×-Ò-Ñ/Ô/Ð/Ð/Ð/Ð/ð0øøøõ ŒGÐG¨¬
ÐGÐG°cÐGÐG¸tÐGÐGÑHÔHÐHØŒN×)Ò)Ñ+Ô+Ð+Ð+Ð+s   ¾A Á6BÂBc           	      ót  — | j         �€|                     d d¦  «        \  }}|                     ¦   «         dk    rd| _         nN|                     ¦   «         dk    rd| _         n.| j                             ¦   «          t          |dz   |z   ¦  «        ‚|                     d¦  «        |                     d¦  «        }}|d	k    rK|d	k    rE|                      |                      t          ||dz   |…         ¦  «        gd f¦  «        ¦  «         d S |                      d ¦  «         d S |  
                    ||¦  «         d S )
Nr;   rú   r  s   PREAUTHr  rõ   r?  ó   ]r   )rA  r\  r^  rÌ   r:  r   r¤  ÚserverGreetingÚ_IMAP4Client__cbCapabilitiesrû   Ú_defaultHandler)r_   r÷   ra  r�  r:  rV  s         rB   rl  zIMAP4Client.response_UNAUTHC
  s=  € ØŒ:ÑàŸ:š: d¨AÑ.Ô.‰LˆF�DØ�|Š|‰~Œ~ Ò&Ð&Ø%�”
�
Ø—’‘” :Ò-Ð-Ø#�”
�
ð ”×-Ò-Ñ/Ô/Ð/Ý+¨C°$©J¸Ñ,=Ñ>Ô>Ð>à—9’9˜T‘?”? D§I¢I¨d¡O¤OˆqˆAØ�BŠwˆw˜1 š7˜7Ø×#Ò#Ø×)Ò)Õ,=¸dÀ1ÀqÁ5È1À9¼oÑ,NÔ,NÐ+OÐQUÐ*VÑWÔWñô ð ð ð ð ×#Ò# DÑ)Ô)Ð)Ð)Ð)à× Ò   dÑ+Ô+Ð+Ð+Ð+rD   c                 ó2   — |                       ||¦  «         d S rv   )rq  )r_   r÷   ra  s      rB   Úresponse_AUTHzIMAP4Client.response_AUTHZ
  s   € Ø×Ò˜S $Ñ'Ô'Ð'Ð'Ð'rD   c                 óª  — |dk    s|dk    rw| j         s%|                      t          |¦  «        g¦  «         d S | j        | j                  }|dk    r|                     |¦  «         d S |j                             |¦  «         d S 	 | j        |         }|                     d d¦  «        \  }}|dk    r|                     || j        ¦  «         n'|j	         
                    t          |¦  «        ¦  «         | j        |= d | _         |                      ¦   «          d S # t          $ r/ | j                             ¦   «          t!          |dz   |z   ¦  «        ‚w xY w)NrÚ  r×  r;   rú   rõ   )ÚwaitingÚ
_extraInforû   r-  rì   rð   rt   r\  r  r   r[  r   Ú_flushQueueÚKeyErrorrÌ   r:  r   )r_   r÷   ra  rb  r�  r»   s         rB   rq  zIMAP4Client._defaultHandler]
  sg  € Ø�$Š;ˆ;˜# š+˜+Ø”<ð +Ø—’Õ!2°4Ñ!8Ô!8Ð 9Ñ:Ô:Ð:Ð:Ð:à”i ¤Ô-�Ø˜$’;�;Ø×$Ò$ TÑ*Ô*Ð*Ð*Ð*à”I×$Ò$ TÑ*Ô*Ð*Ð*Ð*ð#Ø”i ”n�ð  $Ÿzšz¨$°Ñ2Ô2‘�˜Ø˜U’?�?à—J’J˜t T¤_Ñ5Ô5Ð5Ð5à”I×%Ò%¥n°TÑ&:Ô&:Ñ;Ô;Ð;Ø”I˜c�NØ#�”Ø× Ò Ñ"Ô"Ð"Ð"Ð"øõ ð ?ð ?ð ?à”×-Ò-Ñ/Ô/Ð/Ý+¨C°$©J¸Ñ,=Ñ>Ô>Ð>ð?øøøs   ÂD Ä9Ec                 óæ   — | j         ri| j                              d¦  «        }|                      ¦   «         }|| j        |<   |                      |                     |¦  «        ¦  «         || _        d S d S rÊ   )rF  rL  ri  r-  r9  rò   ru  ©r_   rb  Úts      rB   rw  zIMAP4Client._flushQueuey
  sh   € ØŒ;ð 	Ø”+—/’/ !Ñ$Ô$ˆCØ—’‘”ˆAØˆDŒI�a‰LØ�MŠM˜#Ÿ*š* Q™-œ-Ñ(Ô(Ð(ØˆDŒLˆLˆLð	ð 	rD   c                 ó  — i }d x}}|D �]O}t          |¦  «        }|dk    r#|d         dgk    r|                      d¦  «         Œ;|dk    r#|d         dgk    r|                      d¦  «         Œd|dk    r"|d         dk    rt          |d         ¦  «        }ŒŒ|dk    r"|d         d	k    rt          |d         ¦  «        }Œ´|d
k    r~|d         dk    rrt          |d         ¦  «        }|                      |d         ¦  «        \  }}	|                     |g ¦  «                             |                     dd¦  «        ¦  «         �Œ8t          j        d|› �¦  «         �ŒQ|r|  	                    |¦  «         |€|�|  
                    ||¦  «         d S d S )Nr;   r   rå   Frä   Trù   rÞ   rá   rX  rà   ÚFLAGSr>   z Unhandled unsolicited response: )r³   rö  r—  Ú_parseFetchPairsÚ
setdefaultr|   rû  r5   rÉ  rü  r  )
r_   rð   rµ  r   rÿ  ÚresponseÚelementsrû  r\  rm  s
             rB   rv  zIMAP4Client._extraInfo�
  sÂ  € ð ˆØÐˆ�Øð 	Gñ 	GˆHÝ˜8‘}”}ˆHØ˜1Š}ˆ} ¨!¤°°Ò!>Ð!>Ø× Ò  Ñ'Ô'Ð'Ð'Ø˜Q’� 8¨A¤;°=°/Ò#AÐ#AØ× Ò  Ñ&Ô&Ð&Ð&Ø˜Q’� 8¨A¤;°)Ò#;Ð#;Ý˜X aœ[Ñ)Ô)��Ø˜Q’� 8¨A¤;°)Ò#;Ð#;Ý˜X aœ[Ñ)Ô)��Ø˜Q’� 8¨A¤;°(Ò#:Ð#:Ý˜( 1œ+Ñ&Ô&�Ø ×1Ò1°(¸1´+Ñ>Ô>‘	�˜Ø× Ò   bÑ)Ô)×0Ò0°·²¸GÀRÑ1HÔ1HÑIÔIÐIÑIå”ÐE¸8ÐEÐEÑFÔFÐFÑFàð 	%Ø×Ò˜eÑ$Ô$Ð$ØÐ Ð!3Ø×Ò˜V VÑ,Ô,Ð,Ð,Ð,ð "4Ð!3rD   c                 ó8  — t          j        ¦   «         |_         | j        r!| j                             |¦  «         |j         S |                      ¦   «         }|| j        |<   |                      |                     |¦  «        ¦  «         || _        || _	        |j         S rv   )
r   rƒ  ru  rF  rt   ri  r-  r9  rò   rK  rz  s      rB   ÚsendCommandzIMAP4Client.sendCommand�
  sƒ   € Ý”NÑ$Ô$ˆŒ	ØŒ<ð 	ØŒK×Ò˜sÑ#Ô#Ð#Ø”9ÐØ�LŠL‰NŒNˆØˆŒ	�!‰Ø�Š�c—j’j ‘m”mÑ$Ô$Ð$ØˆŒØˆŒØŒyÐrD   c                 óÎ   — |r | j         �t          j        | j         ¦  «        S d}d}|                      t	          ||¬¦  «        ¦  «        }|                     | j        ¦  «         |S )av  
        Request the capabilities available on this server.

        This command is allowed in any state of connection.

        @type useCache: C{bool}
        @param useCache: Specify whether to use the capability-cache or to
        re-retrieve the capabilities from the server.  Server capabilities
        should never change, so for normal use, this flag should never be
        false.

        @rtype: L{Deferred}
        @return: A deferred whose callback will be invoked with a
        dictionary mapping capability types to lists of supported
        mechanisms, or to None if a support list is not applicable.
        Nr×   )r×   ©rï   )Ú	_capCacher   Úsucceedrƒ  rÖ   rp  rp  )r_   ÚuseCacherb  rx  r  s        rB   ÚgetCapabilitieszIMAP4Client.getCapabilities©
  si   € ð" ð 	1˜œÐ2Ý”= ¤Ñ0Ô0Ð0ØˆØˆØ×Ò�W S°tÐ<Ñ<Ô<Ñ=Ô=ˆØ	�Š�dÔ+Ñ,Ô,Ð,ØˆrD   c                 ó8  — |\  }}i }|D ]q}|dd …         D ]d}|                      dd¦  «        }t          |¦  «        dk    r|d         d }	}n|\  }}	|                     |g ¦  «                             |	¦  «         ŒeŒr|D ]}||         d gk    rd ||<   Œ|| _        |S )Nr;   rÝ  r   )r\  r³   r  rt   r†  )
r_   rx  rð   Útaglinerà  ra  r*  ra  Úcategoryri   s
             rB   Ú__cbCapabilitieszIMAP4Client.__cbCapabilitiesÂ
  sÓ   € Ø!Ñˆ�ØˆØð 	<ð 	<ˆDØ˜A˜B˜B”xð <ð <�ØŸ	š	 $¨Ñ*Ô*�Ý�u‘:”: ’?�?Ø&+¨A¤h°˜e�H�Hà&+‘O�H˜eØ—’ ¨"Ñ-Ô-×4Ò4°UÑ;Ô;Ð;Ð;ð<ð ð 	&ð 	&ˆHØ�HŒ~ $ Ò'Ð'Ø!%��X‘øØˆŒØˆrD   c                 ó‚   — |                       t          dd¬¦  «        ¦  «        }|                     | j        ¦  «         |S )a*  
        Inform the server that we are done with the connection.

        This command is allowed in any state of connection.

        @rtype: L{Deferred}
        @return: A deferred whose callback will be invoked with None
        when the proper server acknowledgement has been received.
        s   LOGOUT)s   BYEr…  )rƒ  rÖ   rp  Ú_IMAP4Client__cbLogout©r_   r  s     rB   r  zIMAP4Client.logout×
  s=   € ð ×Ò�W Y¸YÐGÑGÔGÑHÔHˆØ	�Š�d”oÑ&Ô&Ð&ØˆrD   c                 óB   — |\  }}| j                              ¦   «          d S rv   )rÌ   r:  ©r_   rx  rð   r‹  s       rB   Ú
__cbLogoutzIMAP4Client.__cbLogoutå
  s%   € Ø!Ñˆ�ØŒ×%Ò%Ñ'Ô'Ð'àˆtrD   c                 ó~   — |                       t          d¦  «        ¦  «        }|                     | j        ¦  «         |S )a  
        Perform no operation.

        This command is allowed in any state of connection.

        @rtype: L{Deferred}
        @return: A deferred whose callback will be invoked with a list
        of untagged status updates the server responds with.
        s   NOOP)rƒ  rÖ   rp  Ú_IMAP4Client__cbNoopr�  s     rB   ÚnoopzIMAP4Client.noopë
  s8   € ð ×Ò�W WÑ-Ô-Ñ.Ô.ˆØ	�Š�d”mÑ$Ô$Ð$ØˆrD   c                 ó   — |\  }}|S rv   r>   r’  s       rB   Ú__cbNoopzIMAP4Client.__cbNoopù
  s   € ð "Ñˆ�ØˆrD   c                 ó  ‡ — ‰ j         r
J d¦   «         ‚|€‰                      ¦   «         }|€!t          j        t	          d¦  «        ¦  «        S d‰ j        vr!t          j        t	          d¦  «        ¦  «        S t          j        ‰ j        d¦  «        }|€!t          j        t	          d¦  «        ¦  «        S ‰  	                    t          d¦  «        ¦  «        }|                     ‰ j        |¦  «         |                     ˆ fd„¦  «         |S )a:  
        Initiates a 'STARTTLS' request and negotiates the TLS / SSL
        Handshake.

        @param contextFactory: The TLS / SSL Context Factory to
        leverage.  If the contextFactory is None the IMAP4Client will
        either use the current TLS / SSL Context Factory or attempt to
        create a new one.

        @type contextFactory: C{ssl.ClientContextFactory}

        @return: A Deferred which fires when the transport has been
        secured according to the given contextFactory, or which fails
        if the transport cannot be secured.
        z5Client and Server are currently communicating via TLSNzEIMAP4Client requires a TLS context to initiate the STARTTLS handshaker%  z:Server does not support secure communication via TLS / SSLzAIMAP4Client transport does not implement interfaces.ITLSTransportc                 ó,   •— ‰                      ¦   «         S rv   ©r‰  ©rm  r_   s    €rB   rV   z&IMAP4Client.startTLS.<locals>.<lambda>/  s   ø€  × 4Ò 4Ñ 6Ô 6€ rD   )r(  Ú_getContextFactoryr   Úfailr   r†  r   r.  rÌ   rƒ  rÖ   rp  Ú_startedTLS)r_   r   Útlsr  s   `   rB   r  zIMAP4Client.startTLSÿ
  s9  ø€ ð" ”ð	Cð 	CàBñ	Cô 	Cð 	Cð Ð!Ø!×4Ò4Ñ6Ô6ˆNàÐ!Ý”:Ýð6ñô ñô ð ð ˜dœnÐ,Ð,Ý”:ÝØSñô ñô ð õ Ô& t¤~°tÑ<Ô<ˆØˆ;Ý”:Ýð/ñô ñô ð ð ×Ò�W [Ñ1Ô1Ñ2Ô2ˆØ	�Š�dÔ&¨Ñ7Ô7Ð7Ø	�ŠÐ6Ð6Ð6Ð6Ñ7Ô7Ð7ØˆrD   c                 ó¦   — | j         €|                      ¦   «         }nt          j        | j         ¦  «        }|                     | j        |¦  «         |S )a2  
        Attempt to enter the authenticated state with the server

        This command is allowed in the Non-Authenticated state.

        @rtype: L{Deferred}
        @return: A deferred whose callback is invoked if the authentication
        succeeds and whose errback will be invoked otherwise.
        )r†  r‰  r   r‡  rp  Ú_IMAP4Client__cbAuthenticate)r_   Úsecretr  s      rB   rê  zIMAP4Client.authenticate2  sL   € ð Œ>Ð!Ø×$Ò$Ñ&Ô&ˆAˆAå”˜dœnÑ-Ô-ˆAØ	�Š�dÔ+¨VÑ4Ô4Ð4ØˆrD   c           	      ó  ‡ ‡— |                      dd¦  «        Š‰D ]M}|                     ¦   «         ‰ j        v r0t          d|d‰ j        ||¦  «        }‰                      |¦  «        c S ŒN‰ j        r9t          j        t          ‰‰ j         
                    ¦   «         ¦  «        ¦  «        S ˆˆ fd„}‰                      ¦   «         }|                     |¦  «         |                     ˆ fd„¦  «         |                     ‰ j        |¦  «         |S )Nr#  r>   ó   AUTHENTICATEc                 óª   •— |                       t          ¦  «         t          j        t	          ‰‰j                             ¦   «         ¦  «        ¦  «        S rv   )Útrapr   r   rž  r$   rG  r&  )r@  Úauthsr_   s    €€rB   Ú
ebStartTLSz0IMAP4Client.__cbAuthenticate.<locals>.ebStartTLSR  sE   ø€ Ø—’�Ñ(Ô(Ð(å”zÝ-¨e°TÔ5H×5MÒ5MÑ5OÔ5OÑPÔPñô ð rD   c                 ó,   •— ‰                      ¦   «         S rv   r›  rœ  s    €rB   rV   z.IMAP4Client.__cbAuthenticate.<locals>.<lambda>[  s   ø€  D×$8Ò$8Ñ$:Ô$:€ rD   )rû  r^  rG  rÖ   Ú_IMAP4Client__cbContinueAuthrƒ  r(  r   rž  r$   r&  r  r?  rp  Ú_IMAP4Client__cbAuthTLS)r_   rà  r£  Úschemerb  r©  r  r¨  s   `      @rB   Ú__cbAuthenticatezIMAP4Client.__cbAuthenticateC  s0  øø€ Ø—’˜ "Ñ%Ô%ˆØð 	-ð 	-ˆFØ�|Š|‰~Œ~ Ô!4Ð4Ð4ÝØ# V¨R°Ô1FÈÐPVñô �ð ×'Ò'¨Ñ,Ô,Ð,Ð,Ð,ð	 5ð Œ?ð 	Ý”:Ý)¨%°Ô1D×1IÒ1IÑ1KÔ1KÑLÔLñô ð ð
ð ð ð ð ð ð —’‘”ˆAØ�LŠL˜Ñ$Ô$Ð$Ø�MŠMÐ:Ð:Ð:Ð:Ñ;Ô;Ð;Ø�MŠM˜$Ô*¨FÑ3Ô3Ð3ØˆHrD   c                 óH  — 	 t          |dz   ¦  «        }| j        |         }|                     ||¦  «        }|                      t	          |¦  «                             ¦   «         ¦  «         d S # t          j        $ r% |                      d¦  «         t          |¦  «        ‚w xY w)Nó   
rÚ  )	r   rG  ÚchallengeResponser9  r   r–  rö  r÷  r   )r_   ra  r­  r£  r  r  s         rB   Ú__cbContinueAuthzIMAP4Client.__cbContinueAuth_  s§   € ð	5Ý˜t e™|Ñ,Ô,ˆDð
 Ô& vÔ.ˆDØ×)Ò)¨&°$Ñ7Ô7ˆDØ�MŠM�+ dÑ+Ô+×1Ò1Ñ3Ô3Ñ4Ô4Ð4Ð4Ð4øõ Œ~ð 	.ð 	.ð 	.Ø�MŠM˜$ÑÔÐÝ'¨Ñ-Ô-Ð-ð	.øøøs   ‚A- Á-4B!c           	      ó  — |                      dd¦  «        }|D ]M}|                     ¦   «         | j        v r0t          d|d| j        ||¦  «        }|                      |¦  «        c S ŒNt          || j                             ¦   «         ¦  «        ‚)Nr#  r>   r¥  )rû  r^  rG  rÖ   r«  rƒ  r$   r&  )r_   rà  r£  r¨  r­  rb  s         rB   Ú__cbAuthTLSzIMAP4Client.__cbAuthTLSj  sœ   € Ø—’˜ "Ñ%Ô%ˆØð 	-ð 	-ˆFØ�|Š|‰~Œ~ Ô!4Ð4Ð4ÝØ# V¨R°Ô1FÈÐPVñô �ð ×'Ò'¨Ñ,Ô,Ð,Ð,Ð,ð	 5õ
 (¨¨tÔ/B×/GÒ/GÑ/IÔ/IÑJÔJÐJrD   c                 óf   — t          | j        ¦  «        }|                     | j        ||¦  «         |S )aÆ  
        Authenticate with the server using a username and password

        This command is allowed in the Non-Authenticated state.  If the
        server supports the STARTTLS capability and our transport supports
        TLS, TLS is negotiated before the login command is issued.

        A more secure way to log in is to use C{startTLS} or
        C{authenticate} or both.

        @type username: L{str}
        @param username: The username to log in with

        @type password: L{str}
        @param password: The password to log in with

        @rtype: L{Deferred}
        @return: A deferred whose callback is invoked if login is successful
        and whose errback is invoked otherwise.
        )r   r‰  rp  Ú_IMAP4Client__cbLoginCaps)r_   ÚusernameÚpasswordr  s       rB   rú  zIMAP4Client.logint  s2   € õ* ˜$Ô.Ñ/Ô/ˆØ	�Š�dÔ(¨(°HÑ=Ô=Ð=ØˆrD   c                 ó   — dS )z¦
        Called when the server has sent us a greeting.

        @type caps: C{dict}
        @param caps: Capabilities the server advertised in its greeting.
        Nr>   )r_   rà  s     rB   ro  zIMAP4Client.serverGreeting�  ó   € € € rD   c                 óv   — | j         �| j         S 	 ddlm} |                     ¦   «         S # t          $ r Y d S w xY w)Nr   )Ússl)rH  rÞ  r¼  ÚClientContextFactoryÚImportError)r_   r¼  s     rB   r�  zIMAP4Client._getContextFactory•  sa   € ØŒ<Ð#Ø”<Ðð	.Ø,Ð,Ð,Ð,Ð,Ð,ð ×+Ò+Ñ-Ô-Ð-øõ ð 	ð 	ð 	Ø�4�4ð	øøøs   �* ª
8·8c                 óÜ  — d|v }t          j        | j        d ¦  «        d u}t          j        | j        d ¦  «        d u }| j        s@|r>|r<|r:|                      ¦   «         }|                     | j        | j        ||f¬¦  «         |S |rt          j
        d¦  «         d                     t          |¦  «        t          |¦  «        f¦  «        }|                      t          d|¦  «        ¦  «        S )Nr%  )r£  z5Server has no TLS support. logging in over cleartext!rõ   r  )r   r.  rÌ   r)  r(  r  rü  Ú_IMAP4Client__cbLoginTLSÚ_IMAP4Client__ebLoginTLSr5   rÉ  r—   rŒ  rƒ  rÖ   )	r_   r+  r·  r¸  ÚtryTLSÚtlsableTransportÚnontlsTransportr  rî   s	            rB   Ú__cbLoginCapszIMAP4Client.__cbLoginCapsŸ  s  € à Ð,ˆõ &Ô3°D´NÀDÑIÔIÐQUÐUÐõ %Ô2°4´>À4ÑHÔHÈDÐPˆàŒð 	= 6ð 	=Ð.>ð 	=À?ð 	=Ø—’‘”ˆAà�NŠNØÔ!ØÔ!Ø&¨Ð1ð ñ ô ð ð
 ˆHàð QÝ”ÐOÑPÔPÐPØ—9’9�f XÑ.Ô.µ°xÑ0@Ô0@ÐAÑBÔBˆDØ×#Ò#¥G¨H°dÑ$;Ô$;Ñ<Ô<Ð<rD   c                 óV   — | j                              |¦  «         d | _        d| _        |S )NT)rÌ   r  r†  r(  )r_   rx  rH  s      rB   rŸ  zIMAP4Client._startedTLS¸  s+   € ØŒ×Ò Ñ(Ô(Ð(ØˆŒØˆŒØˆrD   c                 óª   — d                      t          |¦  «        t          |¦  «        f¦  «        }|                      t          d|¦  «        ¦  «        S )Nrõ   r  )r—   rŒ  rƒ  rÖ   )r_   rx  r·  r¸  rî   s        rB   Ú__cbLoginTLSzIMAP4Client.__cbLoginTLS¾  sF   € Ø�yŠy�& Ñ*Ô*­F°8Ñ,<Ô,<Ð=Ñ>Ô>ˆØ×Ò¥¨°$Ñ 7Ô 7Ñ8Ô8Ð8rD   c                 ó.   — t          j        |¦  «         |S rv   )r5   r@  rv  s     rB   Ú__ebLoginTLSzIMAP4Client.__ebLoginTLSÂ  s   € ÝŒ�ÑÔÐØˆrD   c                 óŠ   — d}d}|                       t          ||¬¦  «        ¦  «        }|                     | j        ¦  «         |S )að  
        Retrieve information about the namespaces available to this account

        This command is allowed in the Authenticated and Selected states.

        @rtype: L{Deferred}
        @return: A deferred whose callback is invoked with namespace
        information.  An example of this information is::

            [[['', '/']], [], []]

        which indicates a single personal namespace called '' with '/'
        as its hierarchical delimiter, and no shared or user namespaces.
        rÝ   )rÝ   r…  )rƒ  rÖ   rp  Ú_IMAP4Client__cbNamespace©r_   rb  rx  r  s       rB   Ú	namespacezIMAP4Client.namespaceÆ  sH   € ð ˆØˆØ×Ò�W S°tÐ<Ñ<Ô<Ñ=Ô=ˆØ	�Š�dÔ(Ñ)Ô)Ð)ØˆrD   c                 ó¾   ‡— |\  }}d„ Š|D ]9}t          |¦  «        dk    r$|d         dk    rˆfd„|dd …         D ¦   «         c S Œ:t          j        d¦  «         g g g gS )Nc                 ó   — d„ | D ¦   «         S )Nc                 ó8   — g | ]}|                      d ¦  «        ‘ŒS )rU  )Údecode)rG   Úelements     rB   rJ   zSIMAP4Client.__cbNamespace.<locals>._prepareNamespaceOrDelimiter.<locals>.<listcomp>é  s$   € ÐOÐOÐO°g�G—N’N =Ñ1Ô1ÐOÐOÐOrD   r>   )ÚnamespaceLists    rB   Ú_prepareNamespaceOrDelimiterz?IMAP4Client.__cbNamespace.<locals>._prepareNamespaceOrDelimiterè  s   € ØOÐOÀÐOÑOÔOÐOrD   r×  r   rÝ   c                 ó4   •— g | ]}|€g nˆfd„|D ¦   «         ‘ŒS )Nc                 ó&   •— g | ]} ‰|¦  «        ‘ŒS r>   r>   )rG   ri   rÕ  s     €rB   rJ   z8IMAP4Client.__cbNamespace.<locals>.<listcomp>.<listcomp>ð  s%   ø€ ÐVÐVÐVÀ%Ð6Ð6°uÑ=Ô=ÐVÐVÐVrD   r>   )rG   Ú
pairOrNonerÕ  s     €rB   rJ   z-IMAP4Client.__cbNamespace.<locals>.<listcomp>í  sL   ø€ ð ð ð ð #ð "Ð)ð �BàVÐVÐVÐVÈ:ÐVÑVÔVðð ð rD   r;   z*No NAMESPACE response to NAMESPACE command)r³   r5   r@  )r_   rx  rð   re   ra  rÕ  s        @rB   Ú__cbNamespacezIMAP4Client.__cbNamespaceÛ  s«   ø€ Ø‰ˆ�ð	Pð 	Pð 	Pð ð 	ð 	ˆEÝ�5‰zŒz˜QŠˆ 5¨¤8¨|Ò#;Ð#;ðð ð ð ð ',¨A¨B¨B¤ið	ñ ô ð ð ð øõ 	ŒÐ<Ñ=Ô=Ð=Ø�B˜ˆ|ÐrD   c                 ó¬   — d}t          |¦  «        }d}|                      t          |||¬¦  «        ¦  «        }|                     | j        d¦  «         |S )a·  
        Select a mailbox

        This command is allowed in the Authenticated and Selected states.

        @type mailbox: L{str}
        @param mailbox: The name of the mailbox to select

        @rtype: L{Deferred}
        @return: A deferred whose callback is invoked with mailbox
        information if the select is successful and whose errback is
        invoked otherwise.  Mailbox information consists of a dictionary
        with the following L{str} keys and values::

                FLAGS: A list of strings containing the flags settable on
                        messages in this mailbox.

                EXISTS: An integer indicating the number of messages in this
                        mailbox.

                RECENT: An integer indicating the number of "recent"
                        messages in this mailbox.

                UNSEEN: The message sequence number (an integer) of the
                        first unseen message in the mailbox.

                PERMANENTFLAGS: A list of strings containing the flags that
                        can be permanently set on messages in this mailbox.

                UIDVALIDITY: An integer uniquely identifying this mailbox.
        rF  )r}  ÚEXISTSrC  rD  ÚPERMANENTFLAGSÚUIDVALIDITYr…  r;   ©Ú_prepareMailboxNamerƒ  rÖ   rp  Ú_IMAP4Client__cbSelect©r_   r}  rb  rî   rx  r  s         rB   r+  zIMAP4Client.selectö  s\   € ð@ ˆÝ" 7Ñ+Ô+ˆð XˆØ×Ò�W S¨$¸TÐBÑBÔBÑCÔCˆØ	�Š�d”o qÑ)Ô)Ð)ØˆrD   c                 ó¬   — d}t          |¦  «        }d}|                      t          |||¬¦  «        ¦  «        }|                     | j        d¦  «         |S )a³  
        Select a mailbox in read-only mode

        This command is allowed in the Authenticated and Selected states.

        @type mailbox: L{str}
        @param mailbox: The name of the mailbox to examine

        @rtype: L{Deferred}
        @return: A deferred whose callback is invoked with mailbox
        information if the examine is successful and whose errback
        is invoked otherwise.  Mailbox information consists of a dictionary
        with the following keys and values::

            'FLAGS': A list of strings containing the flags settable on
                        messages in this mailbox.

            'EXISTS': An integer indicating the number of messages in this
                        mailbox.

            'RECENT': An integer indicating the number of "recent"
                        messages in this mailbox.

            'UNSEEN': An integer indicating the number of messages not
                        flagged \Seen in this mailbox.

            'PERMANENTFLAGS': A list of strings containing the flags that
                        can be permanently set on messages in this mailbox.

            'UIDVALIDITY': An integer uniquely identifying this mailbox.
        rG  )rØ   rÞ   rá   rã   rç   râ   r…  r   rÞ  rá  s         rB   ÚexaminezIMAP4Client.examine  s]   € ð@ ˆÝ" 7Ñ+Ô+ˆð
ˆð ×Ò�W S¨$¸TÐBÑBÔBÑCÔCˆØ	�Š�d”o qÑ)Ô)Ð)ØˆrD   c                 ó\   — 	 t          |¦  «        S # t          $ r t          |¦  «        ‚w xY w)zÀ
        Parse C{value} as an integer and return the result or raise
        L{IllegalServerResponse} with C{phrase} as an argument if C{value}
        cannot be parsed as an integer.
        )r—  rg   r   )r_   ri   Úphrases      rB   Ú_intOrRaisezIMAP4Client._intOrRaiseM  s<   € ð	0Ý�u‘:”:ÐøÝð 	0ð 	0ð 	0Ý'¨Ñ/Ô/Ð/ð	0øøøs   ‚ ‘+c                 óR  — |\  }}d|i}|                      t          |¦  «        ¦  «         |D �]w}t          |¦  «        dk    �r(|d                              ¦   «         dk    �r	|d         }t	          |t
          ¦  «        r	|d         }n|}|                     ¦   «         }|dk    rd|d<   Œ~|dk    rd|d<   ŒŠ|d	k    r |                      |d         |¦  «        |d
<   Œ°|dk    r |                      |d         |¦  «        |d<   ŒÖ|dk    r |                      |d         |¦  «        |d<   Œü|dk    r$t          d„ |d         D ¦   «         ¦  «        |d<   �Œ&t          j	        d|› �¦  «         �Œ?t          |¦  «        dk    �r|d                              ¦   «         dk    r$t          d„ |d         D ¦   «         ¦  «        |d<   �Œ•t	          |d         t          ¦  «        r—|d                              ¦   «         dk    r!|                      |d         |¦  «        |d<   �Œï|d                              ¦   «         dk    r!|                      |d         |¦  «        |d<   �Œ.t          j	        d|› �¦  «         �ŒGt          j	        d|› �¦  «         �Œ`t          j	        d|› �¦  «         �Œy|S )zy
        Handle lines received in response to a SELECT or EXAMINE command.

        See RFC 3501, section 6.3.1.
        z
READ-WRITEr   rú   r;   rå   Frä   Trâ   rÝ  rã   rD  ræ   ÚUIDNEXTrç   c              3   ó4   K  — | ]}t          |¦  «        V — Œd S rv   r˜  r:  s     rB   r  z)IMAP4Client.__cbSelect.<locals>.<genexpr>x  s;   è è € ð 4ð 4Ø/3� TÑ*Ô*ð4ð 4ð 4ð 4ð 4ð 4rD   rÜ  zUnhandled SELECT response (2): rù   rØ   c              3   ó4   K  — | ]}t          |¦  «        V — Œd S rv   r˜  r:  s     rB   r  z)IMAP4Client.__cbSelect.<locals>.<genexpr>€  s*   è è € Ð*SÐ*SÀ$­<¸Ñ+=Ô+=Ð*SÐ*SÐ*SÐ*SÐ*SÐ*SrD   r}  rÞ   rÛ  rá   rC  zUnhandled SELECT response (0): zUnhandled SELECT response (1): zUnhandled SELECT response (4): )rt   rû   r³   r^  rZ   r[   ræ  Útupler5   r@  Úbytes)	r_   rx  r/  rð   r‹  Údatumr\  Úcontentro   s	            rB   Ú
__cbSelectzIMAP4Client.__cbSelectX  sì  € ð "Ñˆ�ð ˜rÐ"ˆØ�ŠÕ& wÑ/Ô/Ñ0Ô0Ð0Øð +	Cñ +	CˆEÝ�5‰zŒz˜AŠ~‰~ %¨¤(§.¢.Ñ"2Ô"2°eÒ";Ñ";à œ(�Ý˜g¥tÑ,Ô,ð "Ø! !œ*�C�Cð "�CØ—i’i‘k”k�Ø˜,Ò&Ð&Ø*/�E˜,Ñ'Ð'Ø˜MÒ)Ð)Ø*.�E˜,Ñ'Ð'Ø˜NÒ*Ð*Ø+/×+;Ò+;¸GÀA¼JÈÑ+NÔ+N�E˜-Ñ(Ð(Ø˜IÒ%Ð%Ø&*×&6Ò&6°w¸q´zÀ5Ñ&IÔ&I�E˜(‘O�OØ˜JÒ&Ð&Ø'+×'7Ò'7¸À¼
ÀEÑ'JÔ'J�E˜)Ñ$Ð$ØÐ-Ò-Ð-Ý.3ð 4ð 4Ø7>¸q´zð4ñ 4ô 4ñ /ô /�EÐ*Ñ+Ñ+õ ”GÐE¸eÐEÐEÑFÔFÐFÑFÝ�U‘”˜q’‘à˜”8—>’>Ñ#Ô# xÒ/Ð/Ý%*Ð*SÐ*SÈ%ÐPQÌ(Ð*SÑ*SÔ*SÑ%SÔ%S�E˜'‘N‘NÝ  a¤­%Ñ0Ô0ð Gð ˜Q”x—~’~Ñ'Ô'¨9Ò4Ð4Ø*.×*:Ò*:¸5À¼8ÀUÑ*KÔ*K˜˜h™™Ø˜qœŸšÑ)Ô)¨YÒ6Ð6Ø*.×*:Ò*:¸5À¼8ÀUÑ*KÔ*K˜˜h™™åœÐ IÀ%Ð IÐ IÑJÔJÐJÑJå”GÐE¸eÐEÐEÑFÔFÐFÑFå”ÐA¸%ÐAÐAÑBÔBÐBÑBØˆrD   c                 ób   — |                       t          dt          |¦  «        ¦  «        ¦  «        S )a|  
        Create a new mailbox on the server

        This command is allowed in the Authenticated and Selected states.

        @type name: L{str}
        @param name: The name of the mailbox to create.

        @rtype: L{Deferred}
        @return: A deferred whose callback is invoked if the mailbox creation
        is successful and whose errback is invoked otherwise.
        s   CREATE©rƒ  rÖ   rß  ©r_   r.  s     rB   rP  zIMAP4Client.create‘  ó+   € ð ×Ò¥¨	Õ3FÀtÑ3LÔ3LÑ MÔ MÑNÔNÐNrD   c                 ób   — |                       t          dt          |¦  «        ¦  «        ¦  «        S )ak  
        Delete a mailbox

        This command is allowed in the Authenticated and Selected states.

        @type name: L{str}
        @param name: The name of the mailbox to delete.

        @rtype: L{Deferred}
        @return: A deferred whose calblack is invoked if the mailbox is
        deleted successfully and whose errback is invoked otherwise.
        s   DELETErñ  rò  s     rB   rV  zIMAP4Client.delete   ró  rD   c           	      ó®   — t          |¦  «        }t          |¦  «        }|                      t          dd                     ||f¦  «        ¦  «        ¦  «        S )aÇ  
        Rename a mailbox

        This command is allowed in the Authenticated and Selected states.

        @type oldname: L{str}
        @param oldname: The current name of the mailbox to rename.

        @type newname: L{str}
        @param newname: The new name to give the mailbox.

        @rtype: L{Deferred}
        @return: A deferred whose callback is invoked if the rename is
        successful and whose errback is invoked otherwise.
        s   RENAMErõ   )rß  rƒ  rÖ   r—   )r_   r^  r_  s      rB   r]  zIMAP4Client.rename¯  sM   € õ  & gÑ.Ô.ˆÝ% gÑ.Ô.ˆØ×Ò¥¨	°4·9²9¸gÀwÐ=OÑ3PÔ3PÑ QÔ QÑRÔRÐRrD   c                 ób   — |                       t          dt          |¦  «        ¦  «        ¦  «        S )a‰  
        Add a mailbox to the subscription list

        This command is allowed in the Authenticated and Selected states.

        @type name: L{str}
        @param name: The mailbox to mark as 'active' or 'subscribed'

        @rtype: L{Deferred}
        @return: A deferred whose callback is invoked if the subscription
        is successful and whose errback is invoked otherwise.
        s	   SUBSCRIBErñ  rò  s     rB   rb  zIMAP4Client.subscribeÃ  s+   € ð ×Ò¥¨Õ6IÈ$Ñ6OÔ6OÑ PÔ PÑQÔQÐQrD   c                 ób   — |                       t          dt          |¦  «        ¦  «        ¦  «        S )a{  
        Remove a mailbox from the subscription list

        This command is allowed in the Authenticated and Selected states.

        @type name: L{str}
        @param name: The mailbox to unsubscribe

        @rtype: L{Deferred}
        @return: A deferred whose callback is invoked if the unsubscription
        is successful and whose errback is invoked otherwise.
        s   UNSUBSCRIBErñ  rò  s     rB   rf  zIMAP4Client.unsubscribeÒ  s+   € ð ×Ò¥¨Õ8KÈDÑ8QÔ8QÑ RÔ RÑSÔSÐSrD   c                 óÆ   — d}d|› d|› d�                      d¦  «        }d}|                      t          |||¬¦  «        ¦  «        }|                     | j        d¦  «         |S )ap  
        List a subset of the available mailboxes

        This command is allowed in the Authenticated and Selected
        states.

        @type reference: L{str}
        @param reference: The context in which to interpret
            C{wildcard}

        @type wildcard: L{str}
        @param wildcard: The pattern of mailbox names to match,
            optionally including either or both of the '*' and '%'
            wildcards.  '*' will match zero or more characters and
            cross hierarchical boundaries.  '%' will also match zero
            or more characters, but is limited to a single
            hierarchical level.

        @rtype: L{Deferred}
        @return: A deferred whose callback is invoked with a list of
            L{tuple}s, the first element of which is a L{tuple} of
            mailbox flags, the second element of which is the
            hierarchy delimiter for this mailbox, and the third of
            which is the mailbox name; if the command is unsuccessful,
            the deferred's errback is invoked instead.  B{NB}: the
            delimiter and the mailbox name are L{str}s.
        rÙ   ú"z" "rU  )rÙ   r…  )rW  rƒ  rÖ   rp  Ú_IMAP4Client__cbList)r_   Ú	referenceÚwildcardrb  rî   rx  r  s          rB   r[   zIMAP4Client.listá  sq   € ð8 ˆØ-�IÐ-Ð- (Ð-Ð-Ð-×5Ò5°mÑDÔDˆØˆØ×Ò�W S¨$¸TÐBÑBÔBÑCÔCˆØ	�Š�d”m WÑ-Ô-Ð-ØˆrD   c                 ó  — d}|                      d¦  «        }|                      d¦  «        }d                     d|d|dg¦  «        }d}|                      t          |||¬¦  «        ¦  «        }|                     | j        d¦  «         |S )	aa  
        List a subset of the subscribed available mailboxes

        This command is allowed in the Authenticated and Selected states.

        The parameters and returned object are the same as for the L{list}
        method, with one slight difference: Only mailboxes which have been
        subscribed can be included in the resulting list.
        rÚ   rg  rU  rD   r‘  s   " ")rÚ   r…  )rW  r—   rƒ  rÖ   rp  rú  )	r_   rû  rü  rb  ÚencodedReferenceÚencodedWildcardrî   rx  r  s	            rB   ÚlsubzIMAP4Client.lsub  s™   € ð ˆà$×+Ò+¨GÑ4Ô4ÐØ"Ÿ/š/¨-Ñ8Ô8ˆØ�xŠxàØ ØØØðñ
ô 
ˆð ˆØ×Ò�W S¨$¸TÐBÑBÔBÑCÔCˆØ	�Š�d”m WÑ-Ô-Ð-ØˆrD   c                 ól  — |\  }}g }|D ]©}t          |¦  «        dk    r”|d         |k    rˆt          d„ |d         D ¦   «         ¦  «        |d<   |d                              d¦  «        |d<   |d                              d¦  «        |d<   |                     t          |dd …         ¦  «        ¦  «         Œª|S )Nr×  r   c              3   ó4   K  — | ]}t          |¦  «        V — Œd S rv   r˜  r:  s     rB   r  z'IMAP4Client.__cbList.<locals>.<genexpr>'  s*   è è € Ð IÐ I¸¥¨dÑ!3Ô!3Ð IÐ IÐ IÐ IÐ IÐ IrD   r;   rù   rU  rX  )r³   rë  rÒ  rt   )r_   rx  rí   rð   re   ro  ra  s          rB   Ú__cbListzIMAP4Client.__cbList   s¼   € Ø‰ˆ�Øˆàð 	1ð 	1ˆEÝ�5‰zŒz˜QŠˆ 5¨¤8¨wÒ#6Ð#6å Ð IÐ IÀÀaÄÐ IÑ IÔ IÑIÔI��a‘ð ! œ8Ÿ?š?¨=Ñ9Ô9��a‘à  œ8Ÿ?š?¨=Ñ9Ô9��a‘à—’�u U¨1¨2¨2¤YÑ/Ô/Ñ0Ô0Ð0øØˆrD   c                 ó:   — i | ]}||                      d ¦  «        “ŒS )rg  ©rW  )rG   r.  s     rB   ú
<dictcomp>zIMAP4Client.<dictcomp>;  s6   € ð 	ð 	ð 	àð 	ˆd�kŠk˜'Ñ"Ô"ð	ð 	ð 	rD   ©rB  rC  rè  rÝ  rD  c                 ó¨  ‡ — d}t          |¦  «        }	 d                     ˆ fd„|D ¦   «         ¦  «        }nB# t          $ r5 t          dt	          |¦  «        t	          ‰ j        ¦  «        z
  ›�¦  «        ‚w xY wd                     |d|dg¦  «        }d}‰                      t          |||¬	¦  «        ¦  «        }|                     ‰ j	        ¦  «         |S )
a7  
        Retrieve the status of the given mailbox

        This command is allowed in the Authenticated and Selected states.

        @type mailbox: L{str}
        @param mailbox: The name of the mailbox to query

        @type names: L{bytes}
        @param names: The status names to query.  These may be any number of:
            C{'MESSAGES'}, C{'RECENT'}, C{'UIDNEXT'}, C{'UIDVALIDITY'}, and
            C{'UNSEEN'}.

        @rtype: L{Deferred}
        @return: A deferred which fires with the status information if the
            command is successful and whose errback is invoked otherwise.  The
            status information is in the form of a C{dict}.  Each element of
            C{names} is a key in the dictionary.  The value for each key is the
            corresponding response from the server.
        rÛ   rõ   c              3   ó2   •K  — | ]}‰j         |         V — Œd S rv   )Ú_statusNames)rG   r.  r_   s     €rB   r  z%IMAP4Client.status.<locals>.<genexpr>_  s+   øè è € ÐHÐH¸$˜dÔ/°Ô5ÐHÐHÐHÐHÐHÐHrD   zUnknown names: rD   rŒ  r¢  )rÛ   r…  )
rß  r—   rx  rg   Úsetr
  rƒ  rÖ   rp  Ú_IMAP4Client__cbStatus)r_   r}  r  rb  ÚpreparedMailboxrî   rx  r  s   `       rB   r�  zIMAP4Client.statusF  sí   ø€ ð* ˆå-¨gÑ6Ô6ˆð	XØ—I’IÐHÐHÐHÐHÀ%ÐHÑHÔHÑHÔHˆEˆEøÝð 	Xð 	Xð 	XÝÐV­s°5©z¬z½CÀÔ@QÑ<RÔ<RÑ/RÐVÐVÑWÔWÐWð	Xøøøð �xŠx˜¨%°¸Ð=Ñ>Ô>ˆØˆØ×Ò�W S¨$¸TÐBÑBÔBÑCÔCˆØ	�Š�d”oÑ&Ô&Ð&Øˆs	   ”!6 ¶?A5c                 ó>  ‡
— |\  }}i }|D ]…}|d         dk    rw|d         Š
ˆ
fd„t          dt          ‰
¦  «        d¦  «        D ¦   «         Š
‰
D ]B\  }}	 ||t          |¦  «        <   Œ# t          $ r t	          t          ‰
¦  «        ¦  «        ‚w xY wŒ†|                     ¦   «         D ]w}| j                             |¦  «        }|rY	  |||         ¦  «        ||<   Œ4# t          $ r6}	t	          d|z   dz   ||         z   dz   t          |	¦  «        z   ¦  «        ‚d }	~	ww xY wŒx|S )Nr   rÛ   rù   c                 ó*   •— g | ]}‰||d z   …         ‘ŒS )rù   r>   )rG   rj   rß  s     €rB   rJ   z*IMAP4Client.__cbStatus.<locals>.<listcomp>o  s&   ø€ ÐKÐKÐK¨a˜˜q 1 q¡5˜yÔ)ÐKÐKÐKrD   ú(rˆ  z): )rÛ  r³   r9   ÚUnicodeDecodeErrorr   rs  r&  ÚSTATUS_TRANSFORMATIONSrû  rS  r–   )r_   rx  rð   re   r�  ra  rÍ  rá  r{  rV  rß  s             @rB   rŽ  zIMAP4Client.__cbStatusi  sy  ø€ Ø‰ˆ�ØˆØð 	Að 	AˆEØ�QŒx˜9Ò$Ð$Ø˜aœ�ØKÐKÐKÐKµ5¸½CÀ¹J¼JÈÑ3JÔ3JÐKÑKÔK�Ø!ð Að A‘D�A�qðAØ23˜�|¨A™œÑ/Ð/øÝ-ð Að Að AÝ3µD¸±K´KÑ@Ô@Ð@ðAøøøøà—’‘”ð 	ð 	ˆAØÔ+×/Ò/°Ñ2Ô2ˆAØð ðØ !  &¨¤)¡¤�F˜1‘I�IøÝ ð ð ð Ý/Ø˜a™ #™¨¨q¬	Ñ1°EÑ9½CÀ¹F¼FÑBñô ð øøøøðøøøðð ˆs$   ÁA&Á&'BÃCÃ
DÃ#1DÄDr>   c           	      óŽ  — |                      dd¦  «         |                     ¦   «         }|                      dd¦  «         |r t          dt          |¦  «        z  ¦  «        }nd}d„ |D ¦   «         }dt	          |¦  «        d                     |¦  «        ||fz  }|                      t          d|d	| j        |¦  «        ¦  «        }|S )
aÆ  
        Add the given message to the given mailbox.

        This command is allowed in the Authenticated and Selected states.

        @type mailbox: L{str}
        @param mailbox: The mailbox to which to add this message.

        @type message: Any file-like object opened in B{binary mode}.
        @param message: The message to add, in RFC822 format.  Newlines
        in this file should be \r\n-style.

        @type flags: Any iterable of L{str}
        @param flags: The flags to associated with this message.

        @type date: L{str}
        @param date: The date to associate with this message.  This should
        be of the format DD-MM-YYYY HH:MM:SS +/-HHMM.  For example, in
        Eastern Standard Time, on July 1st 2004 at half past 1 PM,
        "01-07-2004 13:30:00 -0500".

        @rtype: L{Deferred}
        @return: A deferred whose callback is invoked when this command
        succeeds or whose errback is invoked if it fails.
        r   rù   z "%s"rD   c                 ó,   — g | ]}t          |¦  «        ‘ŒS r>   r9  r:  s     rB   rJ   z&IMAP4Client.append.<locals>.<listcomp>¢  ó    € Ð>Ð>Ð>°� dÑ+Ô+Ð>Ð>Ð>rD   s   %b (%b)%b {%d}rõ   s   APPENDr>   )	rÅ   Útellr:   r9   rß  r—   rƒ  rÖ   Ú_IMAP4Client__cbContinueAppend)	r_   r}  rÄ  rµ  r½  r  r�  rb  r  s	            rB   rt   zIMAP4Client.append€  sØ   € ð4 	�Š�Q˜ÑÔÐØ�LŠL‰NŒNˆØ�Š�Q˜ÑÔÐØð 	Ý  ­<¸Ñ+=Ô+=Ñ!=Ñ>Ô>ˆDˆDàˆDà>Ð>¸Ð>Ñ>Ô>ˆàÝ Ñ(Ô(Ø�IŠI�lÑ#Ô#ØØð	#
ñ 
ˆð ×ÒÝ�I˜s B¨Ô(?ÀÑIÔIñ
ô 
ˆð ˆrD   c                 ó�   — t          j        ¦   «         }|                     || j        d ¦  «                             | j        ¦  «        S rv   )r3   Ú
FileSenderÚbeginFileTransferrÌ   rp  Ú_IMAP4Client__cbFinishAppend)r_   rð   rÄ  rÒ   s       rB   Ú__cbContinueAppendzIMAP4Client.__cbContinueAppend°  sB   € ÝÔÑÔˆØ×"Ò" 7¨D¬N¸DÑAÔA×MÒMØÔ!ñ
ô 
ð 	
rD   c                 ó0   — |                       d¦  «         d S r  rØ  )r_   Úfoos     rB   Ú__cbFinishAppendzIMAP4Client.__cbFinishAppend¶  s   € Ø�Š�cÑÔÐÐÐrD   c                 óF   — |                       t          d¦  «        ¦  «        S )a  
        Tell the server to perform a checkpoint

        This command is allowed in the Selected state.

        @rtype: L{Deferred}
        @return: A deferred whose callback is invoked when this command
        succeeds or whose errback is invoked if it fails.
        s   CHECK©rƒ  rÖ   rd   s    rB   r|  zIMAP4Client.check¹  s    € ð ×Ò¥¨Ñ 1Ô 1Ñ2Ô2Ð2rD   c                 óF   — |                       t          d¦  «        ¦  «        S )aý  
        Return the connection to the Authenticated state.

        This command is allowed in the Selected state.

        Issuing this command will also remove all messages flagged \Deleted
        from the selected mailbox if it is opened in read-write mode,
        otherwise it indicates success by no messages are removed.

        @rtype: L{Deferred}
        @return: A deferred whose callback is invoked when the command
        completes successfully or whose errback is invoked if it fails.
        s   CLOSEr!  rd   s    rB   r>  zIMAP4Client.closeÅ  s    € ð ×Ò¥¨Ñ 1Ô 1Ñ2Ô2Ð2rD   c                 óŠ   — d}d}|                       t          ||¬¦  «        ¦  «        }|                     | j        ¦  «         |S )aý  
        Return the connection to the Authenticate state.

        This command is allowed in the Selected state.

        Issuing this command will perform the same actions as issuing the
        close command, but will also generate an 'expunge' response for
        every message deleted.

        @rtype: L{Deferred}
        @return: A deferred whose callback is invoked with a list of the
        'expunge' responses when this command is successful or whose errback
        is invoked otherwise.
        rß   )rß   r…  )rƒ  rÖ   rp  Ú_IMAP4Client__cbExpungerÍ  s       rB   r²  zIMAP4Client.expungeÕ  sH   € ð ˆØˆØ×Ò�W S°tÐ<Ñ<Ô<Ñ=Ô=ˆØ	�Š�dÔ&Ñ'Ô'Ð'ØˆrD   c                 óº   — |\  }}g }|D ]P}t          |¦  «        dk    r;|d         dk    r/|                     |                      |d         |¦  «        ¦  «         ŒQ|S )Nrù   r;   rß   r   )r³   rt   ræ  )r_   rx  rð   re   rÓ  ra  s         rB   r¿  zIMAP4Client.__cbExpungeê  sh   € Ø‰ˆ�ØˆØð 	>ð 	>ˆEÝ�5‰zŒz˜QŠˆ 5¨¤8¨zÒ#9Ð#9Ø—
’
˜4×+Ò+¨E°!¬H°eÑ<Ô<Ñ=Ô=Ð=øØˆ
rD   rÄ  c                óÔ   — d„ |D ¦   «         }|rdnd}d                      |¦  «        }|                      t          |||f¬¦  «        ¦  «        }|                     | j        ¦  «         |S )a„  
        Search messages in the currently selected mailbox

        This command is allowed in the Selected state.

        Any non-zero number of queries are accepted by this method, as returned
        by the C{Query}, C{Or}, and C{Not} functions.

        @param uid: if true, the server is asked to return message UIDs instead
            of message sequence numbers.
        @type uid: L{bool}

        @rtype: L{Deferred}
        @return: A deferred whose callback will be invoked with a list of all
            the message sequence numbers return by the search, or whose errback
            will be invoked if there is an error.
        c                 ó8   — g | ]}|                      d ¦  «        ‘ŒS )r  r  )rG   r©  s     rB   rJ   z&IMAP4Client.search.<locals>.<listcomp>  s$   € Ð@Ð@Ð@¨u�5—<’< 	Ñ*Ô*Ð@Ð@Ð@rD   s
   UID SEARCHrÜ   rõ   r…  )r—   rƒ  rÖ   rp  Ú_IMAP4Client__cbSearch)r_   ri  Úqueriesrb  rî   r  s         rB   r´  zIMAP4Client.searchò  st   € ð( AÐ@¸Ð@Ñ@Ô@ˆà"Ð1ˆmˆm¨	ˆØ�yŠy˜Ñ!Ô!ˆØ×Ò�W S¨$¸c¸VÐDÑDÔDÑEÔEˆØ	�Š�d”oÑ&Ô&Ð&ØˆrD   c                 ó´   ‡ ‡— |\  }}g }|D ]KŠt          ‰¦  «        dk    r6‰d         dk    r*|                     ˆˆ fd„‰dd …         D ¦   «         ¦  «         ŒL|S )Nr   rÜ   c                 ó<   •— g | ]}‰                      |‰¦  «        ‘ŒS r>   )ræ  )rG   r˜   ra  r_   s     €€rB   rJ   z*IMAP4Client.__cbSearch.<locals>.<listcomp>  s)   ø€ ÐJÐJÐJ¸1˜D×,Ò,¨Q°Ñ6Ô6ÐJÐJÐJrD   r;   )r³   r|   )r_   rx  rð   ra   rÓ  ra  s   `    @rB   rÔ  zIMAP4Client.__cbSearch  sx   øø€ Ø‰ˆ�ØˆØð 	Lð 	LˆEÝ�5‰zŒz˜AŠ~ˆ~ %¨¤(¨iÒ"7Ð"7Ø—
’
ÐJÐJÐJÐJÐJÀÀaÀbÀbÄ	ÐJÑJÔJÑKÔKÐKøØˆ
rD   c                 ó2   — |                       ||d¬¦  «        S )aV  
        Retrieve the unique identifier for one or more messages

        This command is allowed in the Selected state.

        @type messages: L{MessageSet} or L{str}
        @param messages: A message sequence set

        @type uid: L{bool}
        @param uid: Indicates whether the message sequence set is of message
        numbers or of unique message IDs.

        @rtype: L{Deferred}
        @return: A deferred whose callback is invoked with a dict mapping
        message sequence numbers to unique message identifiers, or whose
        errback is invoked if there is an error.
        r;   )ÚuseUIDri  ©Ú_fetch©r_   rk  ri  s      rB   ÚfetchUIDzIMAP4Client.fetchUID  s   € ð$ �{Š{˜8¨C°Qˆ{Ñ7Ô7Ð7rD   c                 ó2   — |                       ||d¬¦  «        S )aH  
        Retrieve the flags for one or more messages

        This command is allowed in the Selected state.

        @type messages: L{MessageSet} or L{str}
        @param messages: The messages for which to retrieve flags.

        @type uid: L{bool}
        @param uid: Indicates whether the message sequence set is of message
        numbers or of unique message IDs.

        @rtype: L{Deferred}
        @return: A deferred whose callback is invoked with a dict mapping
        message numbers to lists of flags, or whose errback is invoked if
        there is an error.
        r;   )r-  rµ  r.  r0  s      rB   Ú
fetchFlagszIMAP4Client.fetchFlags*  s   € ð$ �{Š{˜8¨C°qˆ{Ñ9Ô9Ð9rD   c                 ó2   — |                       ||d¬¦  «        S )a¯  
        Retrieve the internal date associated with one or more messages

        This command is allowed in the Selected state.

        @type messages: L{MessageSet} or L{str}
        @param messages: The messages for which to retrieve the internal date.

        @type uid: L{bool}
        @param uid: Indicates whether the message sequence set is of message
        numbers or of unique message IDs.

        @rtype: L{Deferred}
        @return: A deferred whose callback is invoked with a dict mapping
        message numbers to date strings, or whose errback is invoked
        if there is an error.  Date strings take the format of
        "day-month-year time timezone".
        r;   )r-  Úinternaldater.  r0  s      rB   ÚfetchInternalDatezIMAP4Client.fetchInternalDate>  s   € ð& �{Š{˜8¨C¸aˆ{Ñ@Ô@Ð@rD   c                 ó2   — |                       ||d¬¦  «        S )a–  
        Retrieve the envelope data for one or more messages

        This command is allowed in the Selected state.

        @type messages: L{MessageSet} or L{str}
        @param messages: The messages for which to retrieve envelope
            data.

        @type uid: L{bool}
        @param uid: Indicates whether the message sequence set is of
            message numbers or of unique message IDs.

        @rtype: L{Deferred}
        @return: A deferred whose callback is invoked with a dict
            mapping message numbers to envelope data, or whose errback
            is invoked if there is an error.  Envelope data consists
            of a sequence of the date, subject, from, sender,
            reply-to, to, cc, bcc, in-reply-to, and message-id header
            fields.  The date, subject, in-reply-to, and message-id
            fields are L{str}, while the from, sender, reply-to, to,
            cc, and bcc fields contain address data as L{str}s.
            Address data consists of a sequence of name, source route,
            mailbox name, and hostname.  Fields which are not present
            for a particular address may be L{None}.
        r;   )r-  Úenveloper.  r0  s      rB   ÚfetchEnvelopezIMAP4Client.fetchEnvelopeS  s   € ð6 �{Š{˜8¨C¸!ˆ{Ñ<Ô<Ð<rD   c                 ó2   — |                       ||d¬¦  «        S )aÐ  
        Retrieve the structure of the body of one or more messages

        This command is allowed in the Selected state.

        @type messages: L{MessageSet} or L{str}
        @param messages: The messages for which to retrieve body structure
        data.

        @type uid: L{bool}
        @param uid: Indicates whether the message sequence set is of message
        numbers or of unique message IDs.

        @rtype: L{Deferred}
        @return: A deferred whose callback is invoked with a dict mapping
        message numbers to body structure data, or whose errback is invoked
        if there is an error.  Body structure data describes the MIME-IMB
        format of a message and consists of a sequence of mime type, mime
        subtype, parameters, content id, description, encoding, and size.
        The fields following the size field are variable: if the mime
        type/subtype is message/rfc822, the contained message's envelope
        information, body structure data, and number of lines of text; if
        the mime type is text, the number of lines of text.  Extension fields
        may also be included; if present, they are: the MD5 hash of the body,
        body disposition, body language.
        r;   )r-  Úbodystructurer.  r0  s      rB   ÚfetchBodyStructurezIMAP4Client.fetchBodyStructurep  s   € ð6 �{Š{˜8¨C¸qˆ{ÑAÔAÐArD   c                 ó2   — |                       ||d¬¦  «        S )aÉ  
        Retrieve the simplified body structure of one or more messages

        This command is allowed in the Selected state.

        @type messages: L{MessageSet} or L{str}
        @param messages: A message sequence set

        @type uid: C{bool}
        @param uid: Indicates whether the message sequence set is of message
        numbers or of unique message IDs.

        @rtype: L{Deferred}
        @return: A deferred whose callback is invoked with a dict mapping
        message numbers to body data, or whose errback is invoked
        if there is an error.  The simplified body structure is the same
        as the body structure, except that extension fields will never be
        present.
        r;   )r-  r  r.  r0  s      rB   ÚfetchSimplifiedBodyzIMAP4Client.fetchSimplifiedBody�  s   € ð( �{Š{˜8¨C°aˆ{Ñ8Ô8Ð8rD   c                 ó2   — |                       ||d¬¦  «        S )a)  
        Retrieve one or more entire messages

        This command is allowed in the Selected state.

        @type messages: L{MessageSet} or L{str}
        @param messages: A message sequence set

        @type uid: C{bool}
        @param uid: Indicates whether the message sequence set is of message
        numbers or of unique message IDs.

        @rtype: L{Deferred}

        @return: A L{Deferred} which will fire with a C{dict} mapping message
            sequence numbers to C{dict}s giving message data for the
            corresponding message.  If C{uid} is true, the inner dictionaries
            have a C{'UID'} key mapped to a L{str} giving the UID for the
            message.  The text of the message is a L{str} associated with the
            C{'RFC822'} key in each dictionary.
        r;   )r-  Úrfc822r.  r0  s      rB   ÚfetchMessagezIMAP4Client.fetchMessage£  s   € ð, �{Š{˜8¨C¸ˆ{Ñ:Ô:Ð:rD   c                 ó2   — |                       ||d¬¦  «        S )a<  
        Retrieve headers of one or more messages

        This command is allowed in the Selected state.

        @type messages: L{MessageSet} or L{str}
        @param messages: A message sequence set

        @type uid: L{bool}
        @param uid: Indicates whether the message sequence set is of message
        numbers or of unique message IDs.

        @rtype: L{Deferred}
        @return: A deferred whose callback is invoked with a dict mapping
        message numbers to dicts of message headers, or whose errback is
        invoked if there is an error.
        r;   )r-  Úrfc822headerr.  r0  s      rB   ÚfetchHeaderszIMAP4Client.fetchHeaders»  s   € ð$ �{Š{˜8¨C¸aˆ{Ñ@Ô@Ð@rD   c                 ó2   — |                       ||d¬¦  «        S )aL  
        Retrieve body text of one or more messages

        This command is allowed in the Selected state.

        @type messages: L{MessageSet} or L{str}
        @param messages: A message sequence set

        @type uid: L{bool}
        @param uid: Indicates whether the message sequence set is of message
        numbers or of unique message IDs.

        @rtype: L{Deferred}
        @return: A deferred whose callback is invoked with a dict mapping
        message numbers to file-like objects containing body text, or whose
        errback is invoked if there is an error.
        r;   )r-  Ú
rfc822textr.  r0  s      rB   Ú	fetchBodyzIMAP4Client.fetchBodyÏ  ó   € ð$ �{Š{˜8¨C¸Aˆ{Ñ>Ô>Ð>rD   c                 ó2   — |                       ||d¬¦  «        S )a6  
        Retrieve the size, in octets, of one or more messages

        This command is allowed in the Selected state.

        @type messages: L{MessageSet} or L{str}
        @param messages: A message sequence set

        @type uid: L{bool}
        @param uid: Indicates whether the message sequence set is of message
        numbers or of unique message IDs.

        @rtype: L{Deferred}
        @return: A deferred whose callback is invoked with a dict mapping
        message numbers to sizes, or whose errback is invoked if there is
        an error.
        r;   )r-  Ú
rfc822sizer.  r0  s      rB   Ú	fetchSizezIMAP4Client.fetchSizeã  rH  rD   c           	      ó:   — |                       ||ddddd¬¦  «        S )aV  
        Retrieve several different fields of one or more messages

        This command is allowed in the Selected state.  This is equivalent
        to issuing all of the C{fetchFlags}, C{fetchInternalDate},
        C{fetchSize}, C{fetchEnvelope}, and C{fetchSimplifiedBody}
        functions.

        @type messages: L{MessageSet} or L{str}
        @param messages: A message sequence set

        @type uid: L{bool}
        @param uid: Indicates whether the message sequence set is of message
        numbers or of unique message IDs.

        @rtype: L{Deferred}
        @return: A deferred whose callback is invoked with a dict mapping
        message numbers to dict of the retrieved data values, or whose
        errback is invoked if there is an error.  They dictionary keys
        are "flags", "date", "size", "envelope", and "body".
        r;   )r-  rµ  r5  rJ  r8  r  r.  r0  s      rB   Ú	fetchFullzIMAP4Client.fetchFull÷  s4   € ð, �{Š{ØØØØØØØð ñ 
ô 
ð 	
rD   c                 ó8   — |                       ||dddd¬¦  «        S )a.  
        Retrieve several different fields of one or more messages

        This command is allowed in the Selected state.  This is equivalent
        to issuing all of the C{fetchFlags}, C{fetchInternalDate},
        C{fetchSize}, and C{fetchEnvelope} functions.

        @type messages: L{MessageSet} or L{str}
        @param messages: A message sequence set

        @type uid: L{bool}
        @param uid: Indicates whether the message sequence set is of message
        numbers or of unique message IDs.

        @rtype: L{Deferred}
        @return: A deferred whose callback is invoked with a dict mapping
        message numbers to dict of the retrieved data values, or whose
        errback is invoked if there is an error.  They dictionary keys
        are "flags", "date", "size", and "envelope".
        r;   )r-  rµ  r5  rJ  r8  r.  r0  s      rB   ÚfetchAllzIMAP4Client.fetchAll  s-   € ð* �{Š{Ø˜S¨¸ÀaÐRSð ñ 
ô 
ð 	
rD   c                 ó6   — |                       ||ddd¬¦  «        S )a  
        Retrieve several different fields of one or more messages

        This command is allowed in the Selected state.  This is equivalent
        to issuing all of the C{fetchFlags}, C{fetchInternalDate}, and
        C{fetchSize} functions.

        @type messages: L{MessageSet} or L{str}
        @param messages: A message sequence set

        @type uid: L{bool}
        @param uid: Indicates whether the message sequence set is of message
        numbers or of unique message IDs.

        @rtype: L{Deferred}
        @return: A deferred whose callback is invoked with a dict mapping
        message numbers to dict of the retrieved data values, or whose
        errback is invoked if there is an error.  They dictionary keys are
        "flags", "date", and "size".
        r;   )r-  rµ  r5  rJ  r.  r0  s      rB   Ú	fetchFastzIMAP4Client.fetchFast0  s!   € ð* �{Š{˜8¨C°qÀqÐUVˆ{ÑWÔWÐWrD   c                 ó  ‡
— ˆ
fd„Š
i }g }t          |¦  «        }	 	 t          |¦  «        }n# t          $ r Y �nIw xY w	 t          |¦  «        }n# t          $ r t          d|¦  «        ‚w xY w|dvrd}nPt	          |t
          ¦  «        sd}n8t          |¦  «        dk    rd}n"|rt	          |d         t
          ¦  «        rd}nd}t          |¦  «        }|                     |¦  «         |�rqt          |¦  «        dk     r3d„ |D ¦   «         }|                     |¦  «         |t          |¦  «        f}nQt          |d         ¦  «        }d	„ |d
         D ¦   «         }	|                     ||	g¦  «         ||t          |	¦  «        ff}	 t          |¦  «        }n# t          $ r t          d|¦  «        ‚w xY w| 
                    d¦  «        r–|                     d¦  «        r�	 t          |d
d…         ¦  «         t          |¦  «        }|                     |¦  «         ||fz   }	 t          |¦  «        }n.# t          $ r t          d|¦  «        ‚w xY w# t          $ r Y nw xY w ‰
|¦  «        }|                     |¦  «         |||<   �Œg||fS )a�  
        Given the result of parsing a single I{FETCH} response, construct a
        L{dict} mapping response keys to response values.

        @param fetchResponseList: The result of parsing a I{FETCH} response
            with L{parseNestedParens} and extracting just the response data
            (that is, just the part that comes after C{"FETCH"}).  The form
            of this input (and therefore the output of this method) is very
            disagreeable.  A valuable improvement would be to enumerate the
            possible keys (representing them as structured objects of some
            sort) rather than using strings and tuples of tuples of strings
            and so forth.  This would allow the keys to be documented more
            easily and would allow for a much simpler application-facing API
            (one not based on looking up somewhat hard to predict keys in a
            dict).  Since C{fetchResponseList} notionally represents a
            flattened sequence of pairs (identifying keys followed by their
            associated values), collapsing such complex elements of this
            list as C{["BODY", ["HEADER.FIELDS", ["SUBJECT"]]]} into a
            single object would also greatly simplify the implementation of
            this method.

        @return: A C{dict} of the response data represented by C{pairs}.  Keys
            in this dictionary are things like C{"RFC822.TEXT"}, C{"FLAGS"}, or
            C{("BODY", ("HEADER.FIELDS", ("SUBJECT",)))}.  Values are entirely
            dependent on the key with which they are associated, but retain the
            same structured as produced by L{parseNestedParens}.
        c                 ó¢   •— t          | t          ¦  «        r|                      d¦  «        S t          | t          ¦  «        rˆfd„| D ¦   «         S d S )Nr  c                 ó&   •— g | ]} ‰|¦  «        ‘ŒS r>   r>   )rG   ÚsubthingÚnativeStringResponses     €rB   rJ   zNIMAP4Client._parseFetchPairs.<locals>.nativeStringResponse.<locals>.<listcomp>q  s%   ø€ ÐMÐMÐM¸8Ð,Ð,¨XÑ6Ô6ÐMÐMÐMrD   )rZ   rì  rÒ  r[   )ÚthingrV  s    €rB   rV  z:IMAP4Client._parseFetchPairs.<locals>.nativeStringResponsem  sa   ø€ Ý˜%¥Ñ'Ô'ð NØ—|’| IÑ.Ô.Ð.Ý˜E¥4Ñ(Ô(ð NØMÐMÐMÐMÀuÐMÑMÔMÐMðNð NrD   Ts   Not enough arguments)ó   BODYs	   BODY.PEEKFrù   r   c                 ó,   — g | ]}t          |¦  «        ‘ŒS r>   r˜  ©rG   rá  s     rB   rJ   z0IMAP4Client._parseFetchPairs.<locals>.<listcomp>´  s   € Ð<Ð<Ð<°�\¨!™_œ_Ð<Ð<Ð<rD   c                 ó,   — g | ]}t          |¦  «        ‘ŒS r>   r˜  rZ  s     rB   rJ   z0IMAP4Client._parseFetchPairs.<locals>.<listcomp>º  s   € Ð CÐ CÐ C°Q¥¨a¡¤Ð CÐ CÐ CrD   r;   ó   <ó   >r   )rh  rp  rs  r   rZ   r[   r³   r9   rt   rë  rº  rÄ  r—  rg   )r_   ÚfetchResponseListr\  ÚunstructuredÚresponsePartsro   ri   Ú
hasSectionÚ	valueHeadÚ	valueTailrV  s             @rB   r~  zIMAP4Client._parseFetchPairsG  sd  ø€ ðL	Nð 	Nð 	Nð 	Nð 	Nð ˆØˆåÐ.Ñ/Ô/ˆðb	 ðÝ˜=Ñ)Ô)��øÝ ð ð ð Ø‘ðøøøðXÝ˜]Ñ+Ô+��øÝ ð Xð Xð XÝ+Ð,CÐEVÑWÔWÐWðXøøøð4 Ð1Ð1Ð1ð #�
�
Ý ¥tÑ,Ô,ð "ð #�
�
Ý�U‘”˜a’�à"�
�
Øð "�: e¨A¤hµÑ5Ô5ð "ð #�
�
ð "�
õ
 ˜sÑ#Ô#ˆCØ×Ò Ñ$Ô$Ð$àñ #Ý�u‘:”: ’>�>Ø<Ð<°eÐ<Ñ<Ô<�EØ ×'Ò'¨Ñ.Ô.Ð.à¥ e¡¤Ð-�C�Cå ,¨U°1¬XÑ 6Ô 6�IØ CÐ C¸%À¼(Ð CÑ CÔ C�IØ ×'Ò'¨°IÐ(>Ñ?Ô?Ð?à ­E°)Ñ,<Ô,<Ð =Ð>�CðÝ  Ñ/Ô/�E�EøÝ$ð ð ð Ý/Ø/Ð1Bñô ð ðøøøð ×#Ò# DÑ)Ô)ð ¨e¯nªn¸TÑ.BÔ.Bð ðÝ˜E ! B $œKÑ(Ô(Ð(õ
 !-¨UÑ 3Ô 3˜Ø$×+Ò+¨EÑ2Ô2Ð2Ø! U H™n˜ðÝ$(¨Ñ$7Ô$7˜E˜EøÝ,ð ð ð Ý"7Ø 7Ð9Jñ#ô #ð ðøøøøõ &ð ð ð à˜ðøøøð )Ð(¨Ñ/Ô/ˆEØ×Ò Ñ&Ô&Ð&ØˆF�3‰KñEb	 ðH �|Ð#Ð#sA   œ, ¬
:¹:¾A ÁA)ÆF ÆF-ÇI ÈH- È-IÉ
IÉIc                 óø  — |\  }}i }|D ]u}t          |¦  «        dk    r`|d         dk    rT|                      |d         |¦  «        }||vr|d         g||<   ŒN||         d                              |d         ¦  «         Œvi }	i }
|                     ¦   «         D ]|\  }}|                      |d         ¦  «        \  }}|
                     |g g¦  «        d                              |¦  «         |	                     |i ¦  «                             |¦  «         Œ}|
}i }t          |	                     ¦   «         ¦  «        D ]¤}|	|         }t          |                     ¦   «         ¦  «        D ]x}||vrr|dk    rl|d         ||<   t          t          ||         d         ¦  «        ¦  «        D ]0}||         d         |         dk    r||         d         ||dz   …=  nŒ1|d= |s|	|= ŒyŒ¥|r|  
                    |¦  «         |r|	S |S )NrX  r;   rà   r   rù   r}  )r³   ræ  r|   rß  r~  r  Úupdater[   r&  rÛ  rü  )r_   rx  ÚrequestedPartsÚ
structuredrð   re   Úinfora  rè  ro  ÚdecodedInfoÚ	messageIdr\  ÚstructuredMapÚunstructuredListÚflagChangesrª  rj   s                     rB   Ú_cbFetchzIMAP4Client._cbFetchÝ  sN  € Ø‰ˆ�ØˆØð 	1ð 	1ˆEÝ�5‰zŒz˜QŠˆ 5¨¤8¨xÒ#7Ð#7Ø×%Ò% e¨A¤h°Ñ6Ô6�Ø˜T�>�>Ø % a¤˜z�D˜‘H�Hà˜”H˜Q”K×&Ò& u¨Q¤xÑ0Ô0Ð0øàˆØˆØ!%§¢¡¤ð 	Dð 	DÑˆI�vØ.2×.CÒ.CÀFÈ1ÄIÑ.NÔ.NÑ+ˆMÐ+Ø×"Ò" 9¨r¨dÑ3Ô3°AÔ6×=Ò=Ð>NÑOÔOÐOØ×Ò˜y¨"Ñ-Ô-×4Ò4°]ÑCÔCÐCÐCØˆàˆÝ˜gŸlšl™nœnÑ-Ô-ð 	/ð 	/ˆIØ˜YÔ'ˆFÝ˜VŸ[š[™]œ]Ñ+Ô+ð 
/ð 
/�Ø˜~Ð-Ð-°$¸'²/°/Ø-3°G¬_�K 	Ñ*å"¥3 t¨I¤°qÔ'9Ñ#:Ô#:Ñ;Ô;ð "ð "˜Ø 	œ?¨1Ô-¨aÔ0°GÒ;Ð;Ø $ Y¤°Ô 2°1°q¸1±u°9Ð =Ø!˜Eð <ð ˜w˜Ø!ð /Ø# IÐ.øð
/ð ð 	+Ø×Ò˜kÑ*Ô*Ð*àð 	ØˆNàˆKrD   c	                 ó  — d}	|€d}
nMt          |t          ¦  «        rt          |¦  «        }
n(d                     t	          t          |¦  «        ¦  «        }
|€d}n
|
rd|z   }n|}|r"|dv r|�dd                     |¦  «        z  }nd}nd}|€d}nd	||fz  }|rd
pd}|	||rdpd|
|||fz  }|                     d¦  «        }|                      t          ||d¬¦  «        ¦  «        }|                     | j	        dd¦  «         |S )a^  
        Retrieve a specific section of one or more messages

        @type messages: L{MessageSet} or L{str}
        @param messages: A message sequence set

        @type uid: L{bool}
        @param uid: Indicates whether the message sequence set is of message
            numbers or of unique message IDs.

        @type headerType: L{str}
        @param headerType: If specified, must be one of HEADER, HEADER.FIELDS,
            HEADER.FIELDS.NOT, MIME, or TEXT, and will determine which part of
            the message is retrieved.  For HEADER.FIELDS and HEADER.FIELDS.NOT,
            C{headerArgs} must be a sequence of header names.  For MIME,
            C{headerNumber} must be specified.

        @type headerNumber: L{int} or L{int} sequence
        @param headerNumber: The nested rfc822 index specifying the entity to
            retrieve.  For example, C{1} retrieves the first entity of the
            message, and C{(2, 1, 3}) retrieves the 3rd entity inside the first
            entity inside the second entity of the message.

        @type headerArgs: A sequence of L{str}
        @param headerArgs: If C{headerType} is HEADER.FIELDS, these are the
            headers to retrieve.  If it is HEADER.FIELDS.NOT, these are the
            headers to exclude from retrieval.

        @type peek: C{bool}
        @param peek: If true, cause the server to not set the \Seen flag on
            this message as a result of this command.

        @type offset: L{int}
        @param offset: The number of octets at the beginning of the result to
            skip.

        @type length: L{int}
        @param length: The number of octets to retrieve.

        @rtype: L{Deferred}
        @return: A deferred whose callback is invoked with a mapping of message
            numbers to retrieved data, or whose errback is invoked if there is
            an error.
        z%s BODY%s[%s%s%s]%sNrø  ú.)zHEADER.FIELDSzHEADER.FIELDS.NOTz (%s)rˆ  z ()z<%d.%d>ó	   UID FETCHrà   z.PEEKr  ©rà   r…  r>   F)
rZ   r—  r–   r—   rt  rW  rƒ  rÖ   rp  rn  )r_   rk  ri  Ú
headerTypeÚheaderNumberÚ
headerArgsÚpeekÚoffsetÚlengthÚfmtÚnumberr­  ÚpayloadÚextrarÈ  rb  r  s                    rB   ÚfetchSpecificzIMAP4Client.fetchSpecific  sT  € ðn $ˆØÐØˆFˆFÝ˜¥cÑ*Ô*ð 	6Ý˜Ñ&Ô&ˆFˆFà—X’X�c¥# |Ñ4Ô4Ñ5Ô5ˆFØÐØˆFˆFØð 	 Ø˜:Ñ%ˆFˆFàˆFØð 	�jÐ$JÐJÐJØÐ%Ø! C§H¢H¨ZÑ$8Ô$8Ñ8��à��àˆGØˆ>ØˆEˆEà ¨Ð 0Ñ0ˆEØÐ$˜Ð0¨ˆØ�X˜tÐ/¨Ð5°2°v¸vÀwÐPUÐVÑVˆð �jŠj˜Ñ#Ô#ˆà×Ò�W U¨C¸kÐJÑJÔJÑKÔKˆØ	�Š�d”m R¨Ñ/Ô/Ð/ØˆrD   c                 óÀ  — t          |¦  «                             d¦  «        }|rdpd}d|v r|d= d|d<   d|v r|d= d|d<   d	|v r|d	= d|d
<   d„ |D ¦   «         }|dz   d                     d„ |D ¦   «         ¦  «        z   dz   }|                      t	          ||d¬¦  «        ¦  «        }|                     | j        d„ |                     ¦   «         D ¦   «         d¦  «         |S )Nrg  rq  rà   rF  Túrfc822.textrJ  úrfc822.sizerC  úrfc822.headerc                 ó,   — g | ]}t          |¦  «        ‘ŒS r>   r9  r7  s     rB   rJ   z&IMAP4Client._fetch.<locals>.<listcomp>r  s    € Ð8Ð8Ð8¨Q� aÑ(Ô(Ð8Ð8Ð8rD   rŒ  rõ   c                 ó6   — g | ]}|                      ¦   «         ‘ŒS r>   ©r^  r7  s     rB   rJ   z&IMAP4Client._fetch.<locals>.<listcomp>s  s    € Ð+LÐ+LÐ+L¸!¨A¯GªG©I¬IÐ+LÐ+LÐ+LrD   r¢  rr  r…  c                 ó6   — g | ]}|                      ¦   «         ‘ŒS r>   r„  )rG   r{  s     rB   rJ   z&IMAP4Client._fetch.<locals>.<listcomp>v  s    € Ð%FÐ%FÐ%F°A a§g¢g¡i¤iÐ%FÐ%FÐ%FrD   )r–   rW  r—   rƒ  rÖ   rp  rn  r&  )r_   rk  r-  ÚtermsrÈ  ÚencodedTermsrb  r  s           rB   r/  zIMAP4Client._fetcha  s  € Ý�x‘=”=×'Ò'¨Ñ0Ô0ˆØÐ'˜<Ð3¨8ˆà˜5Ð Ð Ø�lÐ#Ø#'ˆE�-Ñ Ø˜5Ð Ð Ø�lÐ#Ø#'ˆE�-Ñ Ø˜UÐ"Ð"Ø�nÐ%Ø%)ˆE�/Ñ"ð
 9Ð8°%Ð8Ñ8Ô8ˆØ˜Ñ §¢Ð+LÐ+L¸|Ð+LÑ+LÔ+LÑ!MÔ!MÑMÐPTÑTˆà×Ò�W U¨C¸kÐJÑJÔJÑKÔKˆØ	�Š�d”mÐ%FÐ%F¸¿º¹¼Ð%FÑ%FÔ%FÈÑMÔMÐMØˆrD   c                 ó4   — |                       |d|||¦  «        S )a  
        Set the flags for one or more messages.

        This command is allowed in the Selected state.

        @type messages: L{MessageSet} or L{str}
        @param messages: A message sequence set

        @type flags: Any iterable of L{str}
        @param flags: The flags to set

        @type silent: L{bool}
        @param silent: If true, cause the server to suppress its verbose
        response.

        @type uid: L{bool}
        @param uid: Indicates whether the message sequence set is of message
        numbers or of unique message IDs.

        @rtype: L{Deferred}
        @return: A deferred whose callback is invoked with a list of the
        server's responses (C{[]} if C{silent} is true) or whose
        errback is invoked if there is an error.
        rØ   ©Ú_store©r_   rk  rµ  rÉ  ri  s        rB   ÚsetFlagszIMAP4Client.setFlagsy  s   € ð2 �{Š{˜8 X¨v°u¸cÑBÔBÐBrD   c                 ó4   — |                       |d|||¦  «        S )a  
        Add to the set flags for one or more messages.

        This command is allowed in the Selected state.

        @type messages: C{MessageSet} or L{str}
        @param messages: A message sequence set

        @type flags: Any iterable of L{str}
        @param flags: The flags to set

        @type silent: C{bool}
        @param silent: If true, cause the server to suppress its verbose
        response.

        @type uid: C{bool}
        @param uid: Indicates whether the message sequence set is of message
        numbers or of unique message IDs.

        @rtype: L{Deferred}
        @return: A deferred whose callback is invoked with a list of the
        server's responses (C{[]} if C{silent} is true) or whose
        errback is invoked if there is an error.
        s   +FLAGSr‰  r‹  s        rB   ÚaddFlagszIMAP4Client.addFlags”  ó   € ð2 �{Š{˜8 Y°¸¸sÑCÔCÐCrD   c                 ó4   — |                       |d|||¦  «        S )a  
        Remove from the set flags for one or more messages.

        This command is allowed in the Selected state.

        @type messages: L{MessageSet} or L{str}
        @param messages: A message sequence set

        @type flags: Any iterable of L{str}
        @param flags: The flags to set

        @type silent: L{bool}
        @param silent: If true, cause the server to suppress its verbose
        response.

        @type uid: L{bool}
        @param uid: Indicates whether the message sequence set is of message
        numbers or of unique message IDs.

        @rtype: L{Deferred}
        @return: A deferred whose callback is invoked with a list of the
        server's responses (C{[]} if C{silent} is true) or whose
        errback is invoked if there is an error.
        s   -FLAGSr‰  r‹  s        rB   ÚremoveFlagszIMAP4Client.removeFlags¯  r�  rD   c                 ól  — t          |¦  «                             d¦  «        }d„ |D ¦   «         }|r|dz   }|rdpd}d                     ||dd                     |¦  «        z   dz   f¦  «        }|                      t	          ||d	¬
¦  «        ¦  «        }	d}
|sd}
|	                     | j        |
d¦  «         |	S )Nrg  c                 ó,   — g | ]}t          |¦  «        ‘ŒS r>   r9  r:  s     rB   rJ   z&IMAP4Client._store.<locals>.<listcomp>Ì  r  rD   s   .SILENTs	   UID STORErð  rõ   r¡  r¢  rr  r…  r>   )r}  T)r–   rW  r—   rƒ  rÖ   rp  rn  )r_   rk  rb  rÉ  rµ  ri  r�  rÅ  rî   r  Úexpecteds              rB   rŠ  zIMAP4Client._storeÊ  sÎ   € Ý�x‘=”=×'Ò'¨Ñ0Ô0ˆØ>Ð>¸Ð>Ñ>Ô>ˆØð 	#Ø˜
Ñ"ˆCØÐ$˜Ð0¨ˆØ�yŠy˜( C¨°·	²	¸,Ñ0GÔ0GÑ)GÈ$Ñ)NÐOÑPÔPˆØ×Ò�W U¨D¸{ÐKÑKÔKÑLÔLˆØˆØð 	"Ø!ˆHØ	�Š�d”m X¨tÑ4Ô4Ð4ØˆrD   c                 óâ   — t          |¦  «                             d¦  «        }|rd}nd}d                     |t          |¦  «        g¦  «        }|                      t          ||¦  «        ¦  «        S )a”  
        Copy the specified messages to the specified mailbox.

        This command is allowed in the Selected state.

        @type messages: L{MessageSet} or L{str}
        @param messages: A message sequence set

        @type mailbox: L{str}
        @param mailbox: The mailbox to which to copy the messages

        @type uid: C{bool}
        @param uid: If true, the C{messages} refers to message UIDs, rather
        than message sequence numbers.

        @rtype: L{Deferred}
        @return: A deferred whose callback is invoked with a true value
        when the copy is successful, or whose errback is invoked if there
        is an error.
        rg  s   UID COPYrï  rõ   )r–   rW  r—   rß  rƒ  rÖ   )r_   rk  r}  ri  rb  rî   s         rB   r  zIMAP4Client.copyØ  sn   € õ* �x‘=”=×'Ò'¨Ñ0Ô0ˆØð 	ØˆCˆCàˆCØ�yŠy˜(Õ$7¸Ñ$@Ô$@ÐAÑBÔBˆØ×Ò¥¨¨TÑ 2Ô 2Ñ3Ô3Ð3rD   c                 ó   — dS ©zOverride meNr>   rô  s     rB   rö  zIMAP4Client.modeChangedø  rº  rD   c                 ó   — dS r—  r>   )r_   rú  s     rB   rü  zIMAP4Client.flagsChangedû  rº  rD   c                 ó   — dS r—  r>   rþ  s      rB   r  zIMAP4Client.newMessagesþ  rº  rD   rv   ©r;   )r>   Nr  )r   NNNNNN)r;   r   )ir¢   r£   r¤   r¥   r-  ru  rF  rh  rA  r(  r8  r†  rÀ   rG  ÚSTATUS_CODESr—  r  rH  rb   rN  rH  rX  r2  r6  rK  rC  r_  rV  ri  r_  rl  rs  rq  rw  rv  rƒ  r‰  rp  r  r�  r–  r•  r  rê  r¢  r«  r¬  rú  ro  r�  r¶  rŸ  rÀ  rÁ  rÎ  rÌ  r+  rã  ræ  rà  rP  rV  r]  rb  rf  r[   r   rú  r
  r�  r  rt   r  r  r|  r>  r²  r$  r´  r(  r1  r3  r6  r9  r<  r>  rA  rD  rG  rK  rM  rO  rQ  r~  rn  r}  r/  rŒ  rŽ  r‘  rŠ  r  rö  rü  r  r>   rD   rB   r<  r<  n	  ss  € € € € € ðð ð €DØ€GØ€FØ€EØ€Eà€Jð €Gð
 €Ià'Ðð €Nà8€Là*-¸ÈÐLÐLÐà€Gðð ð ð ð;ð ;ð ;ð5ð 5ð 5ð.ð ð ð*ð *ð *ð.ð .ð .ð$(,ð (,ð (,ðT(ð (ð (ð(ð (ð (ðð ð ð ð ð ð
,ð ,ð ,ð,ð ,ð ,ð.(ð (ð (ð#ð #ð #ð8ð ð ð-ð -ð -ð8
ð 
ð 
ðð ð ð ð2ð ð ð*ð ð ðð ð ðð ð ðð ð ð1ð 1ð 1ð 1ðfð ð ð"ð ð ð8	5ð 	5ð 	5ðKð Kð Kðð ð ð2ð ð ð.ð .ð .ð=ð =ð =ð2ð ð ð9ð 9ð 9ðð ð ðð ð ð*ð ð ð6'ð 'ð 'ðR,ð ,ð ,ð\	0ð 	0ð 	0ð7ð 7ð 7ðrOð Oð OðOð Oð OðSð Sð Sð(Rð Rð RðTð Tð Tð!ð !ð !ðFð ð ð8ð ð ð6	ð 	ð
ð	ñ 	ô 	€Lð!ð !ð !ðFð ð ð..ð .ð .ð .ð`
ð 
ð 
ðð ð ð
3ð 
3ð 
3ð3ð 3ð 3ð ð ð ð*ð ð ð $)ð ð ð ð ð ð8ð ð ð8ð 8ð 8ð 8ð(:ð :ð :ð :ð(Að Að Að Að*=ð =ð =ð =ð:Bð Bð Bð Bð:9ð 9ð 9ð 9ð,;ð ;ð ;ð ;ð0Að Að Að Að(?ð ?ð ?ð ?ð(?ð ?ð ?ð ?ð(
ð 
ð 
ð 
ð@
ð 
ð 
ð 
ð2Xð Xð Xð Xð.T$ð T$ð T$ðl(ð (ð (ðZ ØØØØØØðXð Xð Xð Xðtð ð ð ð0Cð Cð Cð Cð6Dð Dð Dð Dð6Dð Dð Dð Dð6ð ð ð4ð 4ð 4ð@ð ð ðð ð ðð ð ð ð rD   r<  c                 ó¦  — t          ¦   «         }|                      d¦  «        }|D �])}d|v r¾|                     dd¦  «        \  }}	 |dk    rd}nt          |¦  «        }|dk    rd}nt          |¦  «        }||cxu r€n nt          |¦  «        ‚|�|dk    s|�|dk    rt          |¦  «        ‚|p|}|p|}|                     ||¦  «         Œ¨# t
          $ r t          |¦  «        ‚w xY w	 |dk    rd}nt          |¦  «        }|�|dk    rt          |¦  «        ‚|                     |p|¦  «         �Œ# t
          $ r t          |¦  «        ‚w xY w|S )aé  
    Parse a message set search key into a C{MessageSet}.

    @type s: L{bytes}
    @param s: A string description of an id list, for example "1:3, 4:*"

    @type lastMessageId: L{int}
    @param lastMessageId: The last message sequence id or UID, depending on
        whether we are parsing the list in UID or sequence id context. The
        caller should pass in the correct value.

    @rtype: C{MessageSet}
    @return: A C{MessageSet} that contains the ids defined in the list
    ó   ,ó   :r;   rÚ  Nr   )rN   r\  r—  r   r]   rg   r|   )rÒ   râ  ry   ra  r˜   rk   rl   s          rB   r¬  r¬    s·  € õ ‰,Œ,€CØ�GŠG�D‰MŒM€EØð $/ñ $/ˆØ�1ˆ9ˆ9ØŸš  aÑ(Ô(‰IˆC�ð0Ø˜$’;�;Ø�C�Cå˜c™(œ(�CØ˜4’<�<Ø�D�Då˜t™9œ9�DØ˜$Ð&Ð&Ð&Ð&Ð&Ð&Ð&Ð&å0°Ñ3Ô3Ð3à�O¨¨qª¨°dÐ6FÈ4ÐSTÊ9È9Ý0°Ñ3Ô3Ð3àÐ,˜}�ØÐ*˜]�à—’˜˜TÑ"Ô"Ð"Ð"øÝð 0ð 0ð 0Ý,¨QÑ/Ô/Ð/ð0øøøð
/Ø˜’9�9Ø�A�Aå˜A™œ�AØ�= Q¨!¢V VÝ0°Ñ3Ô3Ð3ð —
’
˜1Ð- Ñ.Ô.Ð.Ñ.øõ ð 0ð 0ð 0Ý,¨QÑ/Ô/Ð/ð0øøøð €Js   ÁBCÃC(Ã,/D4Ä4E)ÚALLÚANSWEREDÚDELETEDÚDRAFTÚFLAGGEDÚNEWÚOLDrC  ÚSEENÚ
UNANSWEREDÚ	UNDELETEDÚUNDRAFTÚ	UNFLAGGEDrD  )ÚLARGERÚSMALLERÚUIDc           	      óª  — g }|                      ¦   «         }| rt          |¦  «        }|D �]f}||         }|                     ¦   «         }|t          v r|r|                     |¦  «         Œ@|dk    r?|                     |t          |d         ¦  «        t          |d         ¦  «        g¦  «         Œ…|dk    s|dk    r3t                               d|¦  «        }|                     ||g¦  «         ŒÄ|t          vrOt          |t          ¦  «        rd}nt          |t          ¦  «        rd}nd}|                     |||fz  g¦  «         �Œt          |t          ¦  «        r|                     |d	|fz  g¦  «         �ŒN|                     ||› g¦  «         �Œht          |¦  «        dk    rd
d                     |¦  «        z   dz   S d                     |¦  «        S )a  
    Create a query string

    Among the accepted keywords are::

        all         : If set to a true value, search all messages in the
                      current mailbox

        answered    : If set to a true value, search messages flagged with
                      \Answered

        bcc         : A substring to search the BCC header field for

        before      : Search messages with an internal date before this
                      value.  The given date should be a string in the format
                      of 'DD-Mon-YYYY'.  For example, '03-Mar-2003'.

        body        : A substring to search the body of the messages for

        cc          : A substring to search the CC header field for

        deleted     : If set to a true value, search messages flagged with
                      \Deleted

        draft       : If set to a true value, search messages flagged with
                      \Draft

        flagged     : If set to a true value, search messages flagged with
                      \Flagged

        from        : A substring to search the From header field for

        header      : A two-tuple of a header name and substring to search
                      for in that header

        keyword     : Search for messages with the given keyword set

        larger      : Search for messages larger than this number of octets

        messages    : Search only the given message sequence set.

        new         : If set to a true value, search messages flagged with
                      \Recent but not \Seen

        old         : If set to a true value, search messages not flagged with
                      \Recent

        on          : Search messages with an internal date which is on this
                      date.  The given date should be a string in the format
                      of 'DD-Mon-YYYY'.  For example, '03-Mar-2003'.

        recent      : If set to a true value, search for messages flagged with
                      \Recent

        seen        : If set to a true value, search for messages flagged with
                      \Seen

        sentbefore  : Search for messages with an RFC822 'Date' header before
                      this date.  The given date should be a string in the format
                      of 'DD-Mon-YYYY'.  For example, '03-Mar-2003'.

        senton      : Search for messages with an RFC822 'Date' header which is
                      on this date  The given date should be a string in the format
                      of 'DD-Mon-YYYY'.  For example, '03-Mar-2003'.

        sentsince   : Search for messages with an RFC822 'Date' header which is
                      after this date.  The given date should be a string in the format
                      of 'DD-Mon-YYYY'.  For example, '03-Mar-2003'.

        since       : Search for messages with an internal date that is after
                      this date..  The given date should be a string in the format
                      of 'DD-Mon-YYYY'.  For example, '03-Mar-2003'.

        smaller     : Search for messages smaller than this number of octets

        subject     : A substring to search the 'subject' header for

        text        : A substring to search the entire message for

        to          : A substring to search the 'to' header for

        uid         : Search only the messages in the given message set

        unanswered  : If set to a true value, search for messages not
                      flagged with \Answered

        undeleted   : If set to a true value, search for messages not
                      flagged with \Deleted

        undraft     : If set to a true value, search for messages not
                      flagged with \Draft

        unflagged   : If set to a true value, search for messages not
                      flagged with \Flagged

        unkeyword   : Search for messages without the given keyword set

        unseen      : If set to a true value, search for messages not
                      flagged with \Seen

    @type sorted: C{bool}
    @param sorted: If true, the output will be sorted, alphabetically.
    The standard does not require it, but it makes testing this function
    easier.  The default is zero, and this should be acceptable for any
    application.

    @rtype: L{str}
    @return: The formatted query string
    ÚHEADERr   r;   ÚKEYWORDÚ	UNKEYWORDrø  z"%s"z"%d"z%dr  rˆ  ú))r&  Ú_sortedr^  Ú_SIMPLE_BOOLrt   r|   r–   Ú
_nonAtomRErm  Ú
_NO_QUOTESrZ   rN   r—  r³   r—   )rp   Úkwargrb  r&  rÍ  rá  ry  s          rB   ÚQueryr¸  Q  sÑ  € ð\ €CØ�:Š:‰<Œ<€DØð Ý�t‰}Œ}ˆØð $ñ $ˆØ�!ŒHˆØ�GŠG‰IŒIˆØ•ÐÐ ÐØ�JŠJ�q‰MŒMˆMˆMØ�(Š]ˆ]Ø�JŠJ˜�3˜q œt™9œ9¥c¨!¨A¬$¡i¤iÐ0Ñ1Ô1Ð1Ð1Ø�)Š^ˆ^˜q KÒ/Ð/õ —’˜r 1Ñ%Ô%ˆAØ�JŠJ˜˜1�vÑÔÐÐØ•jÐ Ð Ý˜!�ZÑ(Ô(ð Ø��Ý˜A�sÑ#Ô#ð Ø��à�Ø�JŠJ˜˜3 ! ™:�Ñ'Ô'Ð'Ñ'Ý˜�3ÑÔð 	$Ø�JŠJ˜˜4 1 $™;Ð'Ñ(Ô(Ð(Ñ(à�JŠJ˜˜a˜6�{Ñ#Ô#Ð#Ñ#Ý
ˆ3�x„x�!‚|€|Ø�S—X’X˜c‘]”]Ñ" SÑ(Ð(à�xŠx˜‰}Œ}ÐrD   c                  ó²   — t          | ¦  «        dk     rt          | ¦  «        ‚t          | ¦  «        dk    rd| z  S d| d         › dt          | dd…         Ž › d�S )	z0
    The disjunction of two or more queries
    rù   z
(OR %s %s)z(OR r   rˆ  r;   Nr²  )r³   r   ÚOr)rî   s    rB   rº  rº  â  sd   € õ ˆ4�y„y�1‚}€}Ý Ñ%Ô%Ð%Ý	ˆT‰Œ�aŠˆØ˜dÑ"Ð"à0�d˜1”gÐ0Ð0¥ D¨¨¨¤H Ð0Ð0Ð0Ð0rD   c                 ó   — d| › d�S )zThe negation of a queryz(NOT r²  r>   )r©  s    rB   ÚNotr¼  î  s   € à�5ÐÐÐÐrD   c                 óô   — |                       dd¦  «        } |€|                       dd¦  «        } n+|                       ddt          j        |¦  «        z  ¦  «        } t          j        | t          j        ¦  «        S )Nr”   z(?:.*?)ú%z(?:(?:[^%s])*?))Úreplacer  r  r  ÚI)rü  rw  s     rB   ÚwildcardToRegexprÁ  ó  sl   € Ø×Ò  YÑ/Ô/€HØ€}Ø×#Ò# C¨Ñ3Ô3ˆˆà×#Ò# CÐ):½R¼YÀuÑ=MÔ=MÑ)MÑNÔNˆÝŒ:�h¥¤Ñ%Ô%Ð%rD   c                 ó6  — |                       ¦   «         } g }g }dx}}t          d| ¦  «        }t          d| ¦  «        }t          d| ¦  «        }t          d| ¦  «        }t          t          | ¦  «        ¦  «        D �]E\  }	}
|
|k    ro|	r;| |	dz
  |	…         |k    r*|                     ¦   «          |                     |¦  «         ŒI|sd}ŒNd}|                     |                     |¦  «        ¦  «         g }Œ{|s>|s<|
|t          j         	                    d¦  «        z   vrd}|                     |
¦  «         Œ»|ro|sm|
t          j         	                    d¦  «        v rL|                     |¦  «        }||k    r|                     d	¦  «         n|                     |¦  «         g }d}�Œ,|s|r|                     |
¦  «         �ŒG|rt          | ¦  «        ‚|rF|                     |¦  «        }||k    r|                     d	¦  «         n|                     |¦  «         |S )
aÄ  
    Split a string into whitespace delimited tokens

    Tokens that would otherwise be separated but are surrounded by "
    remain as a single token.  Any token that is not quoted and is
    equal to "NIL" is tokenized as L{None}.

    @type s: L{bytes}
    @param s: The string to be split

    @rtype: L{list} of L{bytes}
    @return: A list of the resulting tokens

    @raise MismatchedQuoting: Raised if an odd number of quotes are present
    Frù  ú\rø  ÚNILr;   Trg  N)r–  r7   rh   r8   rL  rt   r—   ÚstringÚ
whitespacerW  r!   )rÒ   rx  ÚwordÚinQuoteÚinWordÚquÚescr²  Únilrj   rÞ  Úws               rB   ÚsplitQuotedrÎ  ü  sC  € ð  	
�Š‰	Œ	€AØ€FØ€DØÐ€GˆfÝ	˜˜aÑ	 Ô	 €BÝ
˜& !Ñ
$Ô
$€CÝ˜B Ñ"Ô"€EÝ
˜% Ñ
#Ô
#€CÝ�) A™,œ,Ñ'Ô'ð ñ ‰ˆˆ1Ø�Š7ˆ7Øð �Q�q˜1‘u˜q�y”\ SÒ(Ð(Ø—’‘
”
�
Ø—’˜B‘”��Øð Ø��à�Ø—’˜eŸjšj¨Ñ.Ô.Ñ/Ô/Ð/Ø��àð	àð	ð ˜"¥Ô 1× 8Ò 8¸Ñ AÔ AÑBÐCÐCàˆFØ�KŠK˜‰NŒNˆNˆNØð 		˜Gð 		¨­VÔ->×-EÒ-EÀgÑ-NÔ-NÐ(NÐ(NØ—
’
˜4Ñ Ô ˆAØ�CŠxˆxØ—’˜dÑ#Ô#Ð#Ð#à—’˜aÑ Ô Ð ØˆDØˆF‰FØð 	�wð 	Ø�KŠK˜‰NŒNˆNùàð #Ý Ñ"Ô"Ð"Øð Ø�JŠJ�tÑÔˆØ�Š8ˆ8Ø�MŠM˜$ÑÔÐÐà�MŠM˜!ÑÔÐà€MrD   c                 ó@  — g } || d         ¦  «        }| d         g}| dd …         D ]R} ||¦  «        }||k    r*|                       ||         |¦  «        ¦  «         |g}|}Œ=|                     |¦  «         ŒS|                       ||         |¦  «        ¦  «         |S ©Nr   r;   )r|   rt   )ÚsequenceÚ	predicateÚtransformersrx  rÈ  ÚtmprV  r˜   s           rB   ÚsplitOnrÕ  =  sº   € Ø€FØˆ9�X˜a”[Ñ!Ô!€DØ�AŒ;ˆ-€CØ�a�b�bŒ\ð ð ˆØˆI�a‰LŒLˆØ�Š9ˆ9Ø�MŠMÐ,˜, tÔ,¨SÑ1Ô1Ñ2Ô2Ð2Ø�#ˆCØˆDˆDà�JŠJ�q‰MŒMˆMˆMØ
‡M‚MÐ$�,˜tÔ$ SÑ)Ô)Ñ*Ô*Ð*Ø€MrD   c                 ób  — g }d}d„ }d„ d„ dœ}t          | ¦  «        D ]g\  }}t          |t          ¦  «        rI|�) |j        t	          | ||…         ||¦  «        ¦  «         d} |j        t          |¦  «        ¦  «         Œc|€|}Œh|�' |j        t	          | |d…         ||¦  «        ¦  «         |S )a{  
    Turns a list of length-one strings and lists into a list of longer
    strings and lists.  For example,

    ['a', 'b', ['c', 'd']] is returned as ['ab', ['cd']]

    @type results: L{list} of L{bytes} and L{list}
    @param results: The list to be collapsed

    @rtype: L{list} of L{bytes} and L{list}
    @return: A new list which is the collapsed form of C{results}
    Nc                 ó,   — t          | t          ¦  «        S rv   )rZ   rë  ©rV  s    rB   rV   z!collapseStrings.<locals>.<lambda>]  s   € •Z ¥5Ñ)Ô)€ rD   c                 óF   — t          d                     | ¦  «        ¦  «        S r  )rÎ  r—   rØ  s    rB   rV   z!collapseStrings.<locals>.<lambda>_  s   € •[ §¢¨!¡¤Ñ-Ô-€ rD   c                 óB   — d                      d„ | D ¦   «         ¦  «        gS )NrD   c                 ó   — g | ]
}|d          ‘ŒS r  r>   rÏ  s     rB   rJ   z5collapseStrings.<locals>.<lambda>.<locals>.<listcomp>`  s   € Ð0Ð0Ð0¨  !¤Ð0Ð0Ð0rD   )r—   rØ  s    rB   rV   z!collapseStrings.<locals>.<lambda>`  s$   € �c—h’hÐ0Ð0¨aÐ0Ñ0Ô0Ñ1Ô1Ð2€ rD   )r   r;   )rh   rZ   r[   r|   rÕ  rt   ÚcollapseStrings)ro  r  ÚbegunÚpredÚtranrj   rÞ  s          rB   rÜ  rÜ  M  sè   € ð €DØ€Eà)Ð)€Dà-Ð-Ø2Ð2ðð €Dõ ˜'Ñ"Ô"ð ð ‰ˆˆ1Ý�a�ÑÔð 	ØÐ Ø�”�G G¨E°!¨GÔ$4°d¸DÑAÔAÑBÔBÐBØ�ØˆDŒK�¨Ñ*Ô*Ñ+Ô+Ð+Ð+Øˆ]ØˆEøØÐØˆŒ•G˜G E F FœO¨T°4Ñ8Ô8Ñ9Ô9Ð9Ø€KrD   c                 ó^  — |                       ¦   «         } d}g g}	 d}t          | ¦  «        }||k     �r§| ||dz   …         }|r]|dk    r,|d                              | ||dz   …         ¦  «         |dz  }ŒH|dk    r| }|d                              |¦  «         |dz  }�n4|dk    r%|d                              |¦  «         | }|dz  }�n	|r�|dk    r{|                      d|¦  «        }|dk    rt	          d	¦  «        ‚t          | |dz   |…         ¦  «        }|d                              | |d
z   |d
z   |z   …         f¦  «         |d
z   |z   }n†|dk    s|dk    r|                     g ¦  «         |dz  }n_|dk    s|dk    r3|d                              |                     ¦   «         ¦  «         |dz  }n |d                              |¦  «         |dz  }||k     �°§n# t          $ r t          | ¦  «        ‚w xY wt          |¦  «        dk    rt          | ¦  «        ‚t          |d         ¦  «        S )ak  
    Parse an s-exp-like string into a more useful data structure.

    @type s: L{bytes}
    @param s: The s-exp-like string to parse

    @rtype: L{list} of L{bytes} and L{list}
    @return: A list containing the tokens present in the input.

    @raise MismatchedNesting: Raised if the number or placement
    of opening or closing parenthesis is invalid.
    r   r;   r³  r   rù   r‘  r’  r“  r”  rX  r¡  r?  r¢  rn  éþÿÿÿ)
r–  r³   rt   r¤  rg   r—  rL  Ú
IndexErrorr    rÜ  )	rÒ   ÚhandleLiteralrÈ  ÚcontentStackrj   r  rÞ  ra   ÚliteralSizes	            rB   rû   rû   o  s‰  € ð 	
�Š‰	Œ	€AØ€GØ�4€Lð$#ØˆÝ�‰FŒFˆØ�!Še‰eØ�!�a˜!‘e�)”ˆAØð Ø˜’:�:Ø  Ô$×+Ò+¨A¨a°!°a±%¨i¬LÑ9Ô9Ð9Ø˜‘F�AØØ˜$’Y�YØ")˜k�GØ˜RÔ ×'Ò'¨Ñ*Ô*Ð*Ø�Q‘�‘à˜’9�9Ø  Ô$×+Ò+¨AÑ.Ô.Ð.Ø")˜k�GØ˜‘F�A‘AØ"ð  q¨D¢y yØŸ&š&  q™/œ/�CØ˜b’y�yÝ(Ð)<Ñ=Ô=Ð=Ý"% a¨¨A©°¨¤nÑ"5Ô"5�KØ  Ô$×+Ò+¨Q¨s°Q©w¸¸q¹À;Ñ9NÐ/NÔ-OÐ,QÑRÔRÐRØ˜a™ +Ñ-�A�AØ˜$’Y�Y ! t¢) )Ø ×'Ò'¨Ñ+Ô+Ð+Ø˜‘F�A�AØ˜$’Y�Y ! t¢) )Ø  Ô$×+Ò+¨L×,<Ò,<Ñ,>Ô,>Ñ?Ô?Ð?Ø˜‘F�A�Aà  Ô$×+Ò+¨AÑ.Ô.Ð.Ø˜‘F�Að? �!Še‰eøøõ@ ð #ð #ð #Ý Ñ"Ô"Ð"ð#øøøå
ˆ<ÑÔ˜AÒÐÝ Ñ"Ô"Ð"Ý˜<¨œ?Ñ+Ô+Ð+s   ›F?G ÇG5c                 ó®   — t          d| ¦  «        }t          d| ¦  «        }||                      |||z   ¦  «                             |||z   ¦  «        z   |z   S )Nrù  rÃ  )r7   r¿  )rÒ   rÊ  rË  s      rB   rŒ  rŒ  ©  sV   € Ý	˜˜aÑ	 Ô	 €BÝ
˜& !Ñ
$Ô
$€CØ�—	’	˜#˜s S™yÑ)Ô)×1Ò1°"°c¸B±hÑ?Ô?Ñ?À"ÑDÐDrD   rÒ   r’   c                 ó*   — dt          | ¦  «        | fz  S )Ns   {%d}
%b)r³   ©rÒ   s    rB   r•  r•  ¯  s   € Ø�C ™FœF A˜;Ñ&Ð&rD   c                   ó    — e Zd Zd„ Zdefd„ZdS )rs  c                 ó   — || _         d S rv   )ri   )r_   ri   s     rB   rb   zDontQuoteMe.__init__´  s   € ØˆŒ
ˆ
ˆ
rD   r’   c                 ó*   — t          | j        ¦  «        S rv   )r–   ri   rd   s    rB   r™   zDontQuoteMe.__str__·  s   € Ý�4”:‰ŒÐrD   N)r¢   r£   r¤   rb   r–   r™   r>   rD   rB   rs  rs  ³  s>   € € € € € ðð ð ð˜ð ð ð ð ð ð rD   rs  s   (){ %*"c                 óp   — | dk    rdS t          | ¦  «        D ]}|dk     s|dk    r dS |t          v r dS ŒdS )NrD   r;   rõ   ó   r   )r8   Ú_ATOM_SPECIALS)rÒ   rÞ  s     rB   Ú_needsQuoterï  ¾  sY   € ØˆC‚x€xØˆqÝ�q‰\Œ\ð ð ˆØˆwŠ;ˆ;˜!˜gš+˜+Ø�1�1Ø•ÐÐØ�1�1ð àˆ1rD   c                 ó¼   — t          | t          ¦  «        r| S 	 |                      d¦  «        S # t          $ r# t	          j        ¦   «          t          | ¦  «        ‚w xY w)NrU  )rZ   r–   rÒ  rQ  r5   r@  r   ©r.  s    rB   r*  r*  É  sd   € Ý�$�ÑÔð Øˆð+Ø�{Š{˜=Ñ)Ô)Ð)øÝð +ð +ð +ÝŒ‰	Œ	ˆ	Ý$ TÑ*Ô*Ð*ð+øøøs	   ™. ®-Ac                 óÀ   — t          | t          ¦  «        s|                      d¦  «        } |                      d¦  «        } t	          | ¦  «        rt          | ¦  «        S | S )Nr  rU  )rZ   r–   rÒ  rW  rï  rŒ  rñ  s    rB   rß  rß  Ó  sW   € Ý�d�CÑ Ô ð &Ø�{Š{˜9Ñ%Ô%ˆØ�;Š;�}Ñ%Ô%€DÝ�4ÑÔð Ý�d‰|Œ|ÐØ€KrD   c                 óx   — t          d| ¦  «        }t          d| ¦  «        }|| v p|| v pt          | ¦  «        dk    S )Nú
úiè  )r7   r³   )rÒ   ÚcrÚlfs      rB   Ú_needsLiteralrø  Ü  sB   € å	˜˜qÑ	!Ô	!€BÝ	˜˜qÑ	!Ô	!€BØ�ˆ7Ð.�b˜A�gÐ.¥ Q¡¤¨$¢Ð.rD   c           	      óÐ  — g }| D �]Ä}t          |t          ¦  «        r|                     d¦  «        }|€|                     ddg¦  «         ŒGt          |t          ¦  «        r2|                     dt          t          |¦  «        ¦  «        g¦  «         ŒŽt          |t          ¦  «        r|                     d|j        g¦  «         ŒÀt          |t          ¦  «        rkt          |¦  «        r6|                     ddt          |¦  «        fz  t          j        |g¦  «         �Œ|                     dt          |¦  «        g¦  «         �Œ@t          |d¦  «        rJ|                     ¦   «         }|                     ddt          |¦  «        fz  t          j        |g¦  «         �Œš|                     ddt!          |¦  «        z   dz   g¦  «         �ŒÆd	                     |d
d…         ¦  «        S )a°  
    Turn a nested list structure into an s-exp-like string.

    Strings in C{items} will be sent as literals if they contain CR or LF,
    otherwise they will be quoted.  References to None in C{items} will be
    translated to the atom NIL.  Objects with a 'read' attribute will have
    it called on them with no arguments and the returned string will be
    inserted into the output as a literal.  Integers will be converted to
    strings and inserted into the output unquoted.  Instances of
    C{DontQuoteMe} will be converted to strings and inserted into the output
    unquoted.

    This function used to be much nicer, and only quote things that really
    needed to be quoted (and C{DontQuoteMe} did not exist), however, many
    broken IMAP4 clients were unable to deal with this level of sophistication,
    forcing the current behavior to be adopted for practical reasons.

    @type items: Any iterable

    @rtype: L{str}
    rg  Nrõ   s   NILs   {%d}rS  r¡  r¢  rD   r;   )rZ   r–   rW  r|   r—  r:   rs  ri   rì  rø  r³   r  Ú	delimiterrŒ  ÚhasattrrS  r#  r—   )rß  Úpiecesrj   r  s       rB   r#  r#  ã  sÍ  € ð, €FØð Hñ HˆÝ�a�ÑÔð 	"ð —’˜Ñ!Ô!ˆAØˆ9Ø�MŠM˜4 ˜.Ñ)Ô)Ð)Ð)Ý˜�3ÑÔð 	HØ�MŠM˜4¥­s°1©v¬vÑ!6Ô!6Ð7Ñ8Ô8Ð8Ð8Ý˜�;Ñ'Ô'ð 	HØ�MŠM˜4 ¤˜/Ñ*Ô*Ð*Ð*Ý˜�5Ñ!Ô!ð 
	Hå˜QÑÔð 1Ø—’˜t Wµ°A±´¨yÑ%8½+Ô:OÐQRÐSÑTÔTÐTÑTà—’˜t¥V¨A¡Y¤YÐ/Ñ0Ô0Ð0Ñ0Ý�Q˜ÑÔð 	HØ—’‘”ˆAØ�MŠM˜4 ­C°©F¬F¨9Ñ!4µkÔ6KÈQÐOÑPÔPÐPÑPà�MŠM˜4 Õ(;¸AÑ(>Ô(>Ñ!>ÀÑ!EÐFÑGÔGÐGÑGØ�8Š8�F˜1˜2˜2”JÑÔÐrD   c                   ól   — e Zd ZdZdZdZd„ Zd„ Zdd„Zd„ Z	d„ Z
dd	„Zd
„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ ZdS )ÚMemoryAccountWithoutNamespacesNr   c                 ó0   — || _         i | _        g | _        d S rv   )r.  ru  Úsubscriptionsrò  s     rB   rb   z'MemoryAccountWithoutNamespaces.__init__  s   € ØˆŒ	ØˆŒØˆÔÐÐrD   c                 ó4   — | j         }| xj         dz  c_         |S rS   )Útop_id)r_   rè  s     rB   Ú
allocateIDz)MemoryAccountWithoutNamespaces.allocateID  s   € ØŒ[ˆØˆŒ�qÑˆŒØˆ	rD   c                 óà   — t          |                     ¦   «         ¦  «        }|| j        v rt          |¦  «        ‚|€(|                      ||                      ¦   «         ¦  «        }|| j        |<   dS rS   )r*  r^  ru  r   Ú_emptyMailboxr  )r_   r.  r;  s      rB   Ú
addMailboxz)MemoryAccountWithoutNamespaces.addMailbox'  sg   € Ý˜$Ÿ*š*™,œ,Ñ'Ô'ˆØ�4”>Ð!Ð!Ý" 4Ñ(Ô(Ð(Øˆ<Ø×%Ò% d¨D¯OªOÑ,=Ô,=Ñ>Ô>ˆDØ#ˆŒ�tÑØˆqrD   c                 óª  — d„ |                      d¦  «        D ¦   «         }t          dt          |¦  «        ¦  «        D ]C}	 |                      d                     |d |…         ¦  «        ¦  «         Œ4# t
          $ r Y Œ@w xY w	 |                      d                     |¦  «        ¦  «         n(# t
          $ r |                     d¦  «        sY dS Y nw xY wdS )Nc                 ó   — g | ]}|¯|‘ŒS r>   r>   )rG   Úpaths     rB   rJ   z9MemoryAccountWithoutNamespaces.create.<locals>.<listcomp>1  s   € Ð>Ð>Ð>˜$¸Ð>�Ð>Ð>Ð>rD   ú/r;   FT)r\  rÛ  r³   r  r—   r   rÄ  )r_   ÚpathspecÚpathsÚaccums       rB   rP  z%MemoryAccountWithoutNamespaces.create0  sû   € Ø>Ð> (§.¢.°Ñ"5Ô"5Ð>Ñ>Ô>ˆÝ˜1�c %™jœjÑ)Ô)ð 	ð 	ˆEðØ—’ §¢¨¨v°¨v¬Ñ 7Ô 7Ñ8Ô8Ð8Ð8øÝ#ð ð ð Ø�ðøøøð	Ø�OŠO˜CŸHšH U™OœOÑ,Ô,Ð,Ð,øÝð 	ð 	ð 	Ø×$Ò$ SÑ)Ô)ð Ø�u�uðð ð	øøøð ˆts$   Á 0A1Á1
A>Á=A>Â(B+ Â+CÃCc                 ó   — t           ‚rv   )ÚNotImplementedError)r_   r.  rè  s      rB   r  z,MemoryAccountWithoutNamespaces._emptyMailbox>  s   € Ý!Ð!rD   r;   c                 ót   — | j                              t          |                     ¦   «         ¦  «        ¦  «        S rv   )ru  rû  r*  r^  )r_   r.  Ú	readwrites      rB   r+  z%MemoryAccountWithoutNamespaces.selectA  s(   € ØŒ~×!Ò!¥*¨T¯ZªZ©\¬\Ñ":Ô":Ñ;Ô;Ð;rD   c                 ó   — t          |                     ¦   «         ¦  «        }| j                             |¦  «        }|st	          d¦  «        ‚d|                     ¦   «         v rF| j                             ¦   «         D ],}||k    r$|                     |¦  «        rt	          d¦  «        ‚Œ-|                     ¦   «          t          |  
                    |¦  «        ¦  «        dk    rt	          d|› d�¦  «        ‚| j        |= d S )NzNo such mailboxz	\Noselectz<Hierarchically inferior mailboxes exist and \Noselect is setr;   zName "z!" has inferior hierarchical names)r*  r^  ru  rû  r   r@  r&  rº  Údestroyr³   Ú_inferiorNames)r_   r.  r;  Úotherss       rB   rV  z%MemoryAccountWithoutNamespaces.deleteD  s  € Ý˜$Ÿ*š*™,œ,Ñ'Ô'ˆàŒ~×!Ò! $Ñ'Ô'ˆØð 	6Ý"Ð#4Ñ5Ô5Ð5à˜4Ÿ=š=™?œ?Ð*Ð*ð œ.×-Ò-Ñ/Ô/ð ð �Ø˜T’>�> f×&7Ò&7¸Ñ&=Ô&=�>Ý*ØWñô ð øð 	�Š‰Œˆõ ˆt×"Ò" 4Ñ(Ô(Ñ)Ô)¨AÒ-Ð-Ý"Ð#S¨DÐ#SÐ#SÐ#SÑTÔTÐTØŒN˜4Ð Ð Ð rD   c                 ó�  ‡‡— t          ‰                     ¦   «         ¦  «        Št          ‰                     ¦   «         ¦  «        Š‰| j        vrt          ‰¦  «        ‚|                      ‰¦  «        }ˆˆfd„|D ¦   «         }|D ]\  }}|| j        v rt          |¦  «        ‚Œ|D ]"\  }}| j        |         | j        |<   | j        |= Œ#d S )Nc                 óB   •— g | ]}||                      ‰‰d ¦  «        f‘ŒS rš  )r¿  )rG   Úor_  r^  s     €€rB   rJ   z9MemoryAccountWithoutNamespaces.rename.<locals>.<listcomp>b  s.   ø€ ÐLÐLÐL¸Q�a˜Ÿš 7¨G°QÑ7Ô7Ð8ÐLÐLÐLrD   )r*  r^  ru  r#   r  r   )r_   r^  r_  Ú	inferiorsÚoldÚnews    ``   rB   r]  z%MemoryAccountWithoutNamespaces.rename[  sê   øø€ Ý˜WŸ]š]™_œ_Ñ-Ô-ˆÝ˜WŸ]š]™_œ_Ñ-Ô-ˆØ˜$œ.Ð(Ð(Ý Ñ(Ô(Ð(à×'Ò'¨Ñ0Ô0ˆ	ØLÐLÐLÐLÐLÀ)ÐLÑLÔLˆ	à!ð 	,ð 	,‰HˆC�Ø�d”nÐ$Ð$Ý& sÑ+Ô+Ð+ð %ð "ð 	$ð 	$‰HˆC�Ø"&¤.°Ô"5ˆDŒN˜3ÑØ”˜sÐ#Ð#ð	$ð 	$rD   c                 ó–   — g }| j                              ¦   «         D ],}|                     |¦  «        r|                     |¦  «         Œ-|S rv   )ru  r&  rº  rt   )r_   r.  r  Úinfnames       rB   r  z-MemoryAccountWithoutNamespaces._inferiorNamesl  sU   € Øˆ	Ø”~×*Ò*Ñ,Ô,ð 	*ð 	*ˆGØ×!Ò! $Ñ'Ô'ð *Ø× Ò  Ñ)Ô)Ð)øØÐrD   c                 óR   — t          |                     ¦   «         ¦  «        | j        v S rv   )r*  r^  r   rò  s     rB   rq  z+MemoryAccountWithoutNamespaces.isSubscribeds  s    € Ý˜$Ÿ*š*™,œ,Ñ'Ô'¨4Ô+=Ð=Ð=rD   c                 ó’   — t          |                     ¦   «         ¦  «        }|| j        vr| j                             |¦  «         d S d S rv   )r*  r^  r   rt   rò  s     rB   rb  z(MemoryAccountWithoutNamespaces.subscribev  sJ   € Ý˜$Ÿ*š*™,œ,Ñ'Ô'ˆØ�tÔ)Ð)Ð)ØÔ×%Ò% dÑ+Ô+Ð+Ð+Ð+ð *Ð)rD   c                 ó²   — t          |                     ¦   «         ¦  «        }|| j        vrt          d|› �¦  «        ‚| j                             |¦  «         d S )NzNot currently subscribed to )r*  r^  r   r   Úremoverò  s     rB   rf  z*MemoryAccountWithoutNamespaces.unsubscribe{  sY   € Ý˜$Ÿ*š*™,œ,Ñ'Ô'ˆØ�tÔ)Ð)Ð)Ý"Ð#HÀ$Ð#HÐ#HÑIÔIÐIØÔ×!Ò! $Ñ'Ô'Ð'Ð'Ð'rD   c                 ó¬   ‡ ‡— ‰                       t          |                     ¦   «         ¦  «        ¦  «        }t          ‰d¦  «        Šˆ ˆfd„|D ¦   «         S )Nr
  c                 óX   •— g | ]&}‰                      |¦  «        ¯|‰j        |         f‘Œ'S r>   )rœ  ru  )rG   rj   r_   rü  s     €€rB   rJ   z@MemoryAccountWithoutNamespaces.listMailboxes.<locals>.<listcomp>„  s6   ø€ ÐIÐIÐI¨1°x·~²~ÀaÑ7HÔ7HÐI��D”N 1Ô%Ð&ÐIÐIÐIrD   )r  r*  r^  rÁ  )r_   rl  rü  s   ` `rB   ri  z,MemoryAccountWithoutNamespaces.listMailboxes�  sS   øø€ Ø×!Ò!¥*¨S¯YªY©[¬[Ñ"9Ô"9Ñ:Ô:ˆÝ# H¨cÑ2Ô2ˆØIÐIÐIÐIÐI°ÐIÑIÔIÐIrD   rv   rš  )r¢   r£   r¤   ru  r   r  rb   r  r  rP  r  r+  rV  r]  r  rq  rb  rf  ri  r>   rD   rB   rþ  rþ    sõ   € € € € € à€IØ€MØ€Fð ð  ð  ð
ð ð ðð ð ð ðð ð ð"ð "ð "ð<ð <ð <ð <ð!ð !ð !ð.$ð $ð $ð"ð ð ð>ð >ð >ð,ð ,ð ,ð
(ð (ð (ðJð Jð Jð Jð JrD   rþ  c                   ó&   — e Zd Zd„ Zd„ Zd„ Zd„ ZdS )ÚMemoryAccountc                 ó   — ddggS )NrD   ó   /r>   rd   s    rB   r!  z#MemoryAccount.getPersonalNamespacesŒ  s   € Ø�d�ˆ}ÐrD   c                 ó   — d S rv   r>   rd   s    rB   r"  z!MemoryAccount.getSharedNamespaces�  ó   € ØˆtrD   c                 ó   — d S rv   r>   rd   s    rB   ÚgetOtherNamespacesz MemoryAccount.getOtherNamespaces’  r)  rD   c                 ó   — d S rv   r>   rd   s    rB   ÚgetUserNamespaceszMemoryAccount.getUserNamespaces•  s   € àˆtrD   N)r¢   r£   r¤   r!  r"  r+  r-  r>   rD   rB   r%  r%  ‡  sP   € € € € € ð
ð ð ðð ð ðð ð ðð ð ð ð rD   r%  rA  rB  Ú
getUIDNextrC  ÚgetUnseenCountr  c                 ó„   — i }|D ]:} t          | t          |                     ¦   «                  ¦  «        ¦   «         ||<   Œ;|S rv   )rQ  Ú_statusRequestDictr^  )r;  r  Úrr\  s       rB   ÚstatusRequestHelperr3  £  sF   € Ø
€AØð >ð >ˆØ;�w�tÕ/°·²±	´	Ô:Ñ;Ô;Ñ=Ô=ˆˆ!‰ˆØ€HrD   c                 ód   — | €dgS t           j                             | g¦  «        } d„ | D ¦   «         S )Nr  c                 óL   — g | ]!\  }}|pd d g|                      d¦  «        z   ‘Œ"S )Nú@©r\  )rG   rj  Úaddresss      rB   rJ   zparseAddr.<locals>.<listcomp>°  s6   € ÐLÐLÐL¹¸¸GˆRˆZ�4˜Ð §¢¨sÑ!3Ô!3Ñ3ÐLÐLÐLrD   )rÿ  r   Úgetaddresses)Úaddrs    rB   Ú	parseAddrr;  ª  sA   € Ø€|àð
ð 	
õ Œ;×#Ò# T FÑ+Ô+€DØLÐLÀtÐLÑLÔLÐLrD   c           
      ó˜  — |                       d¦  «        }|                     d¦  «        }|                     d¦  «        }|                     d¦  «        }|                     d|¦  «        }|                     d|¦  «        }|                     d¦  «        }|                     d¦  «        }|                     d	¦  «        }	|                     d
¦  «        }
|                     d¦  «        }||t          |¦  «        t          |¦  «        |ot          |¦  «        |ot          |¦  «        |ot          |¦  «        |	ot          |	¦  «        |
|f
S )NTr½  rM  r  Úsenderzreply-torS  r  r÷  zin-reply-toz
message-id)rú  rû  r;  )rÉ  Úheadersr½  rM  Úfrom_r=  Úreply_torS  r  r÷  Úin_reply_toÚmids               rB   ry  ry  ³  s'  € Ø�nŠn˜TÑ"Ô"€GØ�;Š;�vÑÔ€DØ�kŠk˜)Ñ$Ô$€GØ�KŠK˜ÑÔ€EØ�[Š[˜ 5Ñ)Ô)€FØ�{Š{˜: uÑ-Ô-€HØ	�Š�TÑ	Ô	€BØ	�Š�TÑ	Ô	€BØ
�+Š+�eÑ
Ô
€CØ—+’+˜mÑ,Ô,€KØ
�+Š+�lÑ
#Ô
#€CàØÝ�%ÑÔÝ�&ÑÔØÐ(•Y˜xÑ(Ô(Ø
Ð�y˜‰}Œ}Ø
Ð�y˜‰}Œ}ØÐ•	˜#‘”ØØðð rD   c                 óB   — d}|                       ¦   «         D ]}|dz  }Œ|S rÐ  )r	  )rÉ  rð   rm  s      rB   ÚgetLineCountrD  Í  s2   € ð €EØ�_Š_ÑÔð ð ˆØ�‰
ˆˆØ€LrD   c                 óR   — | d         | d         cxk    rdk    rn n
| dd…         S | S )Nr   r   rù  r;   r>   rè  s    rB   ÚunquoterF  Ö  s>   € Øˆ„tˆq�ŒuÐÐÒÐ˜ÒÐÐÐÐØ��2�ŒwˆØ€HrD   c                 óª  — d}|                       dd¦  «                             dd¦  «        }d                     |                     ¦   «         ¦  «        }|rv|                     d¦  «        }|d                              dd¦  «        }t          |¦  «        dk    r|d         }d}n|\  }}t          d	„ |dd…         D ¦   «         ¦  «        }ndx}}|||fS )
zJ
    Return a two-tuple of the main and subtype of the given message.
    NFúcontent-typerø  ú;r   r
  r;   c              3   óŠ   K  — | ]>}|                      ¦   «                              ¦   «                              d d¦  «        V — Œ?dS )ú=r;   N)r–  r6  r\  rŠ  s     rB   r  z"_getContentType.<locals>.<genexpr>ì  sD   è è € ÐKÐK¸�Q—W’W‘Y”Y—_’_Ñ&Ô&×,Ò,¨S°!Ñ4Ô4ÐKÐKÐKÐKÐKÐKrD   )rú  rû  r—   Ú
splitlinesr\  r³   Údict)rÉ  ÚattrsÚmmÚmimetyper¼  ÚmajorÚminors          rB   Ú_getContentTyperS  Ü  sÜ   € ð €EØ	�Š˜˜~Ñ	.Ô	.×	2Ò	2°>À2Ñ	FÔ	F€BØ	�Š�—’‘”Ñ	!Ô	!€BØ	ð Ø—8’8˜C‘=”=ˆØ˜Œ{× Ò   aÑ(Ô(ˆÝˆt‰9Œ9˜Š>ˆ>Ø˜”GˆEØˆEˆEð  ‰LˆE�5ÝÐKÐK¸hÀqÀrÀr¼lÐKÑKÔKÑKÔKˆˆàÐˆ�Ø�%˜ÐÐrD   c                 ó6  — t          | ¦  «        \  }}}|�|                     ¦   «         }|�|                     ¦   «         }|dk    rt          | ||¦  «        S ||fdk    rt          | |||¦  «        S |dk    rt	          | |||¦  «        S t          | |||¦  «        S )aE  
    Construct an appropriate type of message structure object for the given
    message object.

    @param message: A L{IMessagePart} provider

    @return: A L{_MessageStructure} instance of the most specific type available
        for the given message, determined by inspecting the MIME type of the
        message.
    NÚ	multipart)rÄ  r@  r6   )rS  r6  Ú_MultipartMessageStructureÚ_RFC822MessageStructureÚ_TextMessageStructureÚ_SinglepartMessageStructure)rÄ  ÚmainÚsubtyperN  s       rB   Ú_getMessageStructurer\  ò  s°   € õ +¨7Ñ3Ô3Ñ€Dˆ'�5ØÐØ�zŠz‰|Œ|ˆØÐØ—-’-‘/”/ˆØˆ{ÒÐÝ)¨'°7¸EÑBÔBÐBØ
�ˆÐ1Ò	1Ð	1Ý& w°°g¸uÑEÔEÐEØ	�ŠˆÝ$ W¨d°G¸UÑCÔCÐCå*¨7°D¸'À5ÑIÔIÐIrD   c                   ó$   — e Zd ZdZd„ Zd„ Zd„ ZdS )Ú_MessageStructurez¶
    L{_MessageStructure} is a helper base class for message structure classes
    representing the structure of particular kinds of messages, as defined by
    their MIME type.
    c                 ó"   — || _         || _        dS )zâ
        @param message: An L{IMessagePart} provider which this structure object
            reports on.

        @param attrs: A C{dict} giving the parameters of the I{Content-Type}
            header of the message.
        N)rÄ  rN  )r_   rÄ  rN  s      rB   rb   z_MessageStructure.__init__  s   € ð ˆŒØˆŒ
ˆ
ˆ
rD   c                 ó  — |rŠ|                      d¦  «        }t          |¦  «        dk    r|d                              ¦   «         df}nCt          |¦  «        dk    r0d„ |dd…         D ¦   «         }|d                              ¦   «         |g}|S dS )a  
        Parse a I{Content-Disposition} header into a two-sequence of the
        disposition and a flattened list of its parameters.

        @return: L{None} if there is no disposition header value, a L{list} with
            two elements otherwise.
        z; r;   r   Nc                 óD   — g | ]}|                      d d¦  «        D ]}|‘ŒŒS ©rK  r;   r7  )rG   ÚparamrU   s      rB   rJ   z2_MessageStructure._disposition.<locals>.<listcomp>,  s3   € ÐOÐOÐO ¸5¿;º;ÀsÈAÑ;NÔ;NÐOÐO°a˜!ÐOÐOÐOÐOrD   )r\  r³   r6  )r_   ÚdispÚparamss      rB   Ú_dispositionz_MessageStructure._disposition  sŽ   € ð ð 
	Ø—:’:˜dÑ#Ô#ˆDÝ�4‰yŒy˜AŠ~ˆ~Ø˜QœŸš™œ¨Ð.��Ý�T‘”˜Q’�àOÐO¨¨a¨b¨b¬ÐOÑOÔO�Ø˜QœŸš™œ¨Ð0�ØˆKà�4rD   c                 óŒ   — | j         r<d„ | j                              ¦   «         D ¦   «         }d„ t          |¦  «        D ¦   «         S dS )zÕ
        @return: The I{Content-Type} parameters, unquoted, as a flat list with
            each Nth element giving a parameter name and N+1th element giving
            the corresponding parameter value.
        c                 ó6   — g | ]\  }}|t          |¦  «        f‘ŒS r>   )rF  ©rG   rÍ  rá  s      rB   rJ   z4_MessageStructure._unquotedAttrs.<locals>.<listcomp>9  s&   € ÐIÐIÐI©F¨Q°˜�G A™JœJ˜ÐIÐIÐIrD   c                 ó   — g | ]	}|D ]}|‘ŒŒ
S r>   r>   )rG   rU   Úys      rB   rJ   z4_MessageStructure._unquotedAttrs.<locals>.<listcomp>:  s%   € Ð;Ð;Ð;˜!¸Ð;Ð;°A�AÐ;Ð;Ð;Ð;rD   N)rN  rß  rp   )r_   Úunquoteds     rB   Ú_unquotedAttrsz _MessageStructure._unquotedAttrs2  sP   € ð Œ:ð 	<ØIÐI°d´j×6FÒ6FÑ6HÔ6HÐIÑIÔIˆHØ;Ð;�v hÑ/Ô/Ð;Ñ;Ô;Ð;ØˆtrD   N)r¢   r£   r¤   r¥   rb   rf  rm  r>   rD   rB   r^  r^    sK   € € € € € ðð ð	ð 	ð 	ðð ð ð(	ð 	ð 	ð 	ð 	rD   r^  c                   ó2   — e Zd ZdZg d¢Zd„ Zd„ Zd„ Zd„ ZdS )rY  zn
    L{_SinglepartMessageStructure} represents the message structure of a
    non-I{multipart/*} message.
    )ú
content-idúcontent-descriptionúcontent-transfer-encodingc                 óh   — t                                | ||¦  «         || _        || _        || _        dS )aÀ  
        @param message: An L{IMessagePart} provider which this structure object
            reports on.

        @param main: A L{str} giving the main MIME type of the message (for
            example, C{"text"}).

        @param subtype: A L{str} giving the MIME subtype of the message (for
            example, C{"plain"}).

        @param attrs: A C{dict} giving the parameters of the I{Content-Type}
            header of the message.
        N)r^  rb   rZ  r[  rN  )r_   rÄ  rZ  r[  rN  s        rB   rb   z$_SinglepartMessageStructure.__init__F  s5   € õ 	×"Ò" 4¨°%Ñ8Ô8Ð8ØˆŒ	ØˆŒØˆŒ
ˆ
ˆ
rD   c                 ó,  —  | j         j        dg| j        ¢R Ž }| j                              ¦   «         }| j        | j        }}|                      ¦   «         }||||                     d¦  «        |                     d¦  «        |                     d¦  «        |gS )zN
        Return a list of the basic fields for a single-part message.
        Fro  rp  rq  )rÄ  rú  Ú_HEADERSr(  rZ  r[  rm  rû  )r_   r>  r­   rQ  rR  ÚunquotedAttrss         rB   Ú_basicFieldsz(_SinglepartMessageStructure._basicFieldsY  sž   € ð *�$”,Ô)¨%Ð@°$´-Ð@Ð@Ð@ˆð Œ|×#Ò#Ñ%Ô%ˆà”y $¤,ˆuˆð ×+Ò+Ñ-Ô-ˆð ØØØ�KŠK˜Ñ%Ô%Ø�KŠKÐ-Ñ.Ô.Ø�KŠKÐ3Ñ4Ô4Øð
ð 	
rD   c                 ó€   — |                       ¦   «         }|r'|                     |                      ¦   «         ¦  «         |S )zÁ
        Construct and return a list of the basic and extended fields for a
        single-part message.  The list suitable to be encoded into a BODY or
        BODYSTRUCTURE response.
        )rv  r|   Ú	_extended©r_   Úextendedrx  s      rB   rW  z"_SinglepartMessageStructure.encodeq  s>   € ð ×"Ò"Ñ$Ô$ˆØð 	,Ø�MŠM˜$Ÿ.š.Ñ*Ô*Ñ+Ô+Ð+ØˆrD   c                 ó¬  — g }| j                              ddddd¦  «        }|                     |                     d¦  «        ¦  «         |                     |                      |                     d¦  «        ¦  «        ¦  «         |                     |                     d¦  «        ¦  «         |                     |                     d¦  «        ¦  «         |S )aw  
        The extension data of a non-multipart body part are in the
        following order:

          1. body MD5

             A string giving the body MD5 value as defined in [MD5].

          2. body disposition

             A parenthesized list with the same content and function as
             the body disposition for a multipart body part.

          3. body language

             A string or parenthesized list giving the body language
             value as defined in [LANGUAGE-TAGS].

          4. body location

             A string list giving the body content URI as defined in
             [LOCATION].

        Fzcontent-md5úcontent-dispositionúcontent-languageúcontent-location)rÄ  rú  rt   rû  rf  ©r_   rx  r>  s      rB   rx  z%_SinglepartMessageStructure._extended|  s¿   € ð2 ˆØ”,×)Ò)ØØØ!ØØñ
ô 
ˆð 	�Š�g—k’k -Ñ0Ô0Ñ1Ô1Ð1Ø�Š�d×'Ò'¨¯ªÐ4IÑ(JÔ(JÑKÔKÑLÔLÐLØ�Š�g—k’kÐ"4Ñ5Ô5Ñ6Ô6Ð6Ø�Š�g—k’kÐ"4Ñ5Ô5Ñ6Ô6Ð6àˆrD   N)	r¢   r£   r¤   r¥   rt  rb   rv  rW  rx  r>   rD   rB   rY  rY  >  sh   € € € € € ðð ð
 RÐQÐQ€Hðð ð ð&
ð 
ð 
ð0	ð 	ð 	ð'ð 'ð 'ð 'ð 'rD   rY  c                   ó   — e Zd ZdZd„ ZdS )rX  z_
    L{_TextMessageStructure} represents the message structure of a I{text/*}
    message.
    c                 óÚ   — t                                | ¦  «        }|                     t          | j        ¦  «        ¦  «         |r'|                     |                      ¦   «         ¦  «         |S )a  
        A body type of type TEXT contains, immediately after the basic
        fields, the size of the body in text lines.  Note that this
        size is the size in its content transfer encoding and not the
        resulting size after any decoding.
        )rY  rv  rt   rD  rÄ  r|   rx  ry  s      rB   rW  z_TextMessageStructure.encode¬  s\   € õ -×9Ò9¸$Ñ?Ô?ˆØ�Š•l 4¤<Ñ0Ô0Ñ1Ô1Ð1Øð 	,Ø�MŠM˜$Ÿ.š.Ñ*Ô*Ñ+Ô+Ð+ØˆrD   N©r¢   r£   r¤   r¥   rW  r>   rD   rB   rX  rX  ¦  s-   € € € € € ðð ð
ð ð ð ð rD   rX  c                   ó   — e Zd ZdZd„ ZdS )rW  zi
    L{_RFC822MessageStructure} represents the message structure of a
    I{message/rfc822} message.
    c                 ó>  — t                                | |¦  «        }| j                             d¦  «        }|                     t          |¦  «        ¦  «         |                     t          |d¦  «        ¦  «         |                     t          |¦  «        ¦  «         |S )zâ
        A body type of type MESSAGE and subtype RFC822 contains,
        immediately after the basic fields, the envelope structure,
        body structure, and size in text lines of the encapsulated
        message.
        r   F)rY  rW  rÄ  r¬  rt   ry  r§  rD  )r_   rz  rx  Ú	containeds       rB   rW  z_RFC822MessageStructure.encodeÀ  s„   € õ -×3Ò3°D¸(ÑCÔCˆØ”L×+Ò+¨AÑ.Ô.ˆ	Ø�Š•k )Ñ,Ô,Ñ-Ô-Ð-Ø�ŠÕ& y°%Ñ8Ô8Ñ9Ô9Ð9Ø�Š•l 9Ñ-Ô-Ñ.Ô.Ð.ØˆrD   Nr‚  r>   rD   rB   rW  rW  º  s-   € € € € € ðð ð
ð ð ð ð rD   rW  c                   ó*   — e Zd ZdZd„ Zd„ Zd„ Zd„ ZdS )rV  zi
    L{_MultipartMessageStructure} represents the message structure of a
    I{multipart/*} message.
    c                 óL   — t                                | ||¦  «         || _        dS )aR  
        @param message: An L{IMessagePart} provider which this structure object
            reports on.

        @param subtype: A L{str} giving the MIME subtype of the message (for
            example, C{"plain"}).

        @param attrs: A C{dict} giving the parameters of the I{Content-Type}
            header of the message.
        N)r^  rb   r[  )r_   rÄ  r[  rN  s       rB   rb   z#_MultipartMessageStructure.__init__Õ  s'   € õ 	×"Ò" 4¨°%Ñ8Ô8Ð8ØˆŒˆˆrD   c              #   óz   K  — d}	 	 | j                              |¦  «        }|V — |dz  }n# t          $ r Y dS w xY wŒ7)zR
        Return an iterator over all of the sub-messages of this message.
        r   Tr;   N)rÄ  r¬  râ  )r_   rj   rª  s      rB   Ú	_getPartsz$_MultipartMessageStructure._getPartsã  sk   è è € ð ˆð	ðØ”|×.Ò.¨qÑ1Ô1�ð �
�
�
Ø�Q‘��øõ	 ð ð ð Ø��ðøøøð	s   ‡+ «
9¸9c                 óÎ   ‡— ˆfd„|                       ¦   «         D ¦   «         }|                     | j        ¦  «         ‰r'|                     |                      ¦   «         ¦  «         |S )zW
        Encode each sub-message and added the additional I{multipart} fields.
        c                 óT   •— g | ]$}t          |¦  «                             ‰¦  «        ‘Œ%S r>   ©r\  rW  )rG   r˜   rz  s     €rB   rJ   z5_MultipartMessageStructure.encode.<locals>.<listcomp>õ  s0   ø€ ÐUÐUÐU¸qÕ& qÑ)Ô)×0Ò0°Ñ:Ô:ÐUÐUÐUrD   )r‰  rt   r[  r|   rx  ry  s    ` rB   rW  z!_MultipartMessageStructure.encodeñ  sf   ø€ ð VÐUÐUÐUÀDÇNÂNÑDTÔDTÐUÑUÔUˆØ�Š�d”lÑ#Ô#Ð#Øð 	,Ø�MŠM˜$Ÿ.š.Ñ*Ô*Ñ+Ô+Ð+ØˆrD   c                 ó¬  — g }| j                              dddd¦  «        }|                     |                      ¦   «         ¦  «         |                     |                      |                     d¦  «        ¦  «        ¦  «         |                     |                     dd¦  «        ¦  «         |                     |                     dd¦  «        ¦  «         |S )af  
        The extension data of a multipart body part are in the following order:

          1. body parameter parenthesized list
               A parenthesized list of attribute/value pairs [e.g., ("foo"
               "bar" "baz" "rag") where "bar" is the value of "foo", and
               "rag" is the value of "baz"] as defined in [MIME-IMB].

          2. body disposition
               A parenthesized list, consisting of a disposition type
               string, followed by a parenthesized list of disposition
               attribute/value pairs as defined in [DISPOSITION].

          3. body language
               A string or parenthesized list giving the body language
               value as defined in [LANGUAGE-TAGS].

          4. body location
               A string list giving the body content URI as defined in
               [LOCATION].
        Fr}  r~  r|  N)rÄ  rú  rt   rm  rf  rû  r  s      rB   rx  z$_MultipartMessageStructure._extendedû  sÀ   € ð, ˆØ”,×)Ò)ØÐ%Ð'9Ð;Pñ
ô 
ˆð 	�Š�d×)Ò)Ñ+Ô+Ñ,Ô,Ð,Ø�Š�d×'Ò'¨¯ªÐ4IÑ(JÔ(JÑKÔKÑLÔLÐLØ�Š�g—k’kÐ"4°dÑ;Ô;Ñ<Ô<Ð<Ø�Š�g—k’kÐ"4°dÑ;Ô;Ñ<Ô<Ð<àˆrD   N)r¢   r£   r¤   r¥   rb   r‰  rW  rx  r>   rD   rB   rV  rV  Ï  sZ   € € € € € ðð ð
ð ð ðð ð ðð ð ð ð  ð  ð  ð  rD   rV  Fc                 óF   — t          | ¦  «                             |¦  «        S )ar  
    RFC 3501, 7.4.2, BODYSTRUCTURE::

      A parenthesized list that describes the [MIME-IMB] body structure of a
      message.  This is computed by the server by parsing the [MIME-IMB] header
      fields, defaulting various fields as necessary.

        For example, a simple text message of 48 lines and 2279 octets can have
        a body structure of: ("TEXT" "PLAIN" ("CHARSET" "US-ASCII") NIL NIL
        "7BIT" 2279 48)

    This is represented as::

        ["TEXT", "PLAIN", ["CHARSET", "US-ASCII"], None, None, "7BIT", 2279, 48]

    These basic fields are documented in the RFC as:

      1. body type

         A string giving the content media type name as defined in
         [MIME-IMB].

      2. body subtype

         A string giving the content subtype name as defined in
         [MIME-IMB].

      3. body parameter parenthesized list

         A parenthesized list of attribute/value pairs [e.g., ("foo"
         "bar" "baz" "rag") where "bar" is the value of "foo" and
         "rag" is the value of "baz"] as defined in [MIME-IMB].

      4. body id

         A string giving the content id as defined in [MIME-IMB].

      5. body description

         A string giving the content description as defined in
         [MIME-IMB].

      6. body encoding

         A string giving the content transfer encoding as defined in
         [MIME-IMB].

      7. body size

         A number giving the size of the body in octets.  Note that this size is
         the size in its transfer encoding and not the resulting size after any
         decoding.

    Put another way, the body structure is a list of seven elements.  The
    semantics of the elements of this list are:

       1. Byte string giving the major MIME type
       2. Byte string giving the minor MIME type
       3. A list giving the Content-Type parameters of the message
       4. A byte string giving the content identifier for the message part, or
          None if it has no content identifier.
       5. A byte string giving the content description for the message part, or
          None if it has no content description.
       6. A byte string giving the Content-Encoding of the message body
       7. An integer giving the number of octets in the message body

    The RFC goes on::

        Multiple parts are indicated by parenthesis nesting.  Instead of a body
        type as the first element of the parenthesized list, there is a sequence
        of one or more nested body structures.  The second element of the
        parenthesized list is the multipart subtype (mixed, digest, parallel,
        alternative, etc.).

        For example, a two part message consisting of a text and a
        BASE64-encoded text attachment can have a body structure of: (("TEXT"
        "PLAIN" ("CHARSET" "US-ASCII") NIL NIL "7BIT" 1152 23)("TEXT" "PLAIN"
        ("CHARSET" "US-ASCII" "NAME" "cc.diff")
        "<960723163407.20117h@cac.washington.edu>" "Compiler diff" "BASE64" 4554
        73) "MIXED")

    This is represented as::

        [["TEXT", "PLAIN", ["CHARSET", "US-ASCII"], None, None, "7BIT", 1152,
          23],
         ["TEXT", "PLAIN", ["CHARSET", "US-ASCII", "NAME", "cc.diff"],
          "<960723163407.20117h@cac.washington.edu>", "Compiler diff",
          "BASE64", 4554, 73],
         "MIXED"]

    In other words, a list of N + 1 elements, where N is the number of parts in
    the message.  The first N elements are structures as defined by the previous
    section.  The last element is the minor MIME subtype of the multipart
    message.

    Additionally, the RFC describes extension data::

        Extension data follows the multipart subtype.  Extension data is never
        returned with the BODY fetch, but can be returned with a BODYSTRUCTURE
        fetch.  Extension data, if present, MUST be in the defined order.

    The C{extended} flag controls whether extension data might be returned with
    the normal data.
    rŒ  )rÉ  rz  s     rB   r§  r§    s!   € õR   Ñ$Ô$×+Ò+¨HÑ5Ô5Ð5rD   c                 óŒ   — d„ |                       ¦   «         D ¦   «         }d                     |¦  «        dz   }t          |¦  «        S )Nc           	      ó°   — g | ]S\  }}d                       |                     ¦   «         d                      |                     ¦   «         ¦  «        f¦  «        ‘ŒTS )z: ú
)r—   ÚtitlerL  ri  s      rB   rJ   z"_formatHeaders.<locals>.<listcomp>Œ  sY   € ð ð ð áˆQ�ð 	�	Š	�1—7’7‘9”9˜fŸkšk¨!¯,ª,©.¬.Ñ9Ô9Ð:Ñ;Ô;ðð ð rD   r‘  )rß  r—   r:   )r>  r–  s     rB   r”  r”  Š  sN   € ðð à—m’m‘o”oðñ ô €Dð �;Š;�tÑÔ˜vÑ%€DÝ˜ÑÔÐrD   c              #   ój   K  — d}	 	 |                       |¦  «        V — |dz  }Œ# t          $ r Y d S w xY w)Nr   Tr;   )r¬  râ  )rž  rj   s     rB   Úsubpartsr”  ”  s]   è è € Ø	€Aðð	Ø—,’,˜q‘/”/Ð!Ð!Ð!Ø�‰FˆAð	øõ ð ð ð Øˆˆðøøøs   †$ ¤
2±2c                 óf   ‡ ‡‡‡— ddl mŠ t          j        ¦   «         Šˆˆˆ ˆfd„Š ‰d¦  «         ‰S )a©  
    Consume an interator at most a single iteration per reactor iteration.

    If the iterator produces a Deferred, the next iteration will not occur
    until the Deferred fires, otherwise the next iteration will be taken
    in the next reactor iteration.

    @rtype: C{Deferred}
    @return: A deferred which fires (with None) when the iterator is
    exhausted or whose errback is called if there is an exception.
    r   rØ  c                 óD  •— 	 t          ‰¦  «        }t          |t          j        ¦  «        r|                     ‰¦  «         d S ‰                     d‰|¦  «         d S # t          $ r ‰                     | ¦  «         Y d S t          $ r ‰ 	                    ¦   «          Y d S w xY wrÊ   )
rp  rZ   r   rƒ  rp  rß  rs  r¹   rQ  r[  )re   r2  r  Úgorj   rÙ  s     €€€€rB   r—  ziterateInReactor.<locals>.go®  s¼   ø€ ð
	,Ý�Q‘”ˆAõ ˜!�Uœ^Ñ,Ô,ð ,Ø—’˜bÑ!Ô!Ð!Ð!Ð!à×!Ò! ! R¨Ñ+Ô+Ð+Ð+Ð+øõ ð 	ð 	ð 	Ø�JŠJ�tÑÔÐÐÐÐÝð 	ð 	ð 	Ø�IŠI‰KŒKˆKˆKˆKˆKð	øøøs   ƒA ÁBÁ>BÂBN)rÞ  rÙ  r   rƒ  )rj   r  r—  rÙ  s   `@@@rB   r  r  ž  sc   øøøø€ ð )Ð(Ð(Ð(Ð(Ð(åŒÑÔ€Að,ð ,ð ,ð ,ð ,ð ,ð ,ð ,ð €B€t�H„H€HØ€HrD   c                   óF   — e Zd ZdZ eej        ¦  «        Zdd„Zd„ Z	d„ Z
dS )r¡  é   Nc                 óŽ   — || _         |€t          j        ¦   «         }|| _        |€t          }|| _        | j        j        | _        dS )a  
        Produce this message.

        @param msg: The message I am to produce.
        @type msg: L{IMessage}

        @param buffer: A buffer to hold the message in.  If None, I will
            use a L{tempfile.TemporaryFile}.
        @type buffer: file-like
        N)rÉ  rÁ   rÂ   ræ  r  r!  r¶   )r_   rÉ  ræ  r!  s       rB   rb   zMessageProducer.__init__Ã  sG   € ð ˆŒØˆ>ÝÔ+Ñ-Ô-ˆFØˆŒØÐÝ(ˆIØ"ˆŒØ”[Ô&ˆŒ
ˆ
ˆ
rD   c                 ó^   — || _         |                      |                      ¦   «         ¦  «        S rv   )Úconsumerr!  Ú_produce)r_   rœ  s     rB   rš  zMessageProducer.beginProducing×  s#   € Ø ˆŒØ�~Š~˜dŸmšm™oœoÑ.Ô.Ð.rD   c              #   ó6  ‡ K  — ‰ j                              d¦  «        }d }‰ j                              ¦   «         rÓ|                     d¦  «        }d„ |                     d¦  «        dd …         D ¦   «         }d„ |D ¦   «         }|                     d¦  «        }|€1d‰                      ¦   «         j        › �}|dxx         d	|› d
�z  cc<   n4|                     d
¦  «        r|                     d
¦  «        r
|dd…         }t          |¦  «        }‰  
                    t          |¦  «        ¦  «         ‰  
                    d¦  «         ‰ j                              ¦   «         r~t          ‰ j         ¦  «        D ]M}‰  
                    d|z   dz   ¦  «         t          |‰ j        ‰ j        ¦  «                             d ¦  «        V — ŒN‰  
                    d|z   dz   ¦  «         nW‰ j                              ¦   «         }	 |                     ‰ j        ¦  «        }|r‰ j         
                    |¦  «         d V — nnŒ=‰ j        ra‰ j                             dd¦  «         t-          ‰ j        ¦  «                             ‰ j        ¦  «                             ˆ fd„¦  «        V — d S d S )NTrH  c                 ó:   — g | ]}|                      d d¦  «        ‘ŒS rb  r7  rŠ  s     rB   rJ   z,MessageProducer._produce.<locals>.<listcomp>à  s$   € ÐEÐEÐE¨�Q—W’W˜S !‘_”_ÐEÐEÐErD   rI  r;   c                 ób   — i | ],\  }}|                      ¦   «                              ¦   «         |“Œ-S r>   )r6  r–  ri  s      rB   r  z,MessageProducer._produce.<locals>.<dictcomp>á  s0   € Ð>Ð>Ð>©f¨q°!�Q—W’W‘Y”Y—_’_Ñ&Ô&¨Ð>Ð>Ð>rD   Úboundaryz----=z; boundary="rù  r   rP  s   
--s   --
r   c                 ó   •— ‰S rv   r>   rœ  s    €rB   rV   z*MessageProducer._produce.<locals>.<lambda>  s   ø€ ˜$€ rD   )rÉ  rú  r«  rû  r\  Ú_uuid4Úhexrº  rÄ  r:   r¶   r”  r”  r¡  ræ  r!  rš  r	  rS  Ú
CHUNK_SIZErœ  rÅ   r™  rp  )r_   r>  r¡  rî  ra  r˜   rU  r:  s   `       rB   r�  zMessageProducer._produceÛ  sÍ  øè è € Ø”(×%Ò% dÑ+Ô+ˆØˆØŒ8×ÒÑ!Ô!ð 	/Ø—k’k .Ñ1Ô1ˆGØEÐE¨g¯mªm¸CÑ.@Ô.@ÀÀÀÔ.DÐEÑEÔEˆEØ>Ð>¸Ð>Ñ>Ô>ˆEØ—y’y Ñ,Ô,ˆHØÐà6 4§;¢;¡=¤=Ô#4Ð6Ð6�Ø˜Ð'Ð'Ô'Ð+E¸(Ð+EÐ+EÐ+EÑEÐ'Ð'Ñ'Ð'à×&Ò& sÑ+Ô+ð .°×0AÒ0AÀ#Ñ0FÔ0Fð .Ø'¨¨"¨œ~�HÝ$ XÑ.Ô.ˆHà�
Š
•> 'Ñ*Ô*Ñ+Ô+Ð+Ø�
Š
�7ÑÔÐØŒ8×ÒÑ!Ô!ð 	Ý˜dœhÑ'Ô'ð ð �Ø—
’
˜9 xÑ/°'Ñ9Ñ:Ô:Ð:Ý% a¨¬°d´nÑEÔE×TÒTØñô ð ð ð ð ð �JŠJ�y 8Ñ+¨iÑ7Ñ8Ô8Ð8Ð8à”×$Ò$Ñ&Ô&ˆAðØ—F’F˜4œ?Ñ+Ô+�Øð Ø”K×%Ò% aÑ(Ô(Ð(Ø�J�J�J�Jàðð Œ=ð 	ØŒK×Ò˜Q Ñ"Ô"Ð"Ý˜tœ{Ñ+Ô+×:Ò:¸4¼=ÑIÔI×UÒUØ���ñô ð ð ð ð ð ð	ð 	rD   r�  )r¢   r£   r¤   r¥  ÚstaticmethodÚuuidÚuuid4r£  rb   rš  r�  r>   rD   rB   r¡  r¡  ¿  s\   € € € € € Ø€JØˆ\˜$œ*Ñ%Ô%€Fð'ð 'ð 'ð 'ð(/ð /ð /ð'ð 'ð 'ð 'ð 'rD   r¡  c            
       ó  — e Zd Z G d„ d¦  «        Z G d„ d¦  «        Z G d„ d¦  «        Z G d„ d¦  «        Z G d	„ d
¦  «        Z G d„ d¦  «        Z G d„ d¦  «        Z	 G d„ d¦  «        Z
 G d„ d¦  «        Z G d„ d¦  «        Z G d„ d¦  «        Z G d„ d¦  «        Z G d„ d¦  «        ZdZdefdefdefdefd efd!efd"e	fd#e
fd$efg	Zd%„ Zd&„ Zd'„ Zd(„ Zd)„ Zd*„ Zd+„ Zd,„ Zd-„ Z ej        d.¦  «        Zd/„ Zd0„ Zd1„ Z d2„ Z!d3„ Z"dS )4r¯  c                   ó   — e Zd ZdZd„ ZdS )ú_FetchParser.Enveloper8  c                 ó   — dS )Nr8  r>   rd   s    rB   rV   z_FetchParser.Envelope.<lambda>  s   € ˜z€ rD   N©r¢   r£   r¤   r¼  r™   r>   rD   rB   ÚEnveloper«    s   € € € € € ð ˆØ)Ð)ˆˆˆrD   r®  c                   ó   — e Zd ZdZd„ ZdS )ú_FetchParser.Flagsrµ  c                 ó   — dS )Nrµ  r>   rd   s    rB   rV   z_FetchParser.Flags.<lambda>  s   € ˜w€ rD   Nr­  r>   rD   rB   ÚFlagsr°    s   € € € € € ØˆØ&Ð&ˆˆˆrD   r²  c                   ó   — e Zd ZdZd„ ZdS )ú_FetchParser.InternalDater5  c                 ó   — dS )Nr5  r>   rd   s    rB   rV   z"_FetchParser.InternalDate.<lambda>  s   € ˜~€ rD   Nr­  r>   rD   rB   ÚInternalDater´    s   € € € € € ØˆØ-Ð-ˆˆˆrD   r¶  c                   ó   — e Zd ZdZd„ ZdS )ú_FetchParser.RFC822HeaderrC  c                 ó   — dS )Nr�  r>   rd   s    rB   rV   z"_FetchParser.RFC822Header.<lambda>  ó   € ˜€ rD   Nr­  r>   rD   rB   ÚRFC822Headerr¸    s   € € € € € ØˆØ.Ð.ˆˆˆrD   r»  c                   ó   — e Zd ZdZd„ ZdS )ú_FetchParser.RFC822TextrF  c                 ó   — dS )Nr  r>   rd   s    rB   rV   z _FetchParser.RFC822Text.<lambda>"  ó   € ˜}€ rD   Nr­  r>   rD   rB   Ú
RFC822Textr½     ó   € € € € € ØˆØ,Ð,ˆˆˆrD   rÀ  c                   ó   — e Zd ZdZd„ ZdS )ú_FetchParser.RFC822SizerJ  c                 ó   — dS )Nr€  r>   rd   s    rB   rV   z _FetchParser.RFC822Size.<lambda>&  r¿  rD   Nr­  r>   rD   rB   Ú
RFC822SizerÃ  $  rÁ  rD   rÅ  c                   ó   — e Zd ZdZd„ ZdS )ú_FetchParser.RFC822r@  c                 ó   — dS )Nr@  r>   rd   s    rB   rV   z_FetchParser.RFC822.<lambda>*  s   € ˜x€ rD   Nr­  r>   rD   rB   ÚRFC822rÇ  (  s   € € € € € ØˆØ'Ð'ˆˆˆrD   rÉ  c                   ó   — e Zd ZdZd„ ZdS )ú_FetchParser.UIDri  c                 ó   — dS )Nri  r>   rd   s    rB   rV   z_FetchParser.UID.<lambda>.  s   € ˜u€ rD   Nr­  r>   rD   rB   r­  rË  ,  s   € € € € € ØˆØ$Ð$ˆˆˆrD   r­  c                   óJ   — e Zd ZdZdZdZdZdZdZdZ	dZ
dZdefd„Zdefd„ZdS )ú_FetchParser.Bodyr  FNr>   r’   c                 óP   — |                       ¦   «                              d¦  «        S ©Nrg  ©r°  rÒ  rd   s    rB   r™   z_FetchParser.Body.__str__;  ó    € Ø—>’>Ñ#Ô#×*Ò*¨7Ñ3Ô3Ð3rD   c                 óš  — d}d}d}| j         r&d                     d„ | j         D ¦   «         ¦  «        }d}| j        r7|d|z   |z   t          | j        ¦  «                             d¦  «        z   dz   z  }n>| j        r|d|z   |z   dz   z  }n(| j        r|d|z   |z   d	z   z  }n| j        r|d|z   dz   z  }| j        �|d
| j        | j	        fz  z  }|S )NrX  rD   ó   .c                 óX   — g | ]'}t          |d z   ¦  «                             d¦  «        ‘Œ(S )r;   rg  )r–   rW  rŠ  s     rB   rJ   z/_FetchParser.Body.__bytes__.<locals>.<listcomp>C  s0   € Ð!PÐ!PÐ!PÀ¥# a¨!¡e¡*¤*×"3Ò"3°GÑ"<Ô"<Ð!PÐ!PÐ!PrD   r?  rg  rn  s   TEXT]s   MIME]s   <%d.%d>)
rª  r—   r­  r–   rW  r6   r±  r²  ÚpartialBeginÚpartialLength)r_   Úbaserª  Ú	separators       rB   r°  z_FetchParser.Body.__bytes__>  s  € ØˆDØˆDØˆIØŒyð !Ø—y’yÐ!PÐ!PÀdÄiÐ!PÑ!PÔ!PÑQÔQ�Ø �	ð Œ{ð 	+ØØ˜4‘K )Ñ+­c°$´+Ñ.>Ô.>×.EÒ.EÀgÑ.NÔ.NÑNÐQUÑUñ��ð ”ð +Ø˜˜t™ iÑ/°(Ñ:Ñ:��Ø”ð +Ø˜˜t™ iÑ/°(Ñ:Ñ:��Ø”ð +Ø˜˜t™ dÑ*Ñ*�ØÔ Ð,Ø˜
 dÔ&7¸Ô9KÐ%LÑLÑL�ØˆKrD   )r¢   r£   r¤   r¼  rv  r­  r±  r6   rª  r²  rÖ  r×  r–   r™   rì  r°  r>   rD   rB   ÚBodyrÎ  0  sw   € € € € € ØˆØˆØˆØˆØˆØˆØˆØˆØˆð	4˜Sð 	4ð 	4ð 	4ð 	4ð	˜uð 	ð 	ð 	ð 	ð 	ð 	rD   rÚ  c                   ó   — e Zd ZdZd„ ZdS )ú_FetchParser.BodyStructurer;  c                 ó   — dS )Nr;  r>   rd   s    rB   rV   z#_FetchParser.BodyStructure.<lambda>W  rº  rD   Nr­  r>   rD   rB   ÚBodyStructurerÜ  U  s   € € € € € ØˆØ.Ð.ˆˆˆrD   rÞ  c                   ó2   — e Zd ZdZdZdZdefd„Zdefd„Z	dS )ú_FetchParser.HeaderFNr’   c                 óP   — |                       ¦   «                              d¦  «        S rÐ  rÑ  rd   s    rB   r™   z_FetchParser.Header.__str___  rÒ  rD   c                 ó~  — d}| j         r‚|dz  }| j        r|dz  }g }| j         D ]I}|                     ¦   «         }t          |¦  «        rt	          |¦  «        }|                     |¦  «         ŒJ|dd                     |¦  «        z   dz   z  }| j        r*d                     d„ | j        D ¦   «         ¦  «        dz   |z   }|S )	Ns   HEADERs   .FIELDSs   .NOTrŒ  rõ   r¢  rÔ  c                 ó<   — g | ]}|d z                         ¦   «         ‘ŒS rš  )r°  rŠ  s     rB   rJ   z1_FetchParser.Header.__bytes__.<locals>.<listcomp>r  s(   € Ð!IÐ!IÐ!I¸! 1 q¡5×"3Ò"3Ñ"5Ô"5Ð!IÐ!IÐ!IrD   )r¯  r®  r’  rï  rŒ  rt   r—   rª  )r_   rØ  r¯  rU  s       rB   r°  z_FetchParser.Header.__bytes__b  sÞ   € ØˆDØŒ{ð 
9Ø˜
Ñ"�Ø”;ð $Ø˜G‘O�DØ�Øœð %ð %�AØŸš™	œ	�AÝ" 1‘~”~ð &Ý" 1™IœI˜Ø—M’M !Ñ$Ô$Ð$Ð$Ø˜ §	¢	¨&Ñ 1Ô 1Ñ1°DÑ8Ñ8�ØŒyð Yð —y’yÐ!IÐ!I¸t¼yÐ!IÑ!IÔ!IÑJÔJÈTÑQÐTXÑX�ØˆKrD   )
r¢   r£   r¤   r®  r¯  rª  r–   r™   rì  r°  r>   rD   rB   ÚHeaderrà  Z  sY   € € € € € ØˆØˆØˆð	4˜Sð 	4ð 	4ð 	4ð 	4ð	˜uð 	ð 	ð 	ð 	ð 	ð 	rD   rä  c                   ó   — e Zd ZdS )ú_FetchParser.TextN©r¢   r£   r¤   r>   rD   rB   ÚTextræ  u  ó   € € € € € ØˆrD   rè  c                   ó   — e Zd ZdS )ú_FetchParser.MIMENrç  r>   rD   rB   ÚMIMErë  x  ré  rD   rì  Ns   envelopes   flagss   internaldates   rfc822.headers   rfc822.texts   rfc822.sizes   rfc822s   uids   bodystructurec                 ó2   — dg| _         g | _        d| _        d S )NÚinitialrD   )rA  rx  Ú	remainingrd   s    rB   rb   z_FetchParser.__init__‰  s   € Ø�[ˆŒ
ØˆŒØˆŒˆˆrD   c                 óf  — | j         |z   }	 |s| j        r‰| j        st          d¦  «        ‚| j                             ¦   «         }	  t	          | d|z   ¦  «        |¦  «        }||d …         }n)# t
          $ r | j                             |¦  «         ‚ w xY w|°‚| j        °‰|| _         d S # || _         w xY w)NzInvalid ArgumentÚstate_)rï  rA  r   rL  rQ  rQ  rt   )r_   rÒ   rA  Úuseds       rB   r°  z_FetchParser.parseStringŽ  sì   € ØŒN˜QÑˆð	Øð !�t”zð !Ø”zð DÝ/Ð0BÑCÔCÐCàœ
ŸšÑ(Ô(�ð!Ø:�7 4¨°EÑ)9Ñ:Ô:¸1Ñ=Ô=�Dð ˜$˜%˜%œ�A�Aøõ %ð ð ð Ø”J×%Ò% eÑ,Ô,Ð,Øðøøøð ð !�t”zð !ð ˆDŒNˆNˆNø˜QˆDŒNÐÐÐÐs#   Œ8B' ÁA, Á!B' Á,&BÂB' Â'	B0c                 óÂ  — |dk    rdS |                      ¦   «         }|                     d¦  «        rh| j                             |                      ¦   «         |                      ¦   «         |                      ¦   «         |                      ¦   «         f¦  «         dS |                     d¦  «        r{| j                             |                      ¦   «         |                      ¦   «         |                      ¦   «         |                      ¦   «         |                      ¦   «         f¦  «         dS |                     d¦  «        rU| j                             |                      ¦   «         |                      ¦   «         |                      ¦   «         f¦  «         dS |                     d¦  «        r| j	                             d	¦  «         d
S | j	         
                    d¦  «         dS )NrD   r   s   allrX  s   fullr×  s   fastr¡  )Úclose_parenÚmaybe_fetch_attÚ	fetch_attr;   rö  )r6  rº  rx  r|   r²  r¶  rÅ  r®  rÚ  rA  rt   )r_   rÒ   r‹   s      rB   Ústate_initialz_FetchParser.state_initial¡  s©  € ð �Š8ˆ8Ø�1à�GŠG‰IŒIˆØ�<Š<˜ÑÔð 	ØŒK×ÒØ—’‘”˜t×0Ò0Ñ2Ô2°D·O²OÑ4EÔ4EÀtÇ}Â}ÁÄÐWñô ð ð �1Ø�<Š<˜Ñ Ô ð 
	ØŒK×Òà—J’J‘L”LØ×%Ò%Ñ'Ô'Ø—O’OÑ%Ô%Ø—M’M‘O”OØ—I’I‘K”Kðñô ð ð �1Ø�<Š<˜Ñ Ô ð 	ØŒK×Òà—J’J‘L”LØ×%Ò%Ñ'Ô'Ø—O’OÑ%Ô%ðñô ð ð �1à�<Š<˜ÑÔð 	ØŒJ×ÒÐMÑNÔNÐNØ�1àŒ
×Ò˜+Ñ&Ô&Ð&ØˆqrD   c                 óN   — |                      d¦  «        rdS t          d¦  «        ‚)Nr¢  r;   z	Missing )©rº  rS  rÑ   s     rB   Ústate_close_parenz_FetchParser.state_close_parenÊ  s+   € Ø�<Š<˜ÑÔð 	Ø�1õ ˜Ñ$Ô$Ð$rD   c                 óä   — |r|dd…                               ¦   «         st          d¦  «        ‚d}t          t          |¦  «        ¦  «        D ]#}|||dz   …                               ¦   «         s nŒ$|S )Nr   r;   zWhitespace expected, none found)ÚisspacerS  rÛ  r³   )r_   rÒ   rj   s      rB   Ústate_whitespacez_FetchParser.state_whitespaceÑ  s�   € àð 	?˜˜!˜A˜#œŸšÑ(Ô(ð 	?ÝÐ=Ñ>Ô>Ð>ØˆÝ•s˜1‘v”v‘”ð 	ð 	ˆAØ�Q˜˜Q™�Y”<×'Ò'Ñ)Ô)ð Ø�ðàˆrD   c                 ód   — |                      d¦  «        s| j                             d¦  «         dS )Nr¢  )rõ  rö  rÆ  r   ©rº  rA  r|   rÑ   s     rB   Ústate_maybe_fetch_attz"_FetchParser.state_maybe_fetch_attÛ  s3   € Ø�|Š|˜DÑ!Ô!ð 	NØŒJ×ÒÐLÑMÔMÐMØˆqrD   c                 óÔ  — |                      ¦   «         }| j        D ]M\  }}|                     |¦  «        r3| j                              |¦   «         ¦  «         t          |¦  «        c S ŒN|                      ¦   «         }|                     d¦  «        r
d|_        d}n*|                     d¦  «        rd}nt          d|› �¦  «        ‚|| _	        | j
                             d¦  «         |S )Ns	   body.peekTr„  s   bodyr×  z!Nothing recognized in fetch_att: )Úgot_bodyÚmaybe_partialÚmaybe_section)r6  Ú_simple_fetch_attrº  rx  rt   r³   rÚ  rv  rS  Úpending_bodyrA  r|   )r_   rÒ   r‹   r.  Úclsr:  rò  s          rB   Ústate_fetch_attz_FetchParser.state_fetch_attà  s÷   € ð �GŠG‰IŒIˆØÔ/ð 	!ð 	!‰IˆD�#Ø�|Š|˜DÑ!Ô!ð !Ø”×"Ò" 3 3¡5¤5Ñ)Ô)Ð)Ý˜4‘y”yÐ Ð Ð ð!ð �IŠI‰KŒKˆØ�<Š<˜Ñ%Ô%ð 	EØˆAŒFØˆDˆDØ�\Š\˜'Ñ"Ô"ð 	EØˆDˆDåÐCÀÐCÐCÑDÔDÐDàˆÔØŒ
×ÒÐHÑIÔIÐIØˆrD   c                 óH   — | j                              | j        ¦  «         | `dS rÊ   )rx  rt   r  rÑ   s     rB   Ústate_got_bodyz_FetchParser.state_got_bodyù  s&   € ØŒ×Ò˜4Ô,Ñ-Ô-Ð-ØÐØˆqrD   c                 óh   — |                      d¦  «        sdS | j                             d¦  «         dS )Nr?  r   )ÚsectionÚpart_numberr;   rÿ  rÑ   s     rB   Ústate_maybe_sectionz _FetchParser.state_maybe_sectionþ  s7   € Ø�|Š|˜DÑ!Ô!ð 	Ø�1àŒ
×ÒÐ4Ñ5Ô5Ð5ØˆqrD   s   (\d+(?:\.\d+)*)\.?c                 óì   — | j                              |¦  «        }|�Pd„ |                     ¦   «         d                              d¦  «        D ¦   «         | _        |                     ¦   «         S g | _        dS )Nc                 ó2   — g | ]}t          |¦  «        d z
  ‘ŒS rš  )r—  )rG   r˜   s     rB   rJ   z2_FetchParser.state_part_number.<locals>.<listcomp>
  s"   € ÐHÐHÐH¨�#˜a™&œ& 1™*ÐHÐHÐHrD   r   rÔ  )Ú	_partExprrœ  Úgroupsr\  ra  ra   )r_   rÒ   rž  s      rB   Ústate_part_numberz_FetchParser.state_part_number  sd   € ØŒN× Ò  Ñ#Ô#ˆØˆ=ØHÐH¨a¯hªh©j¬j¸¬m×.AÒ.AÀ$Ñ.GÔ.GÐHÑHÔHˆDŒJØ—5’5‘7”7ˆNàˆDŒJØ�1rD   c                 óT  — |                      ¦   «         }d}|                     d¦  «        rd| j        _        |dz  }�nD|                     d¦  «        r4|                      ¦   «         x}| j        _        d|_        d|_        |dz  }nû|                     d¦  «        r$|                      ¦   «         | j        _	        |d	z  }nÂ|                     d
¦  «        r$|  
                    ¦   «         | j        _        |d	z  }n‰|                      ¦   «         }|                     d¦  «        rd|_        |dz  }n-|                     d¦  «        r|dz  }nt          d|›�¦  «        ‚|| j        _        | j                             d¦  «         t          | j        ¦  «        | j        _        d | _        |S )Nr   rn  Tr;   s   header]r>   rÀ  s   text]rÖ  s   mime]s   header.fields.noté   s   header.fieldsr<   zUnhandled section contents: )Úfinish_sectionÚheader_listrÆ  )r6  rº  r  r²  rä  r­  r®  r¯  rè  r6   rì  r±  rS  rA  r|   rë  ra  rª  )r_   rÒ   r‹   rò  rŒ   s        rB   Ústate_sectionz_FetchParser.state_section  s�  € ð
 �GŠG‰IŒIˆØˆØ�<Š<˜ÑÔð 	OØ&*ˆDÔÔ#Ø�A‰IˆD‰DØ�\Š\˜*Ñ%Ô%ð 	OØ+/¯;ª;©=¬=Ð8ˆA�Ô!Ô(ØˆAŒHØˆAŒHØ�A‰IˆDˆDØ�\Š\˜(Ñ#Ô#ð 	OØ%)§Y¢Y¡[¤[ˆDÔÔ"Ø�A‰IˆDˆDØ�\Š\˜(Ñ#Ô#ð 	OØ%)§Y¢Y¡[¤[ˆDÔÔ"Ø�A‰IˆDˆDà—’‘”ˆAØ�|Š|Ð0Ñ1Ô1ð FØ�”Ø˜‘
��Ø—’Ð.Ñ/Ô/ð FØ˜‘
��åÐ D¸qÐ DÐ DÑEÔEÐEà'(ˆDÔÔ$ØŒJ×ÒÐMÑNÔNÐNÝ!& t¤zÑ!2Ô!2ˆÔÔØˆŒ
ØˆrD   c                 óN   — |                      d¦  «        st          d¦  «        ‚dS )Nrn  zsection must end with ]r;   rù  rÑ   s     rB   Ústate_finish_sectionz!_FetchParser.state_finish_section5  s*   € Ø�|Š|˜DÑ!Ô!ð 	7ÝÐ5Ñ6Ô6Ð6ØˆqrD   c                 ó  — |                      d¦  «        st          d¦  «        ‚|                     d¦  «        }|dk    rt          d¦  «        ‚|d|…                              ¦   «         }d„ |D ¦   «         | j        j        _        |dz   S )Nr¡  zHeader list must begin with (r¢  r   zHeader list must end with )r;   c                 ó6   — g | ]}|                      ¦   «         ‘ŒS r>   r„  )rG   rŒ   s     rB   rJ   z2_FetchParser.state_header_list.<locals>.<listcomp>B  s    € Ð*FÐ*FÐ*F¸¨1¯7ª7©9¬9Ð*FÐ*FÐ*FrD   )rº  rS  r¤  r\  r  r­  r¯  )r_   rÒ   ra   r>  s       rB   Ústate_header_listz_FetchParser.state_header_list:  sˆ   € Ø�|Š|˜DÑ!Ô!ð 	=ÝÐ;Ñ<Ô<Ð<Ø�fŠf�T‰lŒlˆØ�"Š9ˆ9ÝÐ9Ñ:Ô:Ð:à�A�c�E”(—.’.Ñ"Ô"ˆØ*FÐ*F¸gÐ*FÑ*FÔ*FˆÔÔ Ô'Ø�Q‰wˆrD   c                 ór  — |                      d¦  «        sdS |                     d¦  «        }|dk    rt          d¦  «        ‚|d|…         }|                     dd¦  «        }t	          |¦  «        dk    rt          d	¦  «        ‚t          t          |¦  «        \  }}|| j        _        || j        _	        |dz   S )
Nr\  r   r]  r   zFound < but not >r;   rÔ  rù   z>Partial specification did not include two .-delimited integers)
rº  r¤  rS  r\  r³   rt  r—  r  rÖ  r×  )r_   rÒ   ra   rr   ra  Úbeginrx  s          rB   Ústate_maybe_partialz _FetchParser.state_maybe_partialE  s¸   € à�|Š|˜DÑ!Ô!ð 	Ø�1Ø�fŠf�T‰lŒlˆØ�"Š9ˆ9ÝÐ/Ñ0Ô0Ð0à�A�c�E”(ˆØ—’˜d AÑ&Ô&ˆÝˆu‰:Œ:˜Š?ˆ?ÝØPñô ð õ �C ™œ‰ˆˆvØ).ˆÔÔ&Ø*0ˆÔÔ'à�Q‰wˆrD   )#r¢   r£   r¤   r®  r²  r¶  r»  rÀ  rÅ  rÉ  r­  rÚ  rÞ  rä  rè  rì  ra  r  rb   r°  r÷  rú  rý  r   r  r
  r  r  r  r  r  r  r  r  r   r>   rD   rB   r¯  r¯    s]  € € € € € ð*ð *ð *ð *ð *ñ *ô *ð *ð'ð 'ð 'ð 'ð 'ñ 'ô 'ð 'ð.ð .ð .ð .ð .ñ .ô .ð .ð/ð /ð /ð /ð /ñ /ô /ð /ð-ð -ð -ð -ð -ñ -ô -ð -ð-ð -ð -ð -ð -ñ -ô -ð -ð(ð (ð (ð (ð (ñ (ô (ð (ð%ð %ð %ð %ð %ñ %ô %ð %ð#ð #ð #ð #ð #ñ #ô #ð #ðJ/ð /ð /ð /ð /ñ /ô /ð /ð
ð ð ð ð ñ ô ð ð6ð ð ð ð ñ ô ð ðð ð ð ð ñ ô ð ð €Eð 
�hÐØ	�5ÐØ	˜,Ð'Ø	˜<Ð(Ø	˜Ð$Ø	˜Ð$Ø	�FÐØ	�ˆØ	˜=Ð)ð
Ððð ð ð
ð ð ð&'ð 'ð 'ðR%ð %ð %ðð ð ðð ð ð
ð ð ð2ð ð ð
ð ð ð �”
Ð1Ñ2Ô2€Iðð ð ð#ð #ð #ðJð ð ð
	ð 	ð 	ðð ð ð ð rD   r¯  c                   ó:   — e Zd ZdZdZd„ Zd„ Zd„ Zd„ Zd„ Z	d„ Z
d	S )
r™  r™  Tc                 ó   — || _         d S rv   rÞ  )r_   rU  s     rB   rb   zFileProducer.__init___  s   € ØˆŒˆˆrD   c                 ó–   — || _         |j        | _        t          j        ¦   «         x}| _        | j                              | d¦  «         |S )NF)rœ  r¶   Úproducer   rƒ  Ú_onDoneÚregisterProducer)r_   rœ  r  s      rB   rš  zFileProducer.beginProducingb  sC   € Ø ˆŒØ”~ˆŒÝ œ>Ñ+Ô+Ð+ˆˆDŒLØŒ×&Ò& t¨UÑ3Ô3Ð3ØˆrD   c                 ón  — d}| j         rd|                      ¦   «         fz  }d| _         | j        sd S || j                             | j        ¦  «        z   }|sJ| j                             ¦   «          | j                             | ¦  «         d x| _        x| _        | _        d S |  	                    |¦  «         d S )NrD   s   {%d}
F)
Ú
firstWriteÚ_sizerU  rS  r¥  rœ  ÚunregisterProducerr%  r¹   r$  )r_   r:  s     rB   ÚresumeProducingzFileProducer.resumeProducingi  s³   € ØˆØŒ?ð 	$Ø˜tŸzšz™|œ|˜oÑ-ˆAØ#ˆDŒOØŒvð 	ØˆFØ�”—’˜DœOÑ,Ô,Ñ,ˆØð 	ØŒM×,Ò,Ñ.Ô.Ð.ØŒL×!Ò! $Ñ'Ô'Ð'Ø48Ð8ˆDŒLÐ8˜4œ6 D¤M M Mà�LŠL˜‰OŒOˆOˆOˆOrD   c                 ó   — dS )z9
        Pause the producer.  This does nothing.
        Nr>   rd   s    rB   ÚpauseProducingzFileProducer.pauseProducingx  rº  rD   c                 ó   — dS )z8
        Stop the producer.  This does nothing.
        Nr>   rd   s    rB   ÚstopProducingzFileProducer.stopProducing}  rº  rD   c                 óÜ   — | j                              ¦   «         }| j                              dd¦  «         | j                              ¦   «         }| j                              |d¦  «         ||z
  S )Nr   rù   )rU  r  rÅ   )r_   r:  rV  s      rB   r)  zFileProducer._size‚  sU   € ØŒF�KŠK‰MŒMˆØŒ�Š�A�qÑÔÐØŒF�KŠK‰MŒMˆØŒ�Š�A�qÑÔÐØ�1‰uˆrD   N)r¢   r£   r¤   r¥  r(  rb   rš  r+  r-  r/  r)  r>   rD   rB   r™  r™  Z  sx   € € € € € Ø€Jà€Jðð ð ðð ð ðð ð ðð ð ð
ð ð ð
ð ð ð ð rD   r™  c                 ó  — g d¢}ddddœ}t          j        d|z  | ¦  «        }|st          d| ›�¦  «        ‚|                     ¦   «         }	 d|                     |d	                              ¦   «         ¦  «        d
z  z   |d	<   t          |d         ¦  «        |d<   t          |d         ¦  «        |d<   t          j        |d         |d	         |d         ddddddf	¦  «        S # t          $ r t          d| ›�¦  «        ‚w xY w)N)ÚjanÚfebÚmarÚaprÚmayÚjunÚjulÚaugÚsepÚoctÚnovÚdecÚjanuaryÚfebruaryÚmarchÚaprilr6  ÚjuneÚjulyÚaugustÚ	septemberÚoctoberÚnovemberÚdecemberz+(?P<day>3[0-1]|[1-2]\d|0[1-9]|[1-9]| [1-9])z(?P<mon>\w+)z(?P<year>\d\d\d\d))ÚdayÚmonÚyearz%(day)s-%(mon)s-%(year)szCannot parse time string r;   rJ  é   rK  rI  r   r   )	r  rœ  rg   Ú	groupdictÚindexr6  r—  rˆ  Ústruct_time)rÒ   ÚmonthsÚexprrž  r  s        rB   rþ  rþ  Š  s/  € ðð ð €Fð6 >ØØ%ðð €Dõ
 	ŒÐ+¨dÑ2°AÑ6Ô6€AØð <ÝÐ:°QÐ:Ð:Ñ;Ô;Ð;Ø	�Š‰Œ€AðVØ˜Ÿš Q u¤X§^¢^Ñ%5Ô%5Ñ6Ô6¸Ñ;Ñ<ˆˆ%‰Ý˜˜&œ	‘N”Nˆˆ&‰	Ý�q˜”x‘=”=ˆˆ%‰õ Ô  6¤¨A¨e¬H°a¸´hÀÀ1ÀaÈÈRÐQSÐ TÑUÔUÐUøõ ð <ð <ð <ÝÐ:°QÐ:Ð:Ñ;Ô;Ð;ð<øøøs   ÁA&C! Ã!C>r	   c                  ó   — | d         S rÊ   r>   rT   s    rB   rV   rV   ¼  s
   € °Q°q´T€ rD   c                 óh   — |                       d¦  «        }|dd…                              dd¦  «        S )Núutf-7r;   r   r'  r�  )rW  r¿  ©rÒ   Ús_utf7s     rB   Úmodified_base64rW  ¿  s1   € Ø�XŠX�gÑÔ€FØ�!�B�$Œ<×Ò  dÑ+Ô+Ð+rD   c                 ód   — d|                       dd¦  «        z   dz   }|                     d¦  «        S )Nr×  r�  r'  r…  rT  )r¿  rÒ  rU  s     rB   Úmodified_unbase64rY  Ä  s1   € Ø�A—I’I˜d DÑ)Ô)Ñ)¨DÑ0€FØ�=Š=˜Ñ!Ô!Ð!rD   c           	      ó¢  — t          ¦   «         }g }t          t          t          t	          dd¦  «        ¦  «        ¦  «        dhz
  }| D ]®}||v rU|r0|dt          d                     |¦  «        ¦  «        z   dz   z  }|dd…= |                     t          |¦  «        ¦  «         Œ[|dk    r8|r0|dt          d                     |¦  «        ¦  «        z   dz   z  }|dd…= |dz  }Œ™|                     |¦  «         Œ¯|r;| 	                    dt          d                     |¦  «        ¦  «        z   dz   ¦  «         t          |¦  «        t          | ¦  «        fS )	ap  
    Encode the given C{unicode} string using the IMAP4 specific variation of
    UTF-7.

    @type s: C{unicode}
    @param s: The text to encode.

    @param errors: Policy for handling encoding errors.  Currently ignored.

    @return: L{tuple} of a L{str} giving the encoded bytes and an L{int}
        giving the number of code units consumed from the input.
    é    é   ú&ó   &rø  r…  Ns   &-)Ú	bytearrayr  rt  ÚchrrÛ  rW  r—   rt   Úordr|   rì  r³   )rÒ   Úerrorsr2  Ú_inÚvalid_charsrÞ  s         rB   Úencoderre  É  sS  € õ 	‰Œ€AØ
€CÝ•c�#�u T¨4Ñ0Ô0Ñ1Ô1Ñ2Ô2°c°UÑ:€KØð ð ˆØ�ÐÐØð Ø�T�O¨B¯GªG°C©L¬LÑ9Ô9Ñ9¸DÑ@Ñ@�Ø˜˜˜�FØ�HŠH•S˜‘V”VÑÔÐÐØ�#ŠXˆXØð Ø�T�O¨B¯GªG°C©L¬LÑ9Ô9Ñ9¸DÑ@Ñ@�Ø˜˜˜�FØ�‰JˆAˆAà�JŠJ�q‰MŒMˆMˆMØ
ð >Ø	�Š��¨¯ª°©¬Ñ5Ô5Ñ5¸Ñ<Ñ=Ô=Ð=Ý�!‰HŒH•c˜!‘f”fÐÐrD   c           
      ó°  — g }g }t          t          | ¦  «        d¦  «        } | D ]Ð}|dk    r|s|                     d¦  «         Œ |dk    rk|rit          |¦  «        dk    r|                     d¦  «         n=|                     t	          d                     |dd…         ¦  «        ¦  «        ¦  «         g }Œ‘|r|                     |¦  «         Œ©|                     |                     ¦   «         ¦  «         ŒÑ|r=|                     t	          d                     |dd…         ¦  «        ¦  «        ¦  «         d                     |¦  «        t          | ¦  «        fS )	aw  
    Decode the given L{str} using the IMAP4 specific variation of UTF-7.

    @type s: L{str}
    @param s: The bytes to decode.

    @param errors: Policy for handling decoding errors.  Currently ignored.

    @return: a L{tuple} of a C{unicode} string giving the text which was
        decoded and an L{int} giving the number of bytes consumed from the
        input.
    rÞ  r^  r…  r;   r]  rD   Nrø  )Úmemory_castÚ
memoryviewrt   r³   rY  r—   rÒ  )rÒ   rb  r2  rÒ  rÞ  s        rB   Údecoderri  ë  sE  € ð 	€AØ€FÝ•J˜q‘M”M 3Ñ'Ô'€AØð !ð !ˆØ�Š9ˆ9˜Vˆ9Ø�MŠM˜$ÑÔÐÐØ�$ŠYˆY˜6ˆYÝ�6‰{Œ{˜aÒÐØ—’˜‘”��à—’Õ*¨3¯8ª8°F¸1¸2¸2´JÑ+?Ô+?Ñ@Ô@ÑAÔAÐAØˆFˆFØð 	!Ø�MŠM˜!ÑÔÐÐà�HŠH�Q—X’X‘Z”ZÑ Ô Ð Ð Øð :Ø	�ŠÕ" 3§8¢8¨F°1°2°2¬JÑ#7Ô#7Ñ8Ô8Ñ9Ô9Ð9Ø�GŠG�A‰JŒJ�˜A™œÐÐrD   c                   ó   — e Zd Zdd„ZdS )ÚStreamReaderÚstrictc                 ó    — t          |¦  «        S rv   )ri  ©r_   rÒ   rb  s      rB   rÒ  zStreamReader.decode  ó   € Ý�q‰zŒzÐrD   N©rl  )r¢   r£   r¤   rÒ  r>   rD   rB   rk  rk    ó(   € € € € € ðð ð ð ð ð rD   rk  c                   ó   — e Zd Zdd„ZdS )ÚStreamWriterrl  c                 ó    — t          |¦  «        S rv   )re  rn  s      rB   rW  zStreamWriter.encode  ro  rD   Nrp  )r¢   r£   r¤   rW  r>   rD   rB   rs  rs    rq  rD   rs  c                 óH   — |                       dd¦  «        dk    rt          S d S )Nú-rm  Úimap4_utf_7)r¿  Ú
_codecInforñ  s    rB   rw  rw    s+   € ð ‡|‚|�C˜ÑÔ Ò.Ð.ÝÐð /Ð.rD   )(r  r<  ÚIMailboxListenerr(   rû  ÚIMailboxr1   r=  ÚIMailboxInfoÚIMessagerá  rŸ  rÅ  ÚIMessagePartr   r   r   r   r&   r"   r$   r   r   r   r    r!   r   r   r#   r%   r   r   r   r   r   r¸  r¼  rº  r%  r3  rv   r  rš  r  )³r¥   rö  Úcodecsr  Úemail.utilsrÿ  rq   r  rÅ  rÁ   rˆ  r§  Úbase64r   r   Úior   Ú	itertoolsr   Útypingr   r   r	   Úzope.interfacer
   Útwisted.credr   Útwisted.cred.errorr   r   rÞ  r   r   r   Útwisted.internet.deferr   Útwisted.mail._credr   r   r   r   r   Útwisted.mail._exceptr   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   Útwisted.mail.interfacesr'   rû  r(   r)   r=  r*   rz  r+   r{  r,   ry  r-   r|  r.   rá  r/   rŸ  r0   r}  r1   r2   rÅ  Útwisted.protocolsr3   r4   Útwisted.pythonr5   r6   Útwisted.python.compatr7   r8   r9   r:   rM  rÚ  rÛ  r\  rŠ  rC   rL   rN   r«   r½   rÇ   rÖ   Ú_SPrì  Ú_CTLr  rÒ  Ú_nativeNonAtomCharsr  rµ  r	  ÚLineReceiverÚTimeoutMixinr  ÚTimeoutErrorrc  r<  r¬  r´  r¶  rp   r³  r¸  rº  r¼  rÁ  rÎ  rÕ  rÜ  rû   rŒ  r•  rs  rî  rï  r*  rß  rø  r#  rþ  r%  r1  r3  r;  ry  rD  rF  rS  r\  r^  rY  rX  rW  rV  r§  r”  r”  r  r¡  r¯  r™  rþ  rQ  rh  rg  rW  rY  re  ri  rk  rs  Ú	CodecInforx  rw  ÚregisterÚ__all__r>   rD   rB   ú<module>r—     s  ðð
ð ð €€€Ø €€€Ø €€€Ø Ð Ð Ð Ø Ð Ð Ð Ø 	€	€	€	Ø €€€Ø €€€Ø €€€Ø €€€Ø +Ð +Ð +Ð +Ð +Ð +Ð +Ð +Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø "Ð "Ð "Ð "Ð "Ð "Ð "Ð "Ð "Ð "à &Ð &Ð &Ð &Ð &Ð &à $Ð $Ð $Ð $Ð $Ð $Ø FÐ FÐ FÐ FÐ FÐ FÐ FÐ FØ 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ø 0Ð 0Ð 0Ð 0Ð 0Ð 0ðð ð ð ð ð ð ð ð ð ð ð ð ð ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð(ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð .Ð -Ð -Ð -Ð -Ð -Ð -Ð -Ø $Ð $Ð $Ð $Ð $Ð $Ð $Ð $ðð ð ð ð ð ð ð ð ð ð ð ð ˆtØ€Cˆˆˆa�‰ŒÐG×MÒMÑOÔOÑPÔPñô €ð
*ð *ð *ðð ð ð(að að að að añ aô að aðH	9ð 9ð 9ð 9ð 9ñ 9ô 9ð 9ð8/ð /ð /ð /ð /ñ /ô /ð /ðBð ð ð ð ñ ô ð ð0D"ð D"ð D"ð D"ð D"ñ D"ô D"ð D"ðV €Ø€uˆUˆU�5�5˜‘;”;   d¨EÑ 2Ô 2Ñ3Ô3Ñ4Ô4€ð  Ñ$ tÑ+€ð $×*Ò*¨9Ñ5Ô5Ð ØˆRŒZ˜Ð1Ñ1°CÑ7Ñ8Ô8€
ð ˆUÐHÐH   e¡¤ÐHÑHÔHÑHÔH€
ð €ÐÑÔðSNð SNð SNð SNð SN�%Ô$ hÔ&;ñ SNô SNñ ÔðSNðl8 #�Ô"Ñ$Ô$€ð €ÐÑÔðPð Pð Pð Pð P�%Ô$ hÔ&;ñ Pô Pñ ÔðPðf<6ð 6ð 6ð 6ðr€ð" *€
à
€ðNð Nð Nð Nðb	1ð 	1ð 	1ðð ð ð
&ð &ð &ð &ð>ð >ð >ðBð ð ð ð ð ðD7,ð 7,ð 7,ð 7,ðtEð Eð Eð'�ð '˜%ð 'ð 'ð 'ð 'ðð ð ð ð ñ ô ð ð €ðð ð ð+ð +ð +ðð ð ð/ð /ð /ð. ð . ð . ðb €ˆXÑÔðoJð oJð oJð oJð oJñ oJô oJñ ÔðoJðd €Ð Ñ!Ô!ðð ð ð ð Ð2ñ ô ñ "Ô!ðð& "ØØØ#Øðð Ð ðð ð ðMð Mð Mðð ð ð4ð ð ðð ð ðð ð ð,Jð Jð Jð4/ð /ð /ð /ð /ñ /ô /ð /ðdeð eð eð eð eÐ"3ñ eô eð eðPð ð ð ð Ð7ñ ô ð ð(ð ð ð ð Ð9ñ ô ð ð*Lð Lð Lð Lð LÐ!2ñ Lô Lð Lð^i6ð i6ð i6ð i6ðXð ð ðð ð ðð ð ðBCð Cð Cð Cð Cñ Cô Cð CðLRð Rð Rð Rð Rñ Rô Rð Rðj
-ð -ð -ð -ð -ñ -ô -ð -ð`,Vð ,Vð ,Vðd ˆg�j &¨/¨/Ñ:Ô:€ð,ð ,ð ,ð
"ð "ð "ð
ð ð ð ðD ð  ð  ð  ðDð ð ð ð �6Ô&ñ ô ð ð
ð ð ð ð �6Ô&ñ ô ð ð
 ˆVÔ˜g w°¸lÑKÔK€
ð	ð 	ð 	ð €„�Ñ Ô Ð ð/ð /ð /€€€rD   