HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python3/dist-packages/sos/report/plugins/__pycache__/postfix.cpython-38.pyc
U

i��d��@sZddlmZmZmZmZddlZGdd�de�ZGdd�dee�ZGdd�deee�ZdS)	�)�Plugin�RedHatPlugin�DebianPlugin�UbuntuPluginNc@s4eZdZdZdZdZdZdd�Zdd�Zd	d
�Z	dS)�PostfixzPostfix smtp server�postfix)Zmail�services�rcCs�ddddddddd	d
ddd
ddddg}g}dzjt|�d�d��P}|��D]@}|�d�rXqH|�d�}|d��|krH|�|d��d�qHW5QRXW5|�SX)NZlmtp_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�lineZwords�r�</usr/lib/python3/dist-packages/sos/report/plugins/postfix.py�forbidden_ssl_keys_filess8�

&z Postfix.forbidden_ssl_keys_filesc
Cs�d}g}d}t�d�}z�t|�d�d���}|��D]|}t�dd|�}|�|�}|dkrXq2|�d���}||kr2|�d	���}	t	|	�d
kr�q2|	�
|�r�|	t	|�d�}	|�|	�q2W5QRXWn<tk
r�}
zd|
j
d
��}|�|�W5d}
~
XYnX|S)N)Zlmtp_sasl_password_mapsZsmtp_sasl_password_mapsZpostscreen_dnsbl_reply_mapZsmtp_sasl_auth_cache_namezhash:z
^(.*)=(.*)r
rz#.*�r�rzError parsing main.cf: )�re�compilerrr�sub�match�groupr�lenrr�	Exception�argsZ
_log_error)rrr�prefixZ
option_formatrrZoptionZ	attribute�filepath�e�msgrrr�forbidden_password_files9s.


z Postfix.forbidden_password_filescCsJ|�dg�|�ddg�|�dddg�|�|���|�|���dS)Nz
/etc/postfix/ZpostconfZmailqz/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,r/rrrrrs#$rcs$eZdZdZdZ�fdd�Z�ZS)�
RedHatPostfix)z/etc/rc.d/init.d/postfixr	cstt|���|�d�dS)Nz	/etc/mail)�superr4r/r-r.��	__class__rrr/tszRedHatPostfix.setup)r0r1r2�filesr3r/�
__classcell__rrr6rr4osr4cs eZdZdZ�fdd�Z�ZS)�
DebianPostfixr	cstt|���dS)N)r5r:r/r.r6rrr/}szDebianPostfix.setup)r0r1r2r3r/r9rrr6rr:ysr:)	Zsos.report.pluginsrrrrr rr4r:rrrr�<module>	sa