PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB`  YFTc@sdZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z yddl Z Wne k rddlZ nXddlZddlZddlZddlZejjjdZde jfdYZdefdYZde jefd YZd efd YZd e jefd YZde j fdYZ!dS(sNetworked spam-signature detection server. The server receives the request in the form of a RFC5321 message, and responds with another RFC5321 message. Neither of these messages has a body - all of the data is encapsulated in the headers. The response headers will always include a "Code" header, which is a HTTP-style response code, and a "Diag" header, which is a human-readable message explaining the response code (typically this will be "OK"). Both the request and response headers always include a "PV" header, which indicates the protocol version that is being used (in a major.minor format). Both the requestion and response headers also always include a "Thread", which uniquely identifies the request (this is a requirement of using UDP). Responses to requests may arrive in any order, but the "Thread" header of a response will always match the "Thread" header of the appropriate request. Authenticated requests must also have "User", "Time" (timestamp), and "Sig" (signature) headers. iNcGsQxJtrLy||SWqtk rH}|jdtjkrIqIqXqWdS(s*restart a system call interrupted by EINTRiN(tTruetOSErrortargsterrnotEINTR(tfuncRte((s0/usr/lib/python2.7/site-packages/pyzor/server.pyt _eintr_retry/s  tServercBsJeZdZdZdZddZdZdZdZ dZ RS( s_The pyzord server. Handles incoming UDP connections in a single thread and single process.i icCsld|dkrtjt_n tjt_tjd|_tjd|_||_ t |j dt |_ ||_ ||_i|_i|_|j||_|jjd|tjj||tdt y |jjtjtjdWn/ttjfk r'}|jjd|nX|j|jtjtj |j!tjtj"|j#dS( Nt:itpyzords pyzord-usagethandles_one_stepsListening on %stbind_and_activates%Unable to set IPV6_V6ONLY to false %s($tsockettAF_INET6Rtaddress_familytAF_INETtloggingt getLoggertlogt usage_logtdatabasetgetattrtFalsetone_stept passwd_fnt access_fntaccountstaclt load_configt forwardertdebugt SocketServert UDPServert__init__tRequestHandlert setsockoptt IPPROTO_IPV6t IPV6_V6ONLYtAttributeErrorterrort server_bindtserver_activatetsignaltSIGUSR1treload_handlertSIGTERMtshutdown_handler(tselftaddressRRRRR((s0/usr/lib/python2.7/site-packages/pyzor/server.pyR"?s0           cCs:tjj|j|_tjj|j|j|_dS(s>Reads the configuration files and loads the accounts and ACLs.N(tpyzortconfigtload_passwd_fileRRtload_access_fileRR(R0((s0/usr/lib/python2.7/site-packages/pyzor/server.pyRascOs3|jjdtjd|j}|jdS(ssHandler for the SIGTERM signal. This should be used to kill the daemon and ensure proper clean-up. s SIGTERM received. Shutting down.ttargetN(Rtinfot threadingtThreadtshutdowntstart(R0Rtkwargstt((s0/usr/lib/python2.7/site-packages/pyzor/server.pyR/fscOs3|jjdtjd|j}|jdS(sgHandler for the SIGUSR1 signal. This should be used to reload the configuration files. s*SIGUSR1 received. Reloading configuration.R6N(RR7R8R9RR;(R0RR<R=((s0/usr/lib/python2.7/site-packages/pyzor/server.pyR-nscCs|jjd|dtdS(Ns'Error while processing request from: %stexc_info(RR(R(R0trequesttclient_address((s0/usr/lib/python2.7/site-packages/pyzor/server.pyt handle_errorvs N( t__name__t __module__t__doc__tmax_packet_sizettime_diff_allowancetNoneR"RR/R-RA(((s0/usr/lib/python2.7/site-packages/pyzor/server.pyR9s !   t PreForkServercBs8eZdZddZddZdZdZRS(sThe same as Server, but prefork itself when starting the self, by forking a number of child-processes. The parent process will then wait for all his child process to complete. icCs/d|_tj|||||||_dS(svThe same as Server.__init__ but requires a list of databases instead of a single database connection. N(RGtpidsRR"t_prefork(R0R1RRRtprefork((s0/usr/lib/python2.7/site-packages/pyzor/server.pyR"s g?cCsg}xtt|jD]c}|jj}tj}|sl||_tj|d|tjdq|j |qW||_ x$|j D]}t tj |dqWdS(s=Fork the current process and wait for all children to finish.t poll_intervaliN( txrangeRJRtnexttostforkRt serve_forevert_exittappendRIRtwaitpid(R0RLRItdummyRtpid((s0/usr/lib/python2.7/site-packages/pyzor/server.pyRQs   cCsPx*|jpdD]}tj|tjqW|jdkrLtj|ndS(spIf this is the parent process send the TERM signal to all children, else call the super method. N((RIROtkillR+R.RGRR:(R0RV((s0/usr/lib/python2.7/site-packages/pyzor/server.pyR:scCsPx*|jpdD]}tj|tjqW|jdkrLtj|ndS(spIf this is the parent process send the USR1 signal to all children, else call the super method. N((RIRORWR+R,RGRR(R0RV((s0/usr/lib/python2.7/site-packages/pyzor/server.pyRs(RBRCRDR"RQR:R(((s0/usr/lib/python2.7/site-packages/pyzor/server.pyRH{s    tThreadingServercBseZdZRS(sA threaded version of the pyzord server. Each connection is served in a new thread. This may not be suitable for all database types.(RBRCRD(((s0/usr/lib/python2.7/site-packages/pyzor/server.pyRXstBoundedThreadingServercBs,eZdZddZdZdZRS(s^Same as ThreadingServer but this also accepts a limited number of concurrent threads. cCs5tj|||||d|tj||_dS(NR(RXR"R8t Semaphoret semaphore(R0R1RRRt max_threadstforwarding_server((s0/usr/lib/python2.7/site-packages/pyzor/server.pyR"scCs$|jjtj|||dS(N(R[tacquireRXtprocess_request(R0R?R@((s0/usr/lib/python2.7/site-packages/pyzor/server.pyR_s cCs$tj||||jjdS(N(RXtprocess_request_threadR[trelease(R0R?R@((s0/usr/lib/python2.7/site-packages/pyzor/server.pyR`sN(RBRCRDRGR"R_R`(((s0/usr/lib/python2.7/site-packages/pyzor/server.pyRYs  t ProcessServercBseZdZdddZRS(sA multi-processing version of the pyzord server. Each connection is served in a new process. This may not be suitable for all database types. i(cCs,|t_tj|||||d|dS(NR(Rbt max_childrenRR"(R0R1RRRRcR]((s0/usr/lib/python2.7/site-packages/pyzor/server.pyR"s N(RBRCRDRGR"(((s0/usr/lib/python2.7/site-packages/pyzor/server.pyRbsR#cBseZdZdZdZdZdZdZdZdZ dZ d Z idd 6ed 6e d 6ed 6e d6e d6Z RS(sHandle a single pyzord request.cOs,tjj|_tjj|||dS(N(temailtmessagetMessagetresponseR tDatagramRequestHandlerR"(R0RR<((s0/usr/lib/python2.7/site-packages/pyzor/server.pyR"scCsd|jds  cCs|jjjd||jjr8|jjj|nexb|D]Z}y|jj|}Wn#tk r~tjj j }nX|j ||jj|     ("RDRORRRR R+RR8Rxt email.messageRdR t ImportErrort socketservert pyzor.configR2t pyzor.accounttpyzor.engines.commontpyzor.hacks.py26thackstpy26thack_allRR!RRHtThreadingMixInRXRYt ForkingMixInRbRhR#(((s0/usr/lib/python2.7/site-packages/pyzor/server.pyts4                B2