a Ö>ïhIã@sZddlZddlmZmZmZmZGdd„deƒZGdd„deeƒZGdd„deeeƒZdS) éN)ÚPluginÚ RedHatPluginÚ DebianPluginÚ UbuntuPluginc@s4eZdZdZdZdZdZdd„Zdd„Zd d „Z d S) ÚPostfixzPostfix smtp serverÚpostfix)ZmailZservices©rcCs¦gd¢}g}z‚t| d¡dddZ}| ¡D]@}| d¡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 r r 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_descZ plugin_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 Ú sf