U
    ÓZj(  ã                   @   s0   d Z ddlZddlZddlZddlZdd„ ZdS )z2Send e-mail notification to system administrators.é    Nc                 C   sÄ   t  |¡}| dd¡ | d|¡ | d| ¡ | ¡ }z$t ¡ }| ¡  | d|g|¡ W nd tjtj	tj
tjtjfk
r¾   z"tjddgtjd�}| |¡ W n tk
r¸   Y Y d	S X Y nX d
S )zœSend email notification.

    Try to notify the addressee (``whom``) by e-mail, with Subject:
    defined by ``subject`` and message body by ``what``.

    ÚFromzCertbot renewal agent <root>ÚToÚSubjectÚrootz/usr/sbin/sendmailz-t)ÚstdinFT)ÚemailÚmessage_from_stringÚ
add_headerÚ	as_stringÚsmtplibZLMTPÚconnectZsendmailZSMTPHeloErrorZSMTPRecipientsRefusedZSMTPSenderRefusedZSMTPDataErrorÚsocketÚerrorÚ
subprocessÚPopenÚPIPEÚcommunicateÚOSError)ÚsubjectZwhomÚwhatÚmsgZlmtpÚproc© r   úQ/var/www/html/TRUCKING_PROJECT/venv/lib/python3.8/site-packages/certbot/notify.pyÚnotify	   s,    

  ÿ
ÿr   )Ú__doc__r   r   r   r   r   r   r   r   r   Ú<module>   s
   