HEX
Server: Apache
System: Linux insrv.serversdaddy.com 5.14.0-362.24.2.el9_3.x86_64 #1 SMP PREEMPT_DYNAMIC Sat Mar 30 14:11:54 EDT 2024 x86_64
User: jsaha (1066)
PHP: 8.3.6
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/lib/python3.9/site-packages/sos/report/plugins/__pycache__/postfix.cpython-39.pyc
a

^��c��@sZddlmZmZmZmZddlZGdd�de�ZGdd�dee�ZGdd�deee�ZdS)	�)�Plugin�RedHatPlugin�DebianPlugin�UbuntuPluginNc@s4eZdZdZdZdZdZdd�Zdd�Zd	d
�Z	dS)�PostfixzPostfix smtp server�postfix)ZmailZservices�rcCs�gd�}g}z�t|�d�d��Z}|��D]@}|�d�r8q(|�d�}|d��|vr(|�|d��d�q(Wd�n1s~0YW|S|YS0dS)N)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�#�=r�)�open�	path_join�	readlines�
startswith�split�strip�append)�self�forbid_attributes�fp�cffile�line�words�r�>/usr/lib/python3.9/site-packages/sos/report/plugins/postfix.py�forbidden_ssl_keys_filess

8z Postfix.forbidden_ssl_keys_filesc
Csd}g}d}t�d�}z�t|�d�d���}|��D]|}t�dd|�}|�|�}|durXq2|�d���}||vr2|�d	���}	t	|	�d
kr�q2|	�
|�r�|	t	|�d�}	|�|	�q2Wd�n1s�0YWn@t�y}
z&d|
j
d
��}|�|�WYd}
~
n
d}
~
00|S)N)Zlmtp_sasl_password_mapsZsmtp_sasl_password_mapsZpostscreen_dnsbl_reply_mapZsmtp_sasl_auth_cache_namezhash:z
^(.*)=(.*)r	r
z#.*�r
�rzError parsing main.cf: )�re�compilerrr�sub�match�groupr�lenrr�	Exception�argsZ
_log_error)rrr�prefixZ
option_formatrr�optionZ	attribute�filepath�e�msgrrr�forbidden_password_files9s.


. 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_pathrr-�rrrr�setup]s��z
Postfix.setupN)
�__name__�
__module__�__qualname__Z
short_descZplugin_nameZprofiles�packagesrr-r0rrrrrs#$rcs$eZdZdZdZ�fdd�Z�ZS)�
RedHatPostfix)z/etc/rc.d/init.d/postfixrcstt|���|�d�dS)Nz	/etc/mail)�superr5r0r.r/��	__class__rrr0tszRedHatPostfix.setup)r1r2r3�filesr4r0�
__classcell__rrr7rr5osr5cs eZdZdZ�fdd�Z�ZS)�
DebianPostfixrcstt|���dS)N)r6r;r0r/r7rrr0}szDebianPostfix.setup)r1r2r3r4r0r:rrr7rr;ysr;)	Zsos.report.pluginsrrrrr rr5r;rrrr�<module>	sa