
9cc           @   s  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 d d l m Z d d l m Z d d l Td d l 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 d d l m Z d d l m Z d d l m Z d d l m  Z  d d l! m" Z" d d l# m$ Z$ d d l% m& Z& d d l' m( Z( d d l) m* Z* d d l+ m, Z, d d l- m. Z. d d l/ m0 Z0 d d l1 m2 Z2 d d l m3 Z3 d d l m4 Z4 d d l m5 Z5 d d l6 m7 Z7 d d l m8 Z8 d d l m9 Z9 d d l m: Z: d d l; m< Z< e: j= a= d    Z> d! Z? d" Z@ y eA eB f Wn eC k
 rd# ZA d$ ZB n Xd% e, e& e. e  e( e0 e$ e* e" e2 e3 j3 f d&     YZD d S('   sU   The class representing a Mailman mailing list.

Mixes in many task-specific classes.
iN(   t   StringIO(   t   UserDict(   t   urlparse(   t   *(   t   getaddressest
   formataddrt	   parseaddr(   t   Header(   t   mm_cfg(   t   Utils(   t   Errors(   t   LockFile(   t   UserDesc(   t   Archiver(   t   Autoresponder(   t   Bouncer(   t	   Deliverer(   t   Digester(   t   GatewayManager(   t   HTMLFormatter(   t	   ListAdmin(   t   SecurityManager(   t   TopicMgr(   t   Pending(   t   Gui(   t   MemberAdaptor(   t   OldStyleMemberships(   t   Message(   t   Site(   t   i18n(   t   syslogc         C   s   |  S(   N(    (   t   s(    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt   D_K   s    t    t   |i   i    t   MailListc           B   sT  e  Z d9 d  d  Z d   Z d   Z d d  Z d   Z d   Z d   Z	 d	   Z
 d9 d
  Z d   Z d   Z d d  Z d   Z d   Z d   Z d   Z d   Z d d  Z d d d  Z d9 d d  Z d   Z d9 d d d9 d  Z d   Z d   Z d9 d  Z d9 d9 d9 d  Z d   Z d   Z d    Z e  d!  Z! d"   Z" d#   Z# d$   Z$ e% d%  Z& d d&  Z' d9 d'  Z( d9 d9 d d d(  Z) d9 d9 e  d)  Z* d9 d9 d9 d*  Z+ d+   Z, d,   Z- d-   Z. d.   Z/ d9 d/  Z0 d9 d9 d0  Z1 d1   Z2 d2   Z3 d3   Z4 d9 d4  Z5 d5   Z6 d6   Z7 d9 d7  Z8 d8   Z9 RS(:   i   c         C   s  x3 |  j  j D]% } t | d  r | j |   q q W|  j |  t |   |  _ | d  k rb d  St j	 j
 |  j   d  } i  } y t | |  Wn8 t k
 r } | j t j k r q t d d |  n# X| j d  } | r | |   n  | r|  j   n
 |  j   d  S(   Nt   __init__s	   extend.pyt   errors"   IOError reading list extension: %st   extend(   t	   __class__t	   __bases__t   hasattrR$   t   InitTempVarsR   t   _memberadaptort   Nonet   ost   patht   joint   fullpatht   execfilet   IOErrort   errnot   ENOENTR   t   gett   Lockt   Load(   t   selft   namet   lockt	   baseclasst   filenamet   dictt   et   func(    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyR$   a   s*    c         C   sn   y t  |  j |  SWnS t k
 ri xC |  j D]+ } y t  | |  SWq. t k
 rX q. Xq. Wt |  n Xd  S(   N(   t   getattrR+   t   AttributeErrort   _gui(   R8   R9   t   guicomponent(    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt   __getattr__   s    c         C   s8   |  j    r d } n d } d |  j   | t |   f S(   Ns   (locked)s
   (unlocked)s   <mailing list "%s" %s at %x>(   t   Lockedt   internal_namet   id(   R8   t   status(    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt   __repr__   s
    	i    c         C   sC   |  j  j |  y |  j   Wn t k
 r> |  j     n Xd  S(   N(   t   _MailList__lockR:   R7   t	   Exceptiont   Unlock(   R8   t   timeout(    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyR6      s    
c         C   s   |  j  j d d  d  S(   Nt   unconditionallyi   (   RJ   t   unlock(   R8   (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyRL      s    c         C   s   |  j  j   S(   N(   RJ   t   locked(   R8   (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyRE      s    c         C   s   |  j  S(   N(   t   _internal_name(   R8   (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyRF      s    c         C   s   |  j  S(   N(   t
   _full_path(   R8   (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyR0      s    c         C   s=   | d  k r# d |  j   |  j f Sd |  j   | |  j f S(   Ns   %s@%ss   %s-%s@%s(   R,   RF   t	   host_name(   R8   t   extra(    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt   getListAddress   s    c         C   s   |  j  d  S(   Nt   bounces(   RU   (   R8   (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt   GetBouncesEmail   s    c         C   s   |  j  d  S(   Nt   owner(   RU   (   R8   (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt   GetOwnerEmail   s    R!   c         C   s-   t  j r | r |  j |  S|  j d  Sd  S(   Nt   request(   R   t   VERP_CONFIRMATIONSt   GetConfirmEmailRU   (   R8   t   cookie(    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt   GetRequestEmail   s    c         C   s.   t  j i d |  j   d 6| d 6d |  j S(   Ns
   %s-confirmt   addrR]   t   @(   R   t   VERP_CONFIRM_FORMATRF   RS   (   R8   R]   (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyR\      s    c         C   s^   t  j rR | rR t j   j   p0 t j |  j  } t t	 d  | d d } | Sd | Sd  S(   NsC   Your confirmation is required to join the %(listname)s mailing listt   header_namet   subjects   confirm (
   R   R[   R   t   get_translationt   charsetR	   t
   GetCharSett   preferred_languageR   t   _(   R8   t   listnameR]   t   csett   subj(    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt   GetConfirmJoinSubject   s    	c         C   s^   t  j rR | rR t j   j   p0 t j |  j  } t t	 d  | d d } | Sd | Sd  S(   NsD   Your confirmation is required to leave the %(listname)s mailing listRb   Rc   s   confirm (
   R   R[   R   Rd   Re   R	   Rf   Rg   R   Rh   (   R8   Ri   R]   Rj   Rk   (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt   GetConfirmLeaveSubject   s    	c         C   s
   |  j    S(   N(   RU   (   R8   (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt   GetListEmail   s    c         C   s@   |  j  s | St | j d   \ } } d | |  j | f Sd S(   s  Usually the member addr, but modified for umbrella lists.

        Umbrella lists have other mailing lists as members, and so admin stuff
        like confirmation requests and passwords must not be sent to the
        member addresses - the sublists - but rather to the administrators of
        the sublists.  This routine picks the right address, considering
        regular member address to be their own administrative addresses.

        R`   s   %s%s@%sN(   t   umbrella_listt   tuplet   splitt   umbrella_member_suffix(   R8   t   membert   acctt   host(    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt   GetMemberAdminEmail   s    
	c         C   s$   t  j | |  j |  d |  j   S(   Nt   /(   R	   t	   ScriptURLt   web_page_urlRF   (   R8   t
   scriptnamet   absolute(    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt   GetScriptURL   s    c         C   sG   |  j  d |  } | r* t j |  } n  d | t j | j    f S(   Nt   optionss   %s/%s(   R|   R	   t   ObscureEmailt   urllibt   quotet   lower(   R8   t   usert   obscureR{   t   url(    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt   GetOptionsURL  s    t   xmlcharrefreplacec         C   s   t  j |  j  } | d  k rZ t j   } | d  k r? d } q` t j   j   pT d } n | } t |  j t	  r |  j j
 | |  S| | k r |  j St  j |  j |  j
 | |  S(   Ns   us-ascii(   R	   Rf   Rg   R,   R   Rd   Re   t
   isinstancet   descriptiont   unicodet   encodet   xml_to_unicode(   R8   Rj   t   errorst   mcsett   trnst   ccset(    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt   GetDescription	  s    	c         C   s  d |  _  t j t j j t j | p' d  d d t j d t j |  _	 | |  _
 | rm t j |  |  _ n	 d |  _ x3 |  j j D]% } t | d  r | j |   q q Wg  |  _ xE t t  D]7 } | j d  r q n  |  j j t t |     q Wd	 S(
   s6   Set transient variables of this and inherited classes.i    s   <site>s   .lockt   lifetimet   withloggingR!   R*   Rh   N(   t   _MailList__timestampR   R-   R.   R/   R   t   LOCK_DIRt   LIST_LOCK_LIFETIMEt   LIST_LOCK_DEBUGGINGRJ   RQ   R   t   get_listpathRR   R'   R(   R)   R*   RB   t   dirR   t
   startswitht   appendR@   (   R8   R9   R;   t	   component(    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyR*   "  s"    	"				c         C   s  | r | |  _  n  t j   |  _ d |  _ i  |  _ t j |  _ d |  _ d |  _	 i  |  _
 i  |  _ i  |  _ i  |  _ t j |  _ t j |  _ t j |  _ t j |  _ t j |  _ t j p t j |  _ t j p t j | p t j |  _ | g |  _ g  |  _  t j! |  _" d |  _# t j$ |  _% t j& |  _' t j( |  _) t j* |  _+ t j, |  _- t j. |  _/ t j0 |  _1 t j2 |  _3 t j4 |  _5 t j6 |  _7 t j8 |  _9 t j: |  _; t j< |  _= t j> |  _? g  |  _@ t jA |  _B t jC |  _D |  jE   } | d jF   | d |  _G d |  _H d |  _I d |  _J d |  _K t jL |  _M t jN |  _O t jP |  _Q t jR |  _S t jT |  _U t jV |  _W t jX |  _Y t jZ |  _[ t j\ |  _] g  |  _^ d |  __ d |  _` d |  _a t jb |  _c t jd |  _e t jf |  _g t jh |  _i t jj |  _k t jl |  _m t jn |  _o t jp |  _q t jr |  _s d |  _t t ju |  _v d |  _w t jx |  _y t jz |  _{ d |  _| d |  _} t j~ |  _ t j |  _ t j |  _ d |  _ g  |  _ t j |  _ t j |  _ g  |  _ g  |  _ g  |  _ g  |  _ t j |  _ t j |  _ d |  _ g  |  _ | |  _ i  |  _ x3 |  j j D]% } t | d  r%| j |   q%q%Wt j |  j |  _ t j |  _ t j |  _ t j |  j]  d k rd |  _ n	 d |  _ t j |  _ t j |  _ d S(	   s?   Assign default values - some will be overriden by stored state.i   i    g      ?R!   t   InitVarss   us-asciii   N(   RQ   t   timet
   created_att   volumet   membersR   t   DATA_FILE_VERSIONt   data_versiont   last_post_timet   post_idt   user_optionst   languaget	   usernamest	   passwordst   DEFAULT_NEW_MEMBER_OPTIONSt   new_member_optionst    DEFAULT_RESPOND_TO_POST_REQUESTSt   respond_to_post_requestst   DEFAULT_LIST_ADVERTISEDt
   advertisedt   DEFAULT_MAX_NUM_RECIPIENTSt   max_num_recipientst   DEFAULT_MAX_MESSAGE_SIZEt   max_message_sizet   DEFAULT_HOST_NAMEt   DEFAULT_EMAIL_HOSTRS   t   DEFAULT_URLt   DEFAULT_URL_PATTERNt   DEFAULT_URL_HOSTRy   RX   t	   moderatort   DEFAULT_REPLY_GOES_TO_LISTt   reply_goes_to_listt   reply_to_addresst   DEFAULT_FIRST_STRIP_REPLY_TOt   first_strip_reply_tot   DEFAULT_ADMIN_IMMED_NOTIFYt   admin_immed_notifyt   DEFAULT_ADMIN_NOTIFY_MCHANGESt   admin_notify_mchangest$   DEFAULT_REQUIRE_EXPLICIT_DESTINATIONt   require_explicit_destinationt   DEFAULT_ACCEPTABLE_ALIASESt   acceptable_aliasest   DEFAULT_UMBRELLA_LISTRo   t$   DEFAULT_UMBRELLA_MEMBER_ADMIN_SUFFIXRr   t   DEFAULT_REGULAR_EXCLUDE_LISTSt   regular_exclude_listst   DEFAULT_REGULAR_EXCLUDE_IGNOREt   regular_exclude_ignoret   DEFAULT_REGULAR_INCLUDE_LISTSt   regular_include_listst   DEFAULT_SEND_REMINDERSt   send_reminderst   DEFAULT_SEND_WELCOME_MSGt   send_welcome_msgt   DEFAULT_SEND_GOODBYE_MSGt   send_goodbye_msgt   DEFAULT_BOUNCE_MATCHING_HEADERSt   bounce_matching_headerst   header_filter_rulest   DEFAULT_FROM_IS_LISTt   from_is_listt   DEFAULT_ANONYMOUS_LISTt   anonymous_listRF   t   uppert	   real_nameR   t   infot   welcome_msgt   goodbye_msgt   DEFAULT_SUBSCRIBE_POLICYt   subscribe_policyt   DEFAULT_SUBSCRIBE_AUTO_APPROVALt   subscribe_auto_approvalt   DEFAULT_UNSUBSCRIBE_POLICYt   unsubscribe_policyt   DEFAULT_PRIVATE_ROSTERt   private_rostert   DEFAULT_OBSCURE_ADDRESSESt   obscure_addressest   DEFAULT_ADMIN_MEMBER_CHUNKSIZEt   admin_member_chunksizet   DEFAULT_ADMINISTRIVIAt   administriviat   DEFAULT_DROP_CCt   drop_cct   DEFAULT_SERVER_LANGUAGERg   t   available_languagest   include_rfc2369_headerst   include_list_post_headert   include_sender_headert   DEFAULT_FILTER_MIME_TYPESt   filter_mime_typest   DEFAULT_PASS_MIME_TYPESt   pass_mime_typest"   DEFAULT_FILTER_FILENAME_EXTENSIONSt   filter_filename_extensionst    DEFAULT_PASS_FILENAME_EXTENSIONSt   pass_filename_extensionst   DEFAULT_FILTER_CONTENTt   filter_contentt   DEFAULT_COLLAPSE_ALTERNATIVESt   collapse_alternativest!   DEFAULT_CONVERT_HTML_TO_PLAINTEXTt   convert_html_to_plaintextt   DEFAULT_FILTER_ACTIONt   filter_actiont   DEFAULT_NONDIGESTABLEt   nondigestablet   personalizet!   DEFAULT_DEFAULT_MEMBER_MODERATIONt   default_member_moderationt	   emergencyt"   DEFAULT_MEMBER_VERBOSITY_THRESHOLDt   member_verbosity_thresholdt!   DEFAULT_MEMBER_VERBOSITY_INTERVALt   member_verbosity_intervalt   member_moderation_actiont   member_moderation_noticet   DEFAULT_DMARC_MODERATION_ACTIONt   dmarc_moderation_actiont*   DEFAULT_DMARC_QUARANTINE_MODERATION_ACTIONt"   dmarc_quarantine_moderation_actiont$   DEFAULT_DMARC_NONE_MODERATION_ACTIONt   dmarc_none_moderation_actiont   dmarc_moderation_noticet   dmarc_moderation_addressest"   DEFAULT_DMARC_WRAPPED_MESSAGE_TEXTt   dmarc_wrapped_message_textt   DEFAULT_EQUIVALENT_DOMAINSt   equivalent_domainst   accept_these_nonmemberst   hold_these_nonmemberst   reject_these_nonmemberst   discard_these_nonmemberst   DEFAULT_FORWARD_AUTO_DISCARDSt   forward_auto_discardst    DEFAULT_GENERIC_NONMEMBER_ACTIONt   generic_nonmember_actiont   nonmember_rejection_noticet   ban_listt   passwordt   hold_and_cmd_autoresponsesR'   R(   R)   R   t   DEFAULT_SUBJECT_PREFIXt   __dict__t   subject_prefixt   DEFAULT_MSG_HEADERt
   msg_headert   DEFAULT_MSG_FOOTERt
   msg_footerR	   Rf   t   encode_ascii_prefixest   DEFAULT_SCRUB_NONDIGESTt   scrub_nondigestt   DEFAULT_MAX_DAYS_TO_HOLDt   max_days_to_hold(   R8   R9   t   admint   crypted_passwordt   urlhostt   internalnameR;   (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyR   =  s    																																			c         C   sY   d t  f d     Y} |   } x3 |  j D]( } | j   \ } } | | f | | <q) W| S(   Nt   CategoryDictc           B   s,   e  Z d    Z d   Z d   Z d   Z RS(   c         S   s   t  j |   t j |  _ d  S(   N(   R   R$   R   t   ADMIN_CATEGORIESt   keysinorder(   R8   (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyR$     s    c         S   s   |  j  S(   N(   R;  (   R8   (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt   keys  s    c         S   s8   g  } x+ t  j D]  } | j | |  j | f  q W| S(   N(   R   R:  R   t   data(   R8   t   itemst   k(    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyR>    s    c         S   s2   g  } x% t  j D] } | j |  j |  q W| S(   N(   R   R:  R   R=  (   R8   t   valuesR?  (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyR@    s    (   t   __name__t
   __module__R$   R<  R>  R@  (    (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyR9    s   			(   R   RB   t   GetConfigCategory(   R8   R9  t
   categoriest   guiR?  t   v(    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt   GetConfigCategories  s    	c         C   sI   xB |  j  D]7 } t | d  r
 | j |  } | d  k	 rA | Sq
 q
 Wd  S(   Nt   GetConfigSubCategories(   RB   R)   RH  R,   (   R8   t   categoryRE  t   subcat(    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyRH    s    c         C   sI   xB |  j  D]7 } t | d  r
 | j |  | |  } | rA | Sq
 q
 Wd  S(   Nt   GetConfigInfo(   RB   R)   RK  (   R8   RI  RJ  RE  t   value(    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyRK    s
    c         C   sT  | | j    k s t d   t j |  r< t j |  n  t t j t	 j
 d |   d k ro t j |  n  | d  k r t	 j } n  d | | f } y t j |  Wn  t j k
 r t j |  n Xt j |  | |  _ t j | d d |  _ |  j j   |  j | | | d | |  j   | d  k rG|  j g |  _ n	 | |  _ d  S(   Ns!   List name must be all lower case.R!   i    s   %s@%st   createi   R7  (   R   t   AssertionErrorR	   t   list_existsR
   t   MMListAlreadyExistsErrort   lent   ret   subR   t   ACCEPTABLE_LISTNAME_CHARACTERSt   BadListNameErrorR,   R   t   ValidateEmailt   EmailAddressErrorRQ   R   R   RR   RJ   R:   R   t   CheckValuesRg   R   (   R8   R9   R5  R6  t   langst	   emailhostR7  t   postingaddr(    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt   Create  s*    $	
c         C   s  t  j j |  j   d  } | d t j   t  j   f } | d } d  } yY t | d  } t	 j
 | | d  | j   t j r t  j | j    n  | j   WnB t k
 r } t d d |  | d  k	 r t  j |  n    n Xy t  j |  Wn+ t k
 r'} | j t j k r(  q(n Xy t  j | |  Wn+ t k
 ri} | j t j k rj  qjn Xt  j | |  t  j j |  |  _ d  S(   Ns
   config.pcks
   .tmp.%s.%ds   .lastt   wi   R%   s0   Failed config.pck write, retaining old state.
%s(   R-   R.   R/   R0   t   sockett   gethostnamet   getpidR,   t   opent   cPicklet   dumpt   flushR   t   SYNC_AFTER_WRITEt   fsynct   filenot   closeR2   R   t   unlinkt   OSErrorR3   R4   t   linkt   renamet   getmtimeR   (   R8   R=   t   fnamet	   fname_tmpt
   fname_lastt   fpR>   (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt   __save/  s:     

	
 
 
c         C   s   |  j  j   i  } xO |  j j   D]> \ } } | d d k s# t |  t k rW q# n  | | | <q# Wt j d  } z |  j |  Wd  t j |  |  j	   X|  j
   d  S(   Ni    Rh   i   (   RJ   t   refreshR*  R>  t   typet
   MethodTypeR-   t   umaskt   _MailList__savet   SaveRequestsDbt   CheckHTMLArchiveDir(   R8   R=   t   keyRL  t   omask(    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt   SaveW  s    "c      
   C   sb  | j  d  s | j  d  r* t j } n< | j  d  sH | j  d  rT t j } n d sf t d   y5 t j j |  } | |  j k  r d St
 |  } Wn2 t k
 r } | j t j k r   n  d  | f SXt t j    } z_ y& | |  } t |  t k r
d	 SWn2 t t t t t j t j f k
 r?} d  | f SXWd  | j   X| |  _ | d  f S(
   Ns   .dbs   .db.lasts   .pcks	   .pck.lasti    s   Bad database file names&   Load() expected to return a dictionary(   NN(   Ns&   Load() expected to return a dictionary(   t   endswitht   marshalt   loadRb  RN  R-   R.   Rm  R   R,   Ra  t   EnvironmentErrorR3   R4   t   intR   Rt  t   DictTypet   EOFErrort
   ValueErrort	   TypeErrort   MemoryErrort   PicklingErrort   UnpicklingErrorRh  (   R8   t   dbfilet   loadfunct   mtimeRq  R>   t   nowR=   (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt   __loadm  s4     	c   
      C   s  t  j |  j    s! t j  n  t j j |  j   d  } | d } t j j |  j   d  } | d } x | | | | f D]Q } |  j	 |  \ } } | d  k r | d  k	 r t d d | |  q d  Sq~ Pq~ Wt d d |  j    t j |  | | k s| | k rt d d |  t }	 zK y |  j j   Wn t j k
 rSt }	 n X|  j | | | | |  Wd  |	 r|  j j   n  Xn  |  j j |  | r|  j |  |  j   n  d  S(   Ns
   config.pcks   .lasts	   config.dbR%   s   couldn't load config file %s
%ss(   All %s fallbacks were corrupt, giving ups%   fixing corrupt config file, using: %s(   R	   RO  RF   R
   t   MMUnknownListErrorR-   R.   R/   R0   t   _MailList__loadR,   R   t   MMCorruptListDatabaseErrort   TrueRJ   R:   R   t   AlreadyLockedErrort   Falset   _MailList__fix_corrupt_pckfileRO   R*  t   updatet   CheckVersionRX  (
   R8   t   check_versiont   pfilet   plastt   dfilet   dlastt   fileR=   R>   RO   (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyR7     s@    

		
c         C   s|  | | k r y t  j | | d  Wn+ t k
 rQ } | j t j k rR   qR n Xy t  j | d  Wn+ t k
 r } | j t j k r   q n Xt j | |  t j | | d  n | | k rxy t  j | | d  Wn+ t k
 r} | j t j k r  qn Xy t  j | d  Wn+ t k
 rP} | j t j k rQ  qQn Xt j | |  t j | | d  n  d  S(   Ns   .corrupts   .safety(   R-   Rl  Rj  R3   R4   t   removet   shutilt   copy(   R8   R  R  R  R  R  R>   (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt   __fix_corrupt_pckfile  s4     
 
 
 
c         C   s   |  j  t j k r d S|  j   d |  _ |  j d d  |  j   } | sX |  j   n  z7 d d l m	 } | |  |  t j |  _  |  j
   Wd | s |  j   n  Xd S(   s    Auto-update schema if necessary.Ni    R  i(   t   Update(   R   R   R   R   R   R7   RE   R6   t   versionsR  R|  RL   (   R8   t   stored_statet	   waslockedR  (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyR    s    
	c         C   s  d t  |  j  d  k r8 t j p/ t j t j |  _ n  |  j rg |  j d d k rg |  j d |  _ n  y/ |  j j   r |  j r t	 j
 |  j  n  WnB t j k
 r t d d |  j |  j    d |  _ d |  _ n Xg  } x |  j D] } y | \ } } } } Wn- t k
 r6t d d | |  j    q n Xy& t j | j    } t j |  Wn3 t j t f k
 rt d d	 | |  j    q X| j | | | | f  q W| |  _ d
 S(   s+   Normalize selected values to known formats.R!   i   iRw   R%   s.   Bad reply_to_address "%s" cleared for list: %si    s   Bad topic "%s" for list: %ss#   Bad topic pattern "%s" for list: %sN(   R   Ry   R   R   R   R   R   t   stripR   R	   RV  R
   RW  R   RF   t   topicsR  t   ORR/   t
   splitlinesRR  t   compileR%   R  R   (   R8   t
   goodtopicsRL  R9   t   patternt   desct	   emptyflagt	   orpattern(    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyRX    s:    					c         C   s   t  j s t S|  j   } |  j |  |  j   } x | j   D] \ } } | d k r] q? n  | d  \ } } | t j k r | r | j j	   | j	   k s | t j
 k r? | r? | j	   | j	   k r? t Sq? Wt S(   s`   Check if there is already an unexpired pending (un)subscription for
        this email.
        t	   evictionst   versioni   (   R  R  (   R   t   REFUSE_SECOND_PENDINGR  t   _Pending__loadt   _Pending__saveR>  R   t   SUBSCRIPTIONt   addressR   t   UNSUBSCRIPTIONR  (   R8   t   emailt   unsubt   pendsR?  RF  t   opR=  (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt   CheckPendingD  s    	c         C   sy  | j  } t j |  |  j |  } | rS t d d |  j | |  t j |  n  |  j   | _	 |  j
 t j |  } |  j d  } d |  j d d d | f } |  j } | t j d i | d	 6| d
 6|  j d 6| d 6| d 6| d 6|  j   d 6d |  7} |  j |  }	 t j | |	 d | d |  j }
 |  j | |  } |
 d =| |
 d <|
 d =d |
 d <|
 j |   d S(   s   Invite a new member to the list.

        This is done by creating a subscription pending for the user, and then
        crafting a message to the member informing them of the invitation.
        t   vettes&   %s banned invitation: %s (matched: %s)RZ   s   %s/%st   confirmR{   i   s
   invite.txtR  Ri   t   hostnamet
   confirmurlt   requestaddrR]   t	   listownert   mlistt   textt   langRc   t   Subjects   auto-submitteds   auto-generateds   Auto-SubmittedN(   R  R	   RV  t   GetBannedPatternR   R   R
   t   MembershipIsBannedRF   t
   invitationt   pend_newR   R  RU   R|   t   maketextRS   RY   R^   R   t   UserNotificationRg   Rl   t   send(   R8   t   userdescR  t   inviteeR  R]   R  R  Ri   t   sendert   msgRk   (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt   InviteNewMemberY  sB    		
		


	

c         C   s  |  j    s t  t j | j  } t | d d  } t | d |  j  } t | d d-  } t | d t j    } | d- k r |  j	 r d } q d } n  t j
 |  |  j |  r t j |  n  |  j |  r t j |  n  | j   |  j   j   k rt j  n  |  j } |  j |  }	 |	 rn| r@d | }
 n d }
 t d	 d
 | | |
 |	  t j |	  n  | rt j rt j |  rd | }
 t d	 d | | |
  t j d  qn  | rt j rt j |  rt d	 d | |  t j d  qn  | r|  j rt j  n | r:|  j	 r:t j  n  | | _ | | _ | | _  | | _! | | _" |  j# d k r|  j$ | d | pd n(|  j# d k s|  j# d k rp|  j% t& j' |  } | d- k rd } } } n | } d | } t( d  } |  j) |  } d |  j* d d d | f } t j+ d i | d 6|  j   d 6| d 6| d 6|  j, d  d 6| d 6|  j-   d 6| d 6d  | d! |  } t. j/ | |  j0 |  d" | d  | } | d# =|  j1 | |  | d$ <|  j0 |  | d% <| j   j2 | j    rd& } n d' } | d( =| | d) <| j3 |   t4 | | f  } t d* d+ |  j5   | |  t j6  nJ |  j7 |  r|  j$ |  n+ |  j8 | | | | |  t j9 t( d,   d- S(.   s  Front end to member subscription.

        This method enforces subscription policy, validates values, sends
        notifications, and any other grunt work involved in subscribing a
        user.  It eventually calls ApprovedAddMember() to do the actual work
        of subscribing the user.

        userdesc is an instance with the following public attributes:

            address  -- the unvalidated email address of the member
            fullname -- the member's full name (i.e. John Smith)
            digest   -- a flag indicating whether the user wants digests or not
            language -- the requested default language for the user
            password -- the user's password

        Other attributes may be defined later.  Only address is required; the
        others all have defaults (fullname='', digests=0, language=list's
        preferred language, password=generated).

        remote is a string which describes where this add request came from.
        t   fullnameR!   R   t   digestR'  i    i   s    from %sR  s*   %s banned subscription: %s%s (matched: %s)s*   %s banned subscription: %s%s (Spamhaus IP)s   Spamhaus IPs)   %s banned subscription: %s (Spamhaus DBL)s   Spamhaus DBLt   whencei   t    s    from %(remote)ss   %s/%sR  R{   s
   verify.txtR  t   listaddrRi   R]   RZ   R  t   remotet	   listadminR  R  R  R  Rc   R  s   Reply-Tos   auto-replieds   auto-generateds   auto-submitteds   Auto-Submittedt	   subscribes   %s: pending %s %ss8   subscriptions to %(realname)s require moderator approvalN(:   RE   RN  R	   t   LCDomainR  R@   Rg   R,   t   MakeRandomPasswordR  RV  t   isMemberR
   t   MMAlreadyAMemberR  t   MMAlreadyPendingR   Rn   t   MMBadEmailErrorR   R  R   R  R   t"   BLOCK_SPAMHAUS_LISTED_IP_SUBSCRIBEt	   banned_ipt#   BLOCK_SPAMHAUS_LISTED_DBL_SUBSCRIBEt   banned_domaint
   digestablet   MMCantDigestErrort   MMMustDigestErrorR  R  R   R'  R   t   ApprovedAddMemberR  R   R  Rh   Rv   R|   R  RU   RY   R   R  R^   Rl   R}  R  R   RF   t   MMSubscribeNeedsConfirmationt   HasAutoApprovedSendert   HoldSubscriptiont   MMNeedApproval(   R8   R  R  R  R9   R  R  R'  t   realnameR  R  R]   t   oremotet   byt	   recipientR  R  R  t   autosubt   who(    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt	   AddMember  s    					
		
					



	
		c      
   C   sQ  |  j    s t  | d k r* |  j } n  | d k rB |  j } n  t j | j  } t | d d  } t | d |  j	  } t | d d  }	 t | d t j
    }
 |	 d k r |  j r d }	 q d }	 n  t j |  |  j |  r t j |  n  |  j |  } | rP| rd | } n d } t d	 d
 |  j | | |  t j |  n  |  j | d | d |	 d |
 d | |  j | t j d |  j  |  j | t j |  j  |	 rd } n d } t d d |  j   | t | | f  |  | rJ|  j	 } t j   } t j |  z# |  j  | |  j! |  |	 |  Wd t j" |  Xn  | rM|  j	 } t j   } t j |  z? | d k rd n d t# |  d } |  j } t# d  } Wd t j" |  Xt$ | t%  r| j& t j' |  d  } n  t j( d i | d 6t | | f  d 6| d 6d |  } t) j* |  | |  } | j+ |   n  d S(   s  Add a member right now.

        The member's subscription must be approved by what ever policy the
        list enforces.

        userdesc is as above in AddMember().

        ack is a flag that specifies whether the user should get an
        acknowledgement of their being subscribed.  Default is to use the
        list's default flag value.

        admin_notif is a flag that specifies whether the list owner should get
        an acknowledgement of this subscription.  Default is to use the list's
        default flag value.
        R  R!   R   R  R'  i    i   s    from %sR  s*   %s banned subscription: %s%s (matched: %s)R  s	    (digest)R  s   %s: new%s %s, %sNt   (t   )s&   %(realname)s subscription notificationt   replaces   adminsubscribeack.txtRi   Rs   R  R  (,   RE   RN  R,   R   R   R	   R  R  R@   Rg   R  R  RV  R  R
   R  R  R   R   R  t   addNewMembert   setMemberOptionR   t   DisableMimet   mime_is_default_digestt   ModerateR	  RF   R   R   Rd   t   set_languaget   SendSubscribeAckt   getMemberPasswordt   set_translationRh   R   t   UnicodeTypeR   Rf   R  R   t   OwnerNotificationR  (   R8   R  t   ackt   admin_notifR  R  R  R9   R  R  R'  R  t   sourcet   kindt   otransR  Rc   R  (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyR    s~    				
			&	

	c         C   s]   t  |  \ } } |  j d k r: |  j | | | |  n |  j |  t j t d   d  S(   Ni    s*   unsubscriptions require moderator approval(   R   R   t   ApprovedDeleteMembert   HoldUnsubscriptionR
   R  Rh   (   R8   R9   R  R  t   userackR  R  (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt   DeleteMembers  s    	c         C   sP  | d  k r |  j } n  | d  k r0 |  j } n  t |  \ } } |  j |  } |  j |  | rw |  j | |  n  t j |  j	  | r|  j
 } t d  }	 t j d i | d 6|  j
 d 6| d  k r d n d t |  d d 6d	 |  }
 t j |  |	 |
  } | j |   n  | r*d
 | } n d } t d d |  j   | |  d  S(   Ns%   %(realname)s unsubscribe notifications   adminunsubscribeack.txtRs   Ri   R!   R  R  R  R  s   ; %sR  s   %s: deleted %s%s(   R,   R   R   R   t   getMemberLanguaget   removeMembert   SendUnsubscribeAckR   R  Rg   R   Rh   R	   R  R   R   R  R   RF   (   R8   R9   R  R  R  R  t	   emailaddrt   userlangR  Rc   R  R  (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyR  |  s4    	

*		c         C   s   |  j  | |  | s d  Sx t j   D] } | |  j   k rE q' n  t | d d } | j |  j k ro q' n  | j |  s q' n  | j   z | j  | |  | j   Wd  | j	   Xq' Wd  S(   NR:   i    (
   t   setMemberNameR	   t
   list_namesRF   R#   RS   R  R6   R|  RL   (   R8   R_   R9   t   globallyRi   R  (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt   ChangeMemberName  s     
c         C   s  t  j |  } t  j |  | rS |  j |  rS | |  j |  k rS t j  n  | |  j   j   k rw t j	  n  |  j
 } |  j |  } | r t d d | | | |  t j |  n  |  j t j | | |  } d |  j d d d | f } |  j |  } t  j d i | d 6|  j   d	 6| d
 6| d 6|  j d  d 6d d 6|  j   d 6| d 6d | d |  }	 t j | |  j |  d |	 d | }
 |
 d =|  j | |  |
 d <|  j |  |
 d <|
 j |   d  S(   NR  s0   %s banned address change: %s -> %s (matched: %s)s   %s/%sR  R{   i   s
   verify.txtR  R  Ri   R]   RZ   R  R!   R  R  R  R  R  R  Rc   R  s   Reply-To(   R	   R  RV  R  t   getMemberCPAddressR
   R  Rn   R   R  R   R  R   R  R  R   t   CHANGE_OF_ADDRESSR|   R
  R  RU   RY   R   R  R^   Rl   R  (   R8   t   oldaddrt   newaddrR  R  R  R]   R  R  R  R  (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt   ChangeMemberAddress  sJ    	


c         C   s  |  j  |  } | r@ t d d |  j | | |  t j |  n  |  j |  } |  j |  r |  j |  | k r | | k r |  j |  q n  |  j | |  |  j	 | |  | s d  Sxt
 j   D]
} | |  j   k r q n  t | d d } | j |  j k rq n  | j |  s&q n  | j  |  r;q n  | j   z | j |  } | j |  r| j |  | k r| | k r| j |  qn  | j | |  | j	 | |  | j   Wd  | j   Xq Wd  S(   NR  s0   %s banned address change: %s -> %s (matched: %s)R:   i    (   R  R   R   R
   R  R  R  R  t   changeMemberAddresst   log_and_notify_adminR	   R  RF   R#   RS   R6   R|  RL   (   R8   R  R  R  R  t	   cpoldaddrRi   R  (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt   ApprovedChangeMemberAddress  sH    		
c   
      C   s"  t  d d |  j   | |  |  j r|  j } t j   } t j |  z |  j } t d  } Wd t j	 |  X|  j
 |  } | d k r d } n  t | t  r | j t j |  d  } n  t j d i | d 6| d	 6| d
 6|  j d 6d |  } t j |  | |  }	 |	 j |   n  d S(   s8   Log member address change and notify admin if requested.R  s(   %s: changed member address from %s to %ss(   %(realname)s address change notificationNR!   R  s   adminaddrchgack.txtR9   R  R  Ri   R  (   R   RF   R   Rg   R   Rd   R  R   Rh   R  t   getMemberNameR,   R   R  R   R	   Rf   R  R   R   R  (
   R8   R  R  R  R  R  Rc   R9   R  R  (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyR  &  s0    					
	c         C   s  |  j  |  } | d  k r. t j d |  n  y | d } | d } Wn$ t k
 rl t j d | f  n X| t j k rt a t d  } yc | d } t	 | t
  r | | 7} t d  } n  | j } | j }	 | j }
 | j } | j } Wn$ t k
 rt j d | f  n Xt j a t | d t  } | rj| |  j   k r|  j | |  t j  qnV |  j d k r|  j |  r|  j | |	 |
 | |  |  j } t j t d   n  |  j | d | | | |
 | | f S| t j k rX| d } t a t	 | t j  r&t d  } n t d  } t j a |  j | d | | | f S| t j k r| \ } } } |  j  | | |  | | | f S| t j! k r| d } d  } t	 | t j  r| j" d | j" d   } | sy& t# t$ j% j& | d d   d } Wn t' k
 r'd  } n X| rt( | j) d t*   } x t* r| j+   } | sePn  | j,   swqIn  | j- d  } | d k r| |  j,   j.   d k s| |  j,   j.   d k r| | d j,   } qn  PqIWqqn  | d  k	 rM|  j/ t0 j1 t0 j2 g |  t0 j3 k r1t0 j4 } qV|  j5 | |  t j6  n	 t0 j7 } y |  j8 | |  Wn! t9 k
 rt: d d |  n X| | f S| t j; k r| d } |  j< | t= j>  | | f Sd st? d |   d  S(   Ns   No cookie record for %si    i   s   op-less data %ss   via email confirmations   via web confirmations   bad subscr data %sR  i   i   s8   subscriptions to %(name)s require administrator approvalR  s   email confirmations   web confirmationt   Approvedt   ApproveR  t   plaint   decodet   :t   approvet   approvedR%   s"   Could not process HELD_MESSAGE: %ss
   Bad op: %s(   i   i   (@   t   pend_confirmR,   R
   t   MMBadConfirmationR  R   R  R    Rh   R   R   R  R  R'  R  R   R   R@   R  RF   t   SendHostileSubscriptionNoticet   HostileSubscriptionErrorR   R  R  R   R  R  R  R   R  R  R  t   HELD_MESSAGER5   t   listR  t	   Iteratorst   typed_subpart_iteratort
   IndexErrorR    t   get_payloadR  t   readlineR  t   findR   t   AuthenticateR   t   AuthListAdmint   AuthListModeratort   UnAuthorizedt   APPROVEt   pend_rependt   MMBadPasswordErrort   DISCARDt   HandleRequestt   KeyErrorR   t	   RE_ENABLEt   setDeliveryStatusR   t   ENABLEDRN  (   R8   R]   t   contextt   recR  R=  R  R  R_   R  R'  R  R  R  R9   R  R  R  RG   R#  t   subpartR   t   linet   it   actionRs   (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt   ProcessConfirmationF  s    


							
	


			


c   
      C   s  |  j  | d t r$ t j t  n  | d  k rB |  j |  } n  |  j t j	 |  } d |  j
 d d d | f } |  j } | d  k	 r d | } t d  } n d } d } t j d	 i | d
 6|  j   d 6| d 6| d 6|  j d  d 6| d 6|  j   d 6| d 6d | d |  } t j | |  j |  d | d | }	 |	 d =|  j | |  |	 d <|  j |  |	 d <|	 d =d |	 d <|	 j |   d  S(   NR  s   %s/%sR  R{   i   R  s    from %(remote)sR!   s	   unsub.txtR  R  Ri   R]   RZ   R  R  R  R  R  R  R  Rc   R  s   Reply-Tos   auto-submitteds   auto-generateds   Auto-Submitted(   R  R  R
   R  R  R,   R
  R  R   R  R|   R   Rh   R	   R  Rn   RU   RY   R   R  R^   Rm   R  (
   R8   R_   R  R  R]   R  R  R  R  R  (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt   ConfirmUnsubscription  sB    
	



c         C   s`  d |  j    |  j f } g  } g  } x- d	 D]% } | j t | j | g     q, Wxz | D]r \ } } | d
 k rz q\ n  | j   } | j d  d } | |  j    k s | | k r t S| j	 | | f  q\ Wd   }	 |  j
 j   }
 xo | D]g \ } } xX |
 D]P } | j   } | s"qn  d | k rA|	 | |  rAt S|	 | |  rt SqWq Wt S(   st   True if list name or any acceptable_alias is included among the
        addresses in the recipient headers.
        s   %s@%st   tot   ccs	   resent-tos	   resent-ccR`   i    c         S   s`   y  t  j |  | t  j  r t SWn9 t  j k
 r[ t  j t  j |   | t  j  r\ t Sn Xt S(   N(   RR  t   matcht
   IGNORECASER  R%   t   escapeR  (   R  R_   (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt   domatch  s    !(   RE  RF  s	   resent-tos	   resent-ccN(   RF   RS   R&   R   t   get_allR,   R   Rq   R  R   R   R  R  R  (   R8   R  t   listfullnamet   recipsRE  t   headerR  R_   t	   localpartRJ  t   aliasest   aliast   stripped(    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt   HasExplicitDest  s4    #	c         C   s  g  } x |  j  j d  D] } | j   } | s | d d k rH q n  | j d  } | d k  r| t d d |  j |  q | |  } | | d j   } y t j | t j	  } Wn/ t j
 k
 r } t d d |  j | |  q X| j | | | f  q W| S(	   s:   Return a list of triples [(field name, regex, line), ...].s   
i    t   #R!  t   configs&   bad bounce_matching_header line: %s
%si   s=   bad regexp in bounce_matching_header line: %s

%s (cause: %s)(   R   Rq   R  R/  R   R   t   lstripRR  R  RH  R%   R   (   R8   t   allR@  RA  RN  RL  t   creR>   (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt   parse_matching_header_opt+  s$    	
c         C   sT   xM |  j    D]? \ } } } x- | j | g   D] } | j |  r/ | Sq/ Wq Wd S(   s   Return true if named header field matches a regexp in the
        bounce_matching_header list variable.

        Returns constraint line which matches or empty string for no
        matches.
        i    (   RY  RK  t   search(   R8   R  RN  RX  R@  RL  (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt   hasMatchingHeaderK  s
    c   	      C   s  | d k r |  j } n  t j |  t j d k r8 d St j   d  } |  j j	 |  } | d k sv | d | k r | d f |  j | <d S| \ } } | d k  r t
 d d |  d S| t j k rpt
 d d |  | d f |  j | <t j d i | d	 6d
 |  j |  j f d 6| d 6|  j   d 6d | } t j | |  j   t d  | d | } | j |   d S| | d f |  j | <d S(   s  Return true if Mailman should auto-respond to this sender.

        This is only consulted for messages sent to the -request address, or
        for posting hold notifications, and serves only as a safety value for
        mail loops with email 'bots.
        i    i   i   R  s,   -request/hold autoresponse discarded for: %ss,   -request/hold autoresponse limit hit for: %sis   nomoretoday.txtR  s   %s@%sRi   t   numt
   owneremailR  s(   Last autoresponse notification for todayN(   R,   Rg   R   R  R   t   MAX_AUTORESPONSES_PER_DAYR   t	   localtimeR(  R5   R   R	   R  R   RS   RY   R   R  Rh   R  (	   R8   R  R  t   todayR   t   datet   countR  R  (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt   autorespondToSenderX  sD    		
		c         C   s(   |  j  | |  j  p' |  j  | t j  S(   s\   Returns matched entry in ban_list if email matches.
        Otherwise returns None.
        (   t
   GetPatternR&  R   t   GLOBAL_BAN_LIST(   R8   R  (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyR    s    c         C   sG   t  } |  j | |  j d d rC t } t d d |  j   |  n  | S(   s   Returns True and logs if sender matches address or pattern
        or is a member of a referenced list in subscribe_auto_approval.
        Otherwise returns False.
        t   at_listR   R  s#   %s: auto approved subscribe from %s(   R  Rd  R   R  R   RF   (   R8   R  t   auto_approve(    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyR    s    				c      	   C   s  d } g  | D]= } | j   r | j d  p: | j d  r | j   ^ q } t j | d d } | j | j    r~ | SxZ| D]R} | j d  ry& t j | | t j	  r | } Pn  Wqt j
 k
 r	}	 | p d }
 t d d |
 |  j   | t |	   qXq | r | j d  r | d j   j   } | |  j   k rit d d | |  j    q n  y t | d	 t } Wn3 t j k
 rt d d
 | |  j   |  q n X| j | j    r| } Pqq q W| S(   s   Returns matched entry in pattern_list if email matches.
        Otherwise returns None.  The at_list argument, if "true",
        says process the @listname syntax and provides the name of
        the list attribute for log messages.
        t   ^R`   t   foldcasei   R&  R%   s    %s in %s has bad regexp "%s": %ss   %s in %s references own listR:   s(   %s in %s references non-existent list %sN(   R,   R  R   R	   t	   List2Dictt   has_keyR   RR  RZ  RH  R%   R   RF   t   strR#   R  R
   R  R  (   R8   R  t   pattern_listRf  t   matchedt   xt
   plainaddrst   addrdictR  R>   t	   attr_namet   mnamet   mother(    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyRd    sR    1		c         C   sT   |  j  } t j | k r+ | j t j  n  g  | D] } t j j |  r2 | ^ q2 S(   N(   R   R   R   R   t   LC_DESCRIPTIONSRk  (   R8   RY  R  (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt   GetAvailableLanguages  s    	N(:   RA  RB  R,   R$   RD   RI   R6   RL   RE   RF   R0   RU   RW   RY   R^   R\   Rl   Rm   Rn   Rv   R|   R   R   R*   R   RG  RH  RK  R\  Rw  R|  R  R  R7   R  R  RX  R  R  R  R  R  R	  R  R  R  R  R  RC  RD  RS  RY  R[  Rc  R  R  Rd  Rv  (    (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyR#   Z   sp   &		
																(	(		:6	"		..	\	!		:	:	 )	9	 	1		B(E   t   __doc__t   sysR-   R   R~  R3   RR  R  R^  R   Rb  t	   cStringIOR    R   R   t   typest   email.IteratorsR  t   email.UtilsR   R   R   t   email.HeaderR   t   MailmanR   R	   R
   R   t   Mailman.UserDescR   t   Mailman.ArchiverR   t   Mailman.AutoresponderR   t   Mailman.BouncerR   t   Mailman.DelivererR   t   Mailman.DigesterR   t   Mailman.GatewayManagerR   t   Mailman.HTMLFormatterR   t   Mailman.ListAdminR   t   Mailman.SecurityManagerR   t   Mailman.TopicMgrR   R   R   R   t   Mailman.OldStyleMembershipsR   R   R   R   t   Mailman.Logging.SyslogR   Rh   R    t   EMPTYSTRINGR  R  R  t	   NameErrorR#   (    (    (    s/   /export/web/mailman/mailman/Mailman/MailList.pyt   <module>   sh   
		
