+
    iI  c                   sn    ^ 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# )	i    N)PluginRedHatPluginDebianPluginUbuntuPluginc                   sB   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                s   . 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ZencodingZ#Z=N)Zlmtp_tls_dkey_fileZlmtp_tls_eckey_fileZlmtp_tls_key_fileZsmtp_tls_dkey_fileZsmtp_tls_eckey_fileZsmtp_tls_key_fileZsmtpd_tls_dkey_fileZsmtpd_tls_eckey_fileZsmtpd_tls_key_fileZ"tls_legacy_public_key_fingerprintsZtlsproxy_tls_dkey_fileZtlsproxy_tls_eckey_fileZtlsproxy_tls_key_fileZsmtpd_tls_dh1024_param_fileZsmtpd_tls_dh512_param_fileZtlsproxy_tls_dh1024_param_fileZtlsproxy_tls_dh512_param_file)open	path_join	readlines
startswithZsplitstripappend	Exception)selfforbid_attributesfpathscffilelineZwordss   &     ?/usr/lib/python3.14/site-packages/sos/report/plugins/postfix.pyforbidden_ssl_keys_filesZ 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                s   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#.*Z NzError parsing main.cf: )Zlmtp_sasl_password_mapsZsmtp_sasl_password_mapsZpostscreen_dnsbl_reply_mapZsmtp_sasl_auth_cache_name)reZcompiler
   r   r   ZsubZmatchZgroupr   Zlenr   r   r   ZargsZ
_log_error)r   r   r   ZprefixZoption_formatr   r   ZoptionZ	attributeZfilepathZerrZmsgs   &           r   forbidden_password_filesZ 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                s    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/ZpostconfZmailqN)z/etc/postfix/*.keyz/etc/postfix/*.crtz/etc/postfix/ssl/)add_copy_specZadd_cmd_outputZadd_forbidden_pathr   r   )r   s   &r   setupZPostfix.setupa   sx    
 	 	
 	
 	 !
 	
 	 = = ?@ = = ?@     N)ZmailZservicesr   )__name__
__module____qualname____firstlineno__Z
short_descZplugin_nameZprofilespackagesr   r   r   __static_attributes____classdictcell__)__classdict__s   @r   r   r      s1     &JK#HH$L$LA Ar   r   c                   s:   a a ] tR t^st oRtRtV 3R ltRtVtV ;t	# )RedHatPostfixc                sF   < \         SV `  4        V P                  R 4       R# )z	/etc/mailN)Zsuperr   r   )r   	__class__s   &r   r   ZRedHatPostfix.setupx   s    ;'r   r   )z/etc/rc.d/init.d/postfixr   )
r   r    r!   r"   Zfilesr#   r   r$   r%   Z__classcell__)r(   r&   s   @@r   r'   r'   s   s     )EH( (r   r'   c                   s    ] tR t^}tRtRtR# )DebianPostfixr   Nr   )r   r    r!   r"   r#   r$   r   r   r   r)   r)   }   s    Hr   r)   )	r   Zsos.report.pluginsr    r   r   r   r   r'   r)   r   r   r   <module>r*      s?    
 O OcAf cAL(G\ (G\< r   