V Qc@sddlZddlZddlZddlZddlZddlZddlZdZejdZ dZ dZ da ddZ ed krendS( iNc Cst}y#tjtjdd\}}Wn7tjk rb}tjjd|tjdnXx)|D]!\}}|dkrjt}qjqjW|sdg}nd}x|D]}|dks|dkr|tj p|}qt j j |r t |p|}qt j j|ryt|}Wn6tk re}tjjd ||fd}qnX||pu|}|jqtjjd |d}qW|rtj|ndS( Nitfs%s is-ft-its%s: %s s%s: not found (tmmdftgetopttsystargvterrortstderrtwritetexittmessagetstdintostpathtisdirtmhtisfiletopentIOErrortclose( tdofiletoptstargstmsgtotatststargR((s0/usr/lib64/python2.7/Demo/scripts/mboxconvert.pytmains<#      s [1-9][0-9]*cCsd}tj|}x|D]}tj|t|krCqntjj||}yt|}Wn6tk r}t j j d||fd}qnXt |p|}qW|S(Nis%s: %s i( R tlistdirtnumerictmatchtlenRtjoinRRRRR R (tdirRtmsgsRtfnR((s0/usr/lib64/python2.7/Demo/scripts/mboxconvert.pyR2s cCsad}xT|j}|sPn|dkrCt||p=|}q tjjd|fq |S(Nis sBad line in MMFD mailbox: %r (treadlineR RRR (RRtline((s0/usr/lib64/python2.7/Demo/scripts/mboxconvert.pyRBs   iRc Csyd}tj|}|jd\}}|jd}|rQtj|}n<tjjd|j dft j |j t j}dG|Gtj|GHx|jD] }|GqW|jdstdadt|tf} tjjd| |fd G| GHnHx`|j}||kr0Pn|sPtjjd d}Pn|d d krmd |}n|GqH|S(NitFromtDatesUnparseable date: %r s message-idis<%s.%d>sAdding Message-ID %s (From %s) s Message-ID:sUnexpected EOF in message isFrom t>(trfc822tMessagetgetaddrtgetdatettimetmktimeRRR t getheaderR tfstattfilenotstattST_MTIMEtctimetheadersthas_keytcounterthexR&( Rt delimiterRtmtfullnametemailtttttR'tmsgid((s0/usr/lib64/python2.7/Demo/scripts/mboxconvert.pyR Qs@       t__main__(R+RR/R R4RtreRtcompileRRRR9R t__name__(((s0/usr/lib64/python2.7/Demo/scripts/mboxconvert.pyts        !   *