U
    ](                     @   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 )zSend email notification.

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

    ZFromzCertbot renewal agent <root>ZToZSubjectrootz/usr/sbin/sendmailz-t)stdinFT)emailZmessage_from_stringZ
add_headerZ	as_stringsmtplibZLMTPZconnectZsendmailZSMTPHeloErrorZSMTPRecipientsRefusedZSMTPSenderRefusedZSMTPDataErrorsocketerror
subprocessPopenPIPEZcommunicateOSError)ZsubjectZwhomZwhatmsgZlmtpproc r   0/usr/lib/python3/dist-packages/certbot/notify.pynotify	   s,    

  
r   )__doc__r   r   r   r   r   r   r   r   r   <module>   s
   