;ò
£)?Bc           @   s|  d  Z  d k Z d k Z d k Z d k Z d k Z d k Td k l Z d k l	 Z	 d k l
 Z
 d k l Z d k l Z d k l Z e i i e i d	 ƒ Z e i i e i d
 ƒ Z e i i e i d ƒ Z y e e f Wn e j
 o d Z d Z n Xd „  Z d „  Z d „  Z d „  Z d „  Z d „  Z  d „  Z! d „  Z" e e e d „ Z# d „  Z$ e d „ Z% d „  Z& d S(   s-   Creation/deletion hooks for the Postfix MTA.
N(   s   *(   s   mm_cfg(   s   Utils(   s   LockFile(   s   _(   s   makealiases(   s   syslogs   creators   aliasess   virtual-mailmani   i    c          C   sý   d } t i d t } t i | ƒ d ?d @}  |  o? t i |  ƒ } t
 d | | |  | ƒ t | | |  | f ‚ n t i i t ƒ or t i d t } t i | ƒ d ?d @}  |  o? t i |  ƒ } t
 d | | |  | ƒ t | | |  | f ‚ qù n d  S(   Ns#   command failed: %s (status: %s, %s)s    i   iÿ   s   error(   s   msgs   mm_cfgs   POSTFIX_ALIAS_CMDs	   ALIASFILEs   acmds   oss   systems   statuss   strerrors   errstrs   syslogs   RuntimeErrors   paths   existss   VIRTFILEs   POSTFIX_MAP_CMDs   vcmd(   s   statuss   acmds   errstrs   msgs   vcmd(    (    s#   /var/mailman/Mailman/MTA/Postfix.pys   _update_maps.   s    c           C   s   t  i  t ƒ Sd  S(   N(   s   LockFiles   LOCKFILE(    (    (    s#   /var/mailman/Mailman/MTA/Postfix.pys   makelock@   s    c         C   s4   t  i i |  ƒ o t |  d ƒ } | i ƒ  n d  S(   Ns   w(   s   oss   paths   existss   filenames   opens   fps   close(   s   filenames   fp(    (    s#   /var/mailman/Mailman/MTA/Postfix.pys   _zapfileD   s    c           C   s   t  t ƒ t  t ƒ d  S(   N(   s   _zapfiles	   ALIASFILEs   VIRTFILE(    (    (    s#   /var/mailman/Mailman/MTA/Postfix.pys   clearL   s    
c         C   sF  t  i t  i d d ƒ ƒ d } t i i t i d ƒ } | i d d ƒ | i ƒ  o0 | d IJ| d IJ| d | | f IJ| Jn |  t j o d  Sn |  i ƒ  } t | ƒ t d	 ƒ } | d
 I| IJ| d It i t i ƒ  ƒ IJx@ t | ƒ D]2 \ } } | | d I| t | ƒ d | IJqø W| d I| IJ| Jd  S(   Ns   extras   loopi    s   owner-bounces.mboxi   s  # This file is generated by Mailman, and is kept in sync with the
# binary hash file aliases.db.  YOU SHOULD NOT MANUALLY EDIT THIS FILE
# unless you know what you're doing, and can keep the two files properly
# in sync.  If you screw it up, you're on your own.
s#   # The ultimate loop stopper addresss   %s: %ss   -unsubscribes   # STANZA START:s
   # CREATED:s   :s    s   # STANZA END:(   s   Utilss
   ParseEmails   get_site_emails   loopaddrs   oss   paths   joins   mm_cfgs   DATA_DIRs   loopmboxs   fps   seeks   tells   mlists   Nones   internal_names   listnames   lens   fieldszs   times   ctimes   makealiasess   ks   v(   s   mlists   fps   listnames   fieldszs   loopaddrs   vs   loopmboxs   k(    (    s#   /var/mailman/Mailman/MTA/Postfix.pys   _addlistR   s&    

 *c   
   
   C   s$  |  i ƒ  } t | ƒ t d ƒ } |  i } t i |  i d d ƒ} t i
 | ƒ d } | i d d ƒ | i ƒ  o | d | | f IJn | d I| IJ| d It i t i ƒ  ƒ IJxN t | ƒ D]@ \ }	 } d	 |	 | f } | | I| t |	 ƒ d
 I|	 IJqÈ W| d I| IJ| Jd  S(   Ns   -unsubscribes   extras   loopi    i   sÌ  # This file is generated by Mailman, and is kept in sync with the binary hash
# file virtual-mailman.db.  YOU SHOULD NOT MANUALLY EDIT THIS FILE unless you
# know what you're doing, and can keep the two files properly in sync.  If you
# screw it up, you're on your own.
#
# Note that you should already have this virtual domain set up properly in
# your Postfix installation.  See README.POSTFIX for details.

# LOOP ADDRESSES START
%s	%s
# LOOP ADDRESSES END
s   # STANZA START:s
   # CREATED:s   %s@%ss    s   # STANZA END:(   s   mlists   internal_names   listnames   lens   fieldszs	   host_names   hostnames   Utilss   get_site_emails   loopaddrs
   ParseEmails   loopdests   fps   seeks   tells   times   ctimes   makealiasess   ks   vs   fqdnaddr(
   s   mlists   fps   fieldszs   vs   listnames   hostnames   loopaddrs   fqdnaddrs   loopdests   k(    (    s#   /var/mailman/Mailman/MTA/Postfix.pys   _addvirtualw   s     	 (c         C   sŒ  t  i |  i d d ƒ} t  i | ƒ d } t | ƒ } t
 i d ƒ } z t | d d ƒ } Wd  t
 i | ƒ Xzî xG t o? | i ƒ  } | o Pn | i | ƒ | i d ƒ o Pqt qt WxŠ t o‚ | i ƒ  } | o Pn | i d ƒ o& | d	 | | f IJ| i | ƒ Pq¾ | i | ƒ o | i | ƒ Pq¾ | i | ƒ q¾ W| i | i ƒ  ƒ Wd  | i ƒ  | i ƒ  Xt
 i | d | ƒ d  S(
   Ns   extras   loopi    i   s   .tmps   ws   # LOOP ADDRESSES STARTs   # LOOP ADDRESSES ENDs   %s	%s(   s   Utilss   get_site_emails   mlists	   host_names   loopaddrs
   ParseEmails   loopdests   opens   filenames   infps   oss   umasks   omasks   outfps   Trues   readlines   lines   writes
   startswiths
   writeliness	   readliness   closes   rename(   s   mlists   filenames   outfps   loopaddrs   loopdests   lines   omasks   infp(    (    s#   /var/mailman/Mailman/MTA/Postfix.pys   _check_for_virtual_loopaddrž   sF      
  
c         C   s¹   y t  | d ƒ } Wnb t j
 oV } | i t i j o ‚  n t i d ƒ } z t  | d ƒ } Wd  t i | ƒ Xn Xz | |  | ƒ Wd  | i ƒ  X| t j o t |  | ƒ n d  S(   Ns   r+i   s   w+(   s   opens   textfiles   fps   IOErrors   es   errnos   ENOENTs   oss   umasks   omasks   funcs   mlists   closes   _addvirtuals   _check_for_virtual_loopaddr(   s   mlists   textfiles   funcs   fps   es   omask(    (    s#   /var/mailman/Mailman/MTA/Postfix.pys
   _do_createÉ   s        c         C   s‘   t  } | o t ƒ  } | i ƒ  n zI t |  t t ƒ |  o |  i t	 i
 j o t |  t t ƒ n t ƒ  Wd  | o | i d t ƒ n Xd  S(   Ns   unconditionally(   s   Nones   locks   nolocks   makelocks
   _do_creates   mlists	   ALIASFILEs   _addlists	   host_names   mm_cfgs   POSTFIX_STYLE_VIRTUAL_DOMAINSs   VIRTFILEs   _addvirtuals   _update_mapss   unlocks   True(   s   mlists   cgis   nolocks   quiets   lock(    (    s#   /var/mailman/Mailman/MTA/Postfix.pys   createÝ   s    	 c         C   sa  |  i ƒ  } t } y t | ƒ } Wn3 t j
 o' } | i
 t
 i j o ‚  n d  Sn XzÙ t i d ƒ }
 z t | d d ƒ } Wd  t i |
 ƒ Xt } d | } d | } x n oy | i ƒ  }	 |	 o Pn | o+ |	 i ƒ  | j o t } | i ƒ  q+q¯ |	 i ƒ  | j o
 t } q¯ | i |	 ƒ q¶ WWd  | i ƒ  | i ƒ  Xt i | d | ƒ d  S(   Ni   s   .tmps   ws   # STANZA START: s   # STANZA END: i   (   s   mlists   internal_names   listnames   Nones   outfps   opens   textfiles   infps   IOErrors   es   errnos   ENOENTs   oss   umasks   omasks   Falses
   filteroutps   starts   ends   readlines   lines   strips   Trues   writes   closes   rename(   s   mlists   textfiles   virtualps   listnames   es
   filteroutps   starts   outfps   ends   lines   omasks   infp(    (    s#   /var/mailman/Mailman/MTA/Postfix.pys
   _do_removeï   sB     	 

 
 
c         C   sm   t  ƒ  } | i ƒ  zB t |  t t ƒ |  i t i j o t |  t	 t
 ƒ n t ƒ  Wd  | i d t
 ƒ Xd  S(   Ns   unconditionally(   s   makelocks   locks
   _do_removes   mlists	   ALIASFILEs   Falses	   host_names   mm_cfgs   POSTFIX_STYLE_VIRTUAL_DOMAINSs   VIRTFILEs   Trues   _update_mapss   unlock(   s   mlists   cgis   lock(    (    s#   /var/mailman/Mailman/MTA/Postfix.pys   remove  s    	
 c         C   sb  t  t Bt Bt Bt B} xEt t f D]7} |  i
 o t d ƒ GHn t }	 y t i | ƒ }	 Wn/ t j
 o# } | i t i j o ‚  q n X|	 o |	 t | @| j o_ |  i d 7_ t |	 t ƒ } t d ƒ G|  i o' t d ƒ GHt i | |	 t | Bƒ qHn | d } t }	 y t i | ƒ }	 Wn2 t j
 o& } | i t i j o ‚  q# q# n X|  i
 o t d ƒ GHn t i }
 |	 t t i |
 ƒ d j } | o³ y t i! |	 t ƒ d } Wn! t# j
 o d	 |	 t } n Xt d
 ƒ GH|  i d 7_ |  i oK t d ƒ GHt i |
 ƒ d } t% i& t i' ƒ d } t i) | | | ƒ qZHq# q# Wd  S(   Ns    checking permissions on %(file)si   s3   %(file)s permissions must be 066x (got %(octmode)s)s   (fixing)s   .dbs    checking ownership of %(dbfile)si   i    s   uid %ds8   %(dbfile)s owned by %(owner)s (must be owned by %(user)s(*   s   S_IFREGs   S_IRUSRs   S_IWUSRs   S_IRGRPs   S_IWGRPs
   targetmodes	   ALIASFILEs   VIRTFILEs   files   states   VERBOSEs   _s   Nones   stats   oss   OSErrors   es   errnos   ENOENTs   ST_MODEs   ERRORSs   octs   octmodes   FIXs   chmods   dbfiles   mm_cfgs   MAILMAN_USERs   users   ST_UIDs   pwds   getpwnams   owneroks   getpwuids   owners   KeyErrors   uids   grps   getgrnams   MAILMAN_GROUPs   gids   chown(   s   states   owneroks   uids
   targetmodes   files   dbfiles   octmodes   owners   gids   stats   users   e(    (    s#   /var/mailman/Mailman/MTA/Postfix.pys
   checkperms.  sX     




	
('   s   __doc__s   oss   pwds   grps   times   errnos   stats   Mailmans   mm_cfgs   Utilss   LockFiles   Mailman.i18ns   _s   Mailman.MTA.Utilss   makealiasess   Mailman.Logging.Syslogs   syslogs   paths   joins   LOCK_DIRs   LOCKFILEs   DATA_DIRs	   ALIASFILEs   VIRTFILEs   Trues   Falses	   NameErrors   _update_mapss   makelocks   _zapfiles   clears   _addlists   _addvirtuals   _check_for_virtual_loopaddrs
   _do_creates   creates
   _do_removes   removes
   checkperms(   s   _check_for_virtual_loopaddrs   _update_mapss
   checkpermss   syslogs   _addlists   LockFiles   VIRTFILEs   grps	   ALIASFILEs   errnos   creates   _addvirtuals   Trues   _zapfiles   pwds   mm_cfgs
   _do_removes   LOCKFILEs   _s   makealiasess   Falses   Utilss
   _do_creates   removes   times   oss   clears   makelock(    (    s#   /var/mailman/Mailman/MTA/Postfix.pys   ?   s@   										%	'	+		0