HEX
Server: Apache
System: Linux 185.122.168.184.host.secureserver.net 5.14.0-570.60.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Nov 5 05:00:59 EST 2025 x86_64
User: barbeatleanalyti (1024)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //lib/python3.9/site-packages/sos/report/plugins/__pycache__/postfix.cpython-39.pyc
a

\��hI�@sZddlZddlmZmZmZmZGdd�de�ZGdd�dee�ZGdd�deee�ZdS)	�N)�Plugin�RedHatPlugin�DebianPlugin�UbuntuPluginc@s4eZdZdZdZdZdZdd�Zdd�Zd	d
�Z	dS)�PostfixzPostfix smtp server�postfix)ZmailZservices�rcCs�gd�}g}z�t|�d�ddd��Z}|��D]@}|�d�r<q,|�d�}|d��|vr,|�|d	��d�q,Wd
�n1s�0YWnty�Yn0|S)zi list of attributes defining a location of a SSL key file
        we must forbid from collection
        )Zlmtp_tls_dkey_fileZlmtp_tls_eckey_fileZlmtp_tls_key_fileZsmtp_tls_dkey_fileZsmtp_tls_eckey_fileZsmtp_tls_key_fileZsmtpd_tls_dkey_fileZsmtpd_tls_eckey_fileZsmtpd_tls_key_fileZ"tls_legacy_public_key_fingerprintsZtlsproxy_tls_dkey_fileZtlsproxy_tls_eckey_fileZtlsproxy_tls_key_fileZsmtpd_tls_dh1024_param_fileZsmtpd_tls_dh512_param_fileZtlsproxy_tls_dh1024_param_fileZtlsproxy_tls_dh512_param_file�/etc/postfix/main.cf�r�UTF-8��encoding�#�=r�N)�open�	path_join�	readlines�
startswith�split�strip�append�	Exception)�self�forbid_attributes�fpaths�cffile�line�words�r�>/usr/lib/python3.9/site-packages/sos/report/plugins/postfix.py�forbidden_ssl_keys_filess �

:z Postfix.forbidden_ssl_keys_filesc
Csd}g}d}t�d�}z�t|�d�ddd���}|��D]|}t�dd	|�}|�|�}|d
ur\q6|�d���}||vr6|�d���}	t	|	�d
kr�q6|	�
|�r�|	t	|�d
�}	|�|	�q6Wd
�n1s�0YWn@t�y}
z&d|
j
d
��}|�|�WYd
}
~
n
d
}
~
00|S)z% Get the list of password to exclude )Zlmtp_sasl_password_mapsZsmtp_sasl_password_mapsZpostscreen_dnsbl_reply_mapZsmtp_sasl_auth_cache_namezhash:z
^(.*)=(.*)r	r
rrz#.*�Nr�rzError parsing main.cf: )�re�compilerrr�sub�match�groupr�lenrrr�argsZ
_log_error)rrr�prefixZ
option_formatrr�optionZ	attribute�filepath�err�msgrrr �forbidden_password_files;s4
�

. z Postfix.forbidden_password_filescCsH|�dg�|�ddg�|�gd��|�|���|�|���dS)Nz
/etc/postfix/ZpostconfZmailq)z/etc/postfix/*.keyz/etc/postfix/*.crtz/etc/postfix/ssl/)�
add_copy_specZadd_cmd_outputZadd_forbidden_pathr!r0�rrrr �setupas��z
Postfix.setupN)
�__name__�
__module__�__qualname__Z
short_descZplugin_nameZprofiles�packagesr!r0r3rrrr r
s&&rcs$eZdZdZdZ�fdd�Z�ZS)�
RedHatPostfix)z/etc/rc.d/init.d/postfixrcst���|�d�dS)Nz	/etc/mail)�superr3r1r2��	__class__rr r3xs
zRedHatPostfix.setup)r4r5r6�filesr7r3�
__classcell__rrr:r r8ssr8c@seZdZdZdS)�
DebianPostfixrN)r4r5r6r7rrrr r>}sr>)	r$Zsos.report.pluginsrrrrrr8r>rrrr �<module>	sf