+
    G%@iI                     n    ^ RI t ^ RIHtHtHtHt  ! R R]4      t ! R R]]4      t ! R R]]]4      tR# )	    N)PluginRedHatPluginDebianPluginUbuntuPluginc                   B   a  ] tR t^t o RtRtRtR	tR tR t	R t
RtV tR# )
PostfixzPostfix smtp serverpostfixc                   . ROp. p \        V P                  R4      RRR7      ;_uu_ 4       pVP                  4        Fx  pVP                  R4      '       d   K  VP	                  R4      pV^ ,          P                  4       V9   g   KK  VP                  V^,          P	                  4       ^ ,          4       Kz  	  RRR4       V#   + '       g   i     T# ; i  \         d     T# i ; i)	zXlist of attributes defining a location of a SSL key file
we must forbid from collection
/etc/postfix/main.cfrUTF-8encoding#=N)lmtp_tls_dkey_filelmtp_tls_eckey_filelmtp_tls_key_filesmtp_tls_dkey_filesmtp_tls_eckey_filesmtp_tls_key_filesmtpd_tls_dkey_filesmtpd_tls_eckey_filesmtpd_tls_key_file"tls_legacy_public_key_fingerprintstlsproxy_tls_dkey_filetlsproxy_tls_eckey_filetlsproxy_tls_key_filesmtpd_tls_dh1024_param_filesmtpd_tls_dh512_param_filetlsproxy_tls_dh1024_param_filetlsproxy_tls_dh512_param_file)open	path_join	readlines
startswithsplitstripappend	Exception)selfforbid_attributesfpathscffilelinewordss   &     </usr/lib/python3/dist-packages/sos/report/plugins/postfix.pyforbidden_ssl_keys_files Postfix.forbidden_ssl_keys_files   s    
& 	dnn%;<c&( (+1",,.Ds++  JJsOEQx~~'+<<eAhnn&6q&9: /( ( (   		s5   %C AC	1C:C C	C C C'&C'c                   Rp. pRp\         P                  ! R4      p \        V P                  R4      RRR7      ;_uu_ 4       pVP	                  4        F  p\         P
                  ! RRV4      pVP                  V4      pVf   K2  VP                  ^4      P                  4       pW9   g   KY  VP                  ^4      P                  4       p	\        V	4      ^ 8X  d   K  V	P                  V4      '       d   V	\        V4      R	 p	VP                  V	4       K  	  R	R	R	4       V#   + '       g   i     T# ; i  \         d3   p
R
T
P                  ^ ,           2pT P                  T4        R	p
?
T# R	p
?
ii ; i)z$Get the list of password to exclude zhash:z
^(.*)=(.*)r   r   r   r   z#.* NzError parsing main.cf: )lmtp_sasl_password_mapssmtp_sasl_password_mapspostscreen_dnsbl_reply_mapsmtp_sasl_auth_cache_name)recompiler#   r$   r%   submatchgroupr(   lenr&   r)   r*   args
_log_error)r+   r,   r-   prefixoption_formatr.   r/   option	attributefilepatherrmsgs   &           r1   forbidden_password_files Postfix.forbidden_password_files;   sN   
 

=1	!dnn%;<c&( (+1",,.D66%T2D*006F~  !'Q 5 5 7I 5#)<<?#8#8#:x=A-$#..v66'/F'=Hh/# /(0 1( (0 	  	!+CHHQK=9COOC  		!sC   %D6 A%D"-AD"5#D"D6 "D3	-D6 3D6 6E3'E..E3c                    V P                  R .4       V P                  RR.4       V P                  . RO4       V P                  V P                  4       4       V P                  V P	                  4       4       R# )z/etc/postfix/postconfmailqN)z/etc/postfix/*.keyz/etc/postfix/*.crtz/etc/postfix/ssl/)add_copy_specadd_cmd_outputadd_forbidden_pathr2   rI   )r+   s   &r1   setupPostfix.setupa   sx    
 	 	
 	
 	 !
 	
 	 = = ?@ = = ?@     N)mailservicesr	   )__name__
__module____qualname____firstlineno__
short_descplugin_nameprofilespackagesr2   rI   rQ   __static_attributes____classdictcell__)__classdict__s   @r1   r   r      s1     &JK#HH$L$LA ArS   r   c                   :   a a ] tR t^st oRtRtV 3R ltRtVtV ;t	# )RedHatPostfixc                F   < \         SV `  4        V P                  R 4       R# )z	/etc/mailN)superrQ   rN   )r+   	__class__s   &r1   rQ   RedHatPostfix.setupx   s    ;'rS   rT   )z/etc/rc.d/init.d/postfixrW   )
rX   rY   rZ   r[   filesr_   rQ   r`   ra   __classcell__)rg   rb   s   @@r1   rd   rd   s   s     )EH( (rS   rd   c                       ] tR t^}tRtRtR# )DebianPostfixrT   NrW   )rX   rY   rZ   r[   r_   r`   rT   rS   r1   rl   rl   }   s    HrS   rl   )	r:   sos.report.pluginsr   r   r   r   r   rd   rl   rT   rS   r1   <module>rn      s?    
 O OcAf cAL(G\ (G\< rS   