ó
Tü½cc           @   sö   d  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 m	 Z	 d d l
 m Z d d l m Z m Z d d	 l m Z y e e f Wn e k
 rÁ d
 Z d Z n Xd „  Z d „  Z e e e d „ Z e d „ Z d S(   s6   Creation/deletion hooks for manual /etc/aliases files.iÿÿÿÿN(   t   StringIO(   t   mm_cfg(   t   Message(   t   Utils(   t   get_switchboard(   t   _t   C_(   t   makealiasesi   i    c          C   s   d d d „  ƒ  Y}  |  ƒ  S(   Nt   Dummyc           B   s   e  Z d  „  Z e d „ Z RS(   c         S   s   d  S(   N(    (   t   self(    (    s1   /export/web/mailman/mailman/Mailman/MTA/Manual.pyt   lock*   s    c         S   s   d  S(   N(    (   R	   t   unconditionally(    (    s1   /export/web/mailman/mailman/Mailman/MTA/Manual.pyt   unlock,   s    (   t   __name__t
   __module__R
   t   FalseR   (    (    (    s1   /export/web/mailman/mailman/Mailman/MTA/Manual.pyR   )   s   	(    (    (   R   (    (    s1   /export/web/mailman/mailman/Mailman/MTA/Manual.pyt   makelock(   s    c           C   s   d  S(   N(    (    (    (    s1   /export/web/mailman/mailman/Mailman/MTA/Manual.pyt   clear1   s    c         C   s+  |  d  k r d  S|  j ƒ  } t | ƒ t d ƒ } | rc t ƒ  } | sZ | t d ƒ IJn  | } n( | sw t d ƒ GHn  t d ƒ GHt j } xB t | ƒ D]4 \ } }	 | | d I| t | ƒ d I|	 IJq˜ W| sÞ | Jd  St	 j
 d d ƒ }
 t j |
 |
 t d	 ƒ | j ƒ  t j ƒ } | j |  ƒ d  S(
   Ns   -unsubscribes1  The mailing list `%(listname)s' has been created via the through-the-web
interface.  In order to complete the activation of this mailing list, the
proper /etc/aliases (or equivalent) file must be updated.  The program
`newaliases' may also have to be run.

Here are the entries for the /etc/aliases file:
s©   To finish creating your mailing list, you must edit your /etc/aliases (or
equivalent) file by adding the following lines, and possibly running the
`newaliases' program:
s   ## %(listname)s mailing listt   :t    t   extrat   owners3   Mailing list creation request for list %(listname)s(   t   Nonet   internal_namet   lenR    R   R   t   syst   stdoutR   R   t   get_site_emailR   t   UserNotificationt   getvalueR   t   DEFAULT_SERVER_LANGUAGEt   send(   t   mlistt   cgit   nolockt   quiett   listnamet   fieldszt   sfpt   outfpt   kt   vt	   siteownert   msg(    (    s1   /export/web/mailman/mailman/Mailman/MTA/Manual.pyt   create7   s6    			,	c         C   s5  |  j  ƒ  } t | ƒ t d ƒ } | rJ t ƒ  } | t d ƒ IJ| } n t d ƒ GHt j } xB t | ƒ D]4 \ } } | | d I| t | ƒ d I| IJqk W| s± | Jd  St j	 d d ƒ } t
 j | | t d ƒ | j ƒ  t j ƒ }	 t j j d	 d
 ƒ |	 d <t t j ƒ }
 |
 j |	 d | g d d
 ƒd  S(   Ns   -unsubscribesO  The mailing list `%(listname)s' has been removed via the through-the-web
interface.  In order to complete the de-activation of this mailing list, the
appropriate /etc/aliases (or equivalent) file must be updated.  The program
`newaliases' may also have to be run.

Here are the entries in the /etc/aliases file that should be removed:
sÉ   
To finish removing your mailing list, you must edit your /etc/aliases (or
equivalent) file by removing the following lines, and possibly running the
`newaliases' program:

## %(listname)s mailing listR   R   R   R   s2   Mailing list removal request for list %(listname)st	   localtimei   t   Datet   recipst
   nodecorate(   R   R   R    R   R   R   R   R   R   R   R   R   R   R   R   t   emailt
   formatdateR   t   OUTQUEUE_DIRt   enqueue(   R    R!   R$   R%   R&   R'   R(   R)   R*   R+   t   outq(    (    s1   /export/web/mailman/mailman/Mailman/MTA/Manual.pyt   removei   s.    				,	(   t   __doc__R   t   email.UtilsR1   t	   cStringIOR    t   MailmanR   R   R   t   Mailman.Queue.sbcacheR   t   Mailman.i18nR   R   t   Mailman.MTA.UtilsR   t   TrueR   t	   NameErrorR   R   R,   R6   (    (    (    s1   /export/web/mailman/mailman/Mailman/MTA/Manual.pyt   <module>   s$   
			2