+
    Dfj                        ^ RI t ^ RIHt ^ RIHt ^ RIHt RtRtRt	Rs
RsR	sR	sR	sR	sR	sR	sR	sR	sR	s R
t. ROtRtRtRtRtRtRtRtRtRtRt Rt!Rt"Rt# ! R R]PH                  4      t%Rt&R t'R t(R t)]*R8X  d
   ])! 4        R# R# )     N)reactor)Factory)basictesttwistediL  TFs(   +OK POP3 localhost v2003.83 server ready   STLS   UIDLs   -ERR Unknown requests   +OK Command Completeds   -ERR LOGIN faileds   +OK Mailbox open, 0 messagess*   -ERR server side error start TLS handshakes   +OK quit completeds'   -ERR Unknown AUHORIZATION state commands   +OK 0 0s    +OK Unique-ID listing follows
.s#   +OK Mailbox scan listing follows
.s   +OK Capability list follows:c                   `   a  ] tR t^5t o RR ltR tR tR tR tR t	R t
R	 tR
 tR tRtV tR# )POP3TestServerNc                <    R V n         RV n        RV n        Wn        R# )FN)loggedIncapstmpUserctx)selfcontextFactorys   &&B/usr/lib/python3/dist-packages/twisted/mail/test/pop3testserver.py__init__POP3TestServer.__init__6   s    	!    c                0    V P                  \        4       R # N)sendLineSTATr   reqs   &&r   sendSTATRespPOP3TestServer.sendSTATResp<       dr   c                0    V P                  \        4       R # r   )r   UIDLr   s   &&r   sendUIDLRespPOP3TestServer.sendUIDLResp?   r   r   c                0    V P                  \        4       R # r   )r   LISTr   s   &&r   sendLISTRespPOP3TestServer.sendLISTRespB   r   r   c                   V P                   f   \        .V n         \        '       d    V P                   P                  \        4       \
        '       d    V P                   P                  \        4       \         F  pV P                   P                  V4       K   	  RP                  V P                   4      pVR,          pV P                  V4       R # )Ns   
s   
.)
r   	CAP_STARTUIDL_SUPPORTappendCAPABILITIES_UIDLSSL_SUPPORTCAPABILITIES_SSLCAPABILITIESjoinr   )r   capresps   &  r   sendCapabilitiesPOP3TestServer.sendCapabilitiesE   s    99"DI<II./;II-.CIIS!  ||DII&dr   c                    \         '       d   V P                  4        R # \        '       d$   \        P                  ! ^V P
                  4       R # V P                  4        R # r   )DENY_CONNECTION
disconnectSLOW_GREETINGr   	callLatersendGreetingr   s   &r   connectionMadePOP3TestServer.connectionMadeV   s=    ?OO=b$"3"34 r   c                0    V P                  \        4       R # r   )r   CONNECTION_MADEr;   s   &r   r:   POP3TestServer.sendGreetinga   s    o&r   c                  a VP                  4       oV3R lp\        '       d   R# \        '       d   V P                  4        R# V! R4      '       d6   \        '       d   V P                  \        4       R# V P                  4        R# V! R4      '       d   \        '       d   V P                  4        R# V! R4      '       d]   \        '       d   V P                  \        4       R# Rp VP                  R4      ^,          V n        \        pV P                  V4       R# V! R4      '       d}   Rp VP                  R4      ^,          pV P                  e   Vf   \        pM5V P                  \         8X  d   V\"        8X  d   \$        pRV n        M\        p V P                  V4       R# V! R	4      '       d/   R
V n        V P                  \(        4       V P                  4        R# \*        '       d   V P                  \        4       R# V P&                  '       g   V P                  \,        4       R# V! R4      '       d   V P                  \        4       R# V! R4      '       d&   \.        '       d   R# V P                  \0        4       R# V! R4      '       d&   \.        '       d   R# V P                  \2        4       R# V! R4      '       dI   \.        '       d   R# \4        '       g   V P                  \        4       R# V P                  \6        4       R# R#   \         d    \        p ELi ; i  \         d    \        p ELi ; i)zError Conditionsc                 ,   < SP                  V 4      R8g  # )   )find)sulines   &r   <lambda>-POP3TestServer.lineReceived.<locals>.<lambda>h   s    A",r   Ns   CAPAr      USER s   PASSTs   QUITFs   NOOPs   STATs   LISTr	   )upperTIMEOUT_RESPONSEDROP_CONNECTIONr7   INVALID_CAPABILITY_RESPONSEr   INVALID_RESPONSEr3   r-   startTLSINVALID_LOGIN_RESPONSEsplitr   VALID_RESPONSEBaseExceptionAUTH_DECLINEDUSERPASSAUTH_ACCEPTEDr   LOGOUT_COMPLETEINVALID_SERVER_RESPONSENOT_LOGGED_INTIMEOUT_DEFERREDr   r%   r*   r!   )r   linerE   r2   pwdrG   s   &&   @r   lineReceivedPOP3TestServer.lineReceivedd   s*    

,?OO']]**./%%'']]{{MMO']]%%./D%#zz#q1% MM$']]D%jjoa(<<'3;(D\\T)cTk(D$(DM(D MM$']]!DMMM/*OO$$MM*+MM-(']]MM.)']]MM$']]MM$']]!\./MM$ ] ! %$%" ! %$%s0   '#L .0L* -L* L* L'&L'*L?>L?c                    \         '       dG   V P                  e9   V P                  R4       V P                  P	                  V P                  4       R # V P                  R4       R # )Ns   +OK Begin TLS negotiation nows   -ERR TLS not available)r-   r   r   	transportrQ   r;   s   &r   rQ   POP3TestServer.startTLS   s@    ;488/MM:;NN##DHH-MM34r   c                :    V P                   P                  4        R # r   )rc   loseConnectionr;   s   &r   r7   POP3TestServer.disconnect   s    %%'r   )r   r   r   r   r   )__name__
__module____qualname____firstlineno__r   r   r"   r&   r3   r<   r:   r`   rQ   r7   __static_attributes____classdictcell__)__classdict__s   @r   r   r   5   s>     ""	 'U n5( (r   r   a  popServer.py [arg] (default is Standard POP Server with no messages)
no_ssl  - Start with no SSL support
no_uidl - Start with no UIDL support
bad_resp - Send a non-RFC compliant response to the Client
bad_cap_resp - send a non-RFC compliant response when the Client sends a 'CAPABILITY' request
bad_login_resp - send a non-RFC compliant response when the Client sends a 'LOGIN' request
deny - Deny the connection
drop - Drop the connection after sending the greeting
bad_tls - Send a bad response to a STARTTLS
timeout - Do not return a response to a Client request
to_deferred - Do not return a response on a 'Select' request. This
              will test Deferred callback handling
slow - Wait 20 seconds after the connection is made to return a Server Greeting
c                 *    \        R V ,          4       R# )zServer Starting in %s modeN)print)msgs   &r   printMessagerr      s    	
&
,-r   c                    V P                  4       R 8X  d   Rs\        R4       R# V P                  4       R8X  d   Rs\        R4       R# V P                  4       R8X  d   Rs\        R4       R# V P                  4       R8X  d   Rs\        R	4       R# V P                  4       R
8X  d   Rs\        R	4       R# V P                  4       R8X  d   Rs\        R4       R# V P                  4       R8X  d   Rs\        R4       R# V P                  4       R8X  d   Rs	\        R4       R# V P                  4       R8X  d   Rs
\        R4       R# V P                  4       R8X  d   Rs\        R4       R# V P                  4       R8X  d   Rs\        R4       R# V P                  4       R8X  d'   \        \        4       \        P                   ! 4        R# \        \        4       \        P                   ! 4        R# )no_sslFzNON-SSLno_uidlzNON-UIDLbad_respTzInvalid Server Responsebad_cap_respzInvalid Capability Responsebad_login_respdenyzDeny ConnectiondropzDrop Connectionbad_tlszBad TLS ResponsetimeoutzTimeout Responseto_deferredzTimeout Deferred ResponseslowzSlow Greetingz--helpN)lowerr-   rr   r*   r[   rO   rR   r6   rN   BAD_TLS_RESPONSErM   r]   r8   rp   usagesysexit)args   &r   
processArgr      sj   
yy{hY			!Z 	
	""&./		&&*#23	(	(!%23		&'		&'			!'(			!'(		%01		_%		 e
 	e
r   c                  :   \        \        P                  4      ^8  d   \        R4       M+\        P                  R,          p V  F  p\	        V4       K  	  \        4       p\        Vn        \        P                  ! \        V4       \        P                  ! 4        R# )   zPOP3 with no messages:rC   NNN)lenr   argvrr   r   r   r   protocolr   	listenTCPPORTrun)argsr   fs      r   mainr     sb    
388}q,-xx|CsO  		AAJdAKKMr   __main__)s   TOPs   LOGIN-DELAY 180rJ   s
   SASL LOGIN)+r   twisted.internetr   twisted.internet.protocolr   twisted.protocolsr   rW   rX   r   r-   r*   r[   rO   rR   r6   rN   r   rM   r]   r8   r?   r/   r.   r,   rP   rT   rV   rY   	TLS_ERRORrZ   r\   r   r!   r%   r)   LineReceiverr   r   rr   r   r   rh    r   r   <module>r      s     $ - # #      =C   + )$/9	':,/+	N(U'' N(b	 .>B zF r   