mò ÀmòCc@sçdZddddddddd d d d d ddddgZdkZdkZdkZdkZdkZdkZdkZdk Z dk Z dk Z dk TdZ hde<de<de<de<de<de<de<deR8tTrueR3(R2((Rtabortcs cCs`|ipt|dƒ odSn|iiƒ|iiƒti|i|i ƒt |_dS(NR( R2R3R@RR<R>R"trenameR6R4RA(R2((RR>ks   (t__name__t __module__t__doc__R=R?RBR>(((RRLs   cBs;tZdZd„Zd„Zd„Zd„Zd„ZRS(sLA class for locking and appending timestamped data lines to a log file. cCslt|_||_ytt|iƒdƒ|_Wn4tj o(\}}td||ifƒ‚nXdS(Ntabs%s, opening file "%s"( R1R2R3R4R$RRR8R9R:(R2R4R9R:((RR=ws   cCs|iƒdS(N(R2R>(R2((RR?scCs d|iS(Nslogfile(filename="%s")(R2R4(R2((Rt__str__‚scCs9|iodSn|iiƒ|iiƒt|_dS(N(R2R3RR<R>RA(R2((RR>…s    cCs}zht|iƒ|iiddƒ|iitittiƒƒd|i ƒt i ƒ|ii ƒWdt|iƒXdS(Niit (R R2RtseekR;ttimetstrftimet logtimeformatt localtimetstrstripR"tlinesepR<R (R2RO((RR;Œs 7(RDRERFR=R?RHR>R;(((RR ts     tpasswordcCs‘d}|iƒ}|iƒxn|D]f}||joq#n|o|d7}n||jo|d|7}q#|d|||f7}q#W|S(sATake a dictionary of parameters and return a string summary. tt,s%s=*s%s="%s"N(ROtdtkeystsorttkeyt skipitemst maskitems(RURZRYRVRORX((Rt format_params˜s    cGstdƒ‚dS(sGHandle an alarm during maildir delivery. Should never happen. sDelivery timeoutN(R/(tunused((Rt alarm_handlerªscCs tii|idƒo |d p|ƒ}ti|tiƒptd|ƒ‚ntii |ƒpt Snti|tiƒptd|ƒ‚nxhd D]`}tii ||ƒ}tii |ƒpt Snti|tiƒptd|ƒ‚q£q£WtS( s Verify a path is a maildir. t/iÿÿÿÿsPcannot read contents of parent directory of %s - check permissions and ownershipsFcannot read contents of directory %s - check permissions and ownershipttmptcurtnews<cannot write to maildir %s - check permissions and ownershipN(R_R`snew(R"R%tdirnameRUtendswitht dir_parenttaccesstX_OKtgetmailConfigurationErrortisdirR1tsubtjointsubdirtW_OKRA(RURdRkRi((RR²s -c CsÁt|ƒptd|ƒ‚ntititƒtidddƒhd|<d|i dƒdi dd ƒi d d ƒ<d t i ƒ<}t ii|d ƒ} t ii|dƒ}x®tdƒD]‡}tiƒ}t|ƒ|dR8R.tlinktunlinkR-tKeyboardInterrupttSIG_DFL(RvR“RnRzR’RRRŠR†RR‘R4R‰R~R\R}R7R.R„R((RRÈst L  X         cCsCdig}|D]!}||djodp|q~ƒpdS( sAEscape spaces, tabs, and newlines in the envelope sender address.RSRIs s t-s<>N(RIs s (RjR„ROtc(ROR„Rš((RR /scCs7|idƒo|idƒo|dd!Sn|SdS(s5Strip surrounding <> on an email address, if present.tiiÿÿÿÿN(taddrt startswithRc(R((RR4s cCsBytt|ƒiƒSWn#tj otd|ƒ‚nXdS(s)Handle boolean values intelligently. sEboolean parameter requires value to be one of true or false, not "%s"N(t _bool_valueststrROtlowertKeyErrorRg(RO((RR<s cCs@yti|ƒiSWn%tj o}td|ƒ‚nXdS(Nsno such specified uid (%s)(tpwdtgetpwuidtuidtpw_gidR¢R.Rg(R¥R.((RRFscCs@yti|ƒiSWn%tj o}td|ƒ‚nXdS(Nsno such specified user (%s)(R£tgetpwnamtusertpw_uidR¢R.Rg(R¨R.((RRMscCs¸d}d}|o^|o|id|ƒnyti|ƒi}Wqqt j o}t d|ƒ‚qqXn|o,|o|id|ƒnt |ƒ}nt|||ƒdS(s] Change the current effective GID and UID to those specified by user and _group. s#Getting GID for specified group %s sno such specified group (%s)s"Getting UID for specified user %s N(RƒR¥tgidt_grouptloggertdebugtgrptgetgrnamtgr_gidR¢R.RgR¨RR(R¬R¨R«R¥R.Rª((RRTscCsÕy |oGtiƒ|jo0|o|id|ƒnti||ƒqQn|oGtiƒ|jo0|o|id|ƒnti||ƒqŸnWn.t j o"}t d|||fƒ‚nXdS(sY Change the current effective GID and UID to those specified by uid and gid. sSetting egid to %d sSetting euid to %d s#change UID/GID to %s/%s failed (%s)N( RªR"tgetegidR¬R­tsetregidR¥tgeteuidtsetreuidR-R.R/(R¬R¥RªR.((RRjscCs/d}|iƒddig}|iƒD]}||iƒq*~ƒ}x |o˜t|ƒdjo…|i dddƒ}|djo%|i dƒ}|djoPq®n|o|t i d7}n||| 7}||i ƒ}qMW|o|t i d7}n|o||iƒt i 7}n|S( s?Take a long line and return rfc822-style multiline header. RSs: RIiNiiÿÿÿÿs N(theaderR#tstripRjR„tlinet splitlinestparttlentrfindtiR"RQtlstrip(R#R·R¼R„RµR¹((Rt format_headers&D   cCstiitii|ƒƒS(s‰Return a string expanded for both leading "~/" or "~username/" and environment variables in the form "$varname" or "${varname}". N(R"R%t expandusert expandvarsRO(RO((RRšscCs+tiƒ}d|jo|SntiƒS(sIReturn a name for localhost which is (hopefully) the "correct" FQDN. RoN(tsockett gethostnametntgetfqdn(RÃ((RR¡s   cCsÕ|d}|dj ot|ƒ}n|d}|dj ot|ƒ}n|o$tii|ƒ otdƒ‚n|o$tii|ƒ otdƒ‚n|dj|djAotdƒ‚n||fS(Ntkeyfiletcertfiles-optional keyfile must be path to a valid files.optional certfile must be path to a valid files7optional certfile and keyfile must be supplied together( tconfRÅRƒRRÆR"R%tisfileRg(RÇRÆRÅ((RRªs    (RR('RFt__all__R"tos.pathRÁRwRRKRŽRR£R®tgetmailcore.exceptionsRMRAR1RŸR R R tobjectRR R[R]RRƒRR RRRRRRR¾RRR( R¾R RR[RÉRRRR]RŸR®R RRR RŽR RR£RRR RRRÁRwRRKRMR"RR((Rt?sD9          N   ($  g