HEX
Server: Apache/2.4.62 (Unix) OpenSSL/1.1.1k
System: Linux ns565604.ip-54-39-133.net 4.18.0-553.50.1.el8_10.x86_64 #1 SMP Tue Apr 15 08:09:22 EDT 2025 x86_64
User: greer489 (1034)
PHP: 8.3.19
Disabled: NONE
Upload Files
File: //usr/lib/python3.6/site-packages/setroubleshoot/__pycache__/email_alert.cpython-36.pyc
3

�h>`�
�@s�ddlmZdgZddlZddlZddlmZddlmZddl	m
Z
ddlmZddl
Tejd	�Zd
d�Zdd�Zed
kr�edd�dS)�)�absolute_import�email_alertN)�MIMEText)�
MIMEMultipart)�
formatdate)�
get_config)�*z ^\s*([^@ \t]+)(@([^@ \t]+))?\s*$cCs2tj|�}d}d}|r*|jd�}|jd�}||fS)N��)�
email_addr_re�search�group)Zaddr�match�userZdomain�r�!/usr/lib/python3.6/email_alert.py�parse_email_addr$s


rcCsPtdd�}tddt�}tdd�}t|�\}}|dkr8d}|dkrFt�}d||f}td||dj|�f�|j�|j|j��}d	tdd
�|f}|j	�|j
�}	td�}
||
d<||
d
<dj|�|
d<t�|
d<|
j
t|	��ddl}y*|j||�}|j|||
j��|j�Wn8|jk
�rJ}
ztjtjd|
�WYdd}
~
XnXdS)NZemail�	smtp_host�	smtp_port�from_addressZSELinuxTroubleshootz%s@%szalert smtp=%s:%d  -> %s�,z[%s] %s�subject�alternativeZSubjectZFromz, ZToZDaterzemail failed: %s)r�intrZget_hostnameZ	log_debug�joinZ%update_derived_template_substitutionsZ
substitute�summaryZformat_textZformat_detailsrrZattachr�smtplibZSMTPZsendmailZ	as_string�quitZ
SMTPException�syslogZLOG_ERR)ZsiginfoZto_addrsrrrZ	from_userZfrom_domainrr�textZ	email_msgrZsmtp�errrr.s6


�__main__zThis is the sigzThis is the solution)Z
__future__r�__all__r�reZemail.mime.textrZemail.mime.multipartrZemail.utilsrZsetroubleshoot.configrZsetroubleshoot.util�compilerrr�__name__rrrr�<module>s

%