%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/utils/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/utils/smtp.pyc

�
���^c@@s�dZddlmZmZmZddlZddlZddlZddlm	Z	ddl
mZyddlZe
ZWnek
r�eZnXeje�Zd�ZdS(u�
Return salt data via email

The following fields can be set in the minion conf file:

    smtp.from (required)
    smtp.to (required)
    smtp.host (required)
    smtp.port (optional, defaults to 25)
    smtp.username (optional)
    smtp.password (optional)
    smtp.tls (optional, defaults to False)
    smtp.subject (optional, but helpful)
    smtp.gpgowne' (optional)
    smtp.fields (optional)
    smtp.content (optional)

There are a few things to keep in mind:

* If a username is used, a password is also required. It is recommended (but
  not required) to use the TLS setting when authenticating.
* You should at least declare a subject, but you don't have to.
* The use of encryption, i.e. setting gpgowner in your settings, requires
  python-gnupg to be installed.
* The field gpgowner specifies a user's ~/.gpg directory. This must contain a
  gpg public key matching the address the mail is sent to. If left unset, no
  encryption will be used.
i(tabsolute_importtprint_functiontunicode_literalsN(t
formatdate(tsixc	
C@s2d}i}x$|D]}|j|d�||<qW|j|�|dsWd|d<ntjd
|d�tjd|d�tr5|d	r5tjdtjj	dj
|d	��ddg�}|j|d
|d�}|jr	tjd�t
j|�|d
<q5tjd�dj
|j|j�|d
<ndj
|d|dtdt�|d|d
�}tjd�tj|dt|d��}|dtkr�|j�tjd�n|dr�|dr�|j|d|d�tjd�n|j|d|d|�tjd�|j�dS(u%
    Send an email with the data
    usmtp.tou	smtp.fromu	smtp.hostu	smtp.portusmtp.tlsu
smtp.usernameu
smtp.passwordusmtp.subjectu
smtp.gpgownerusmtp.contentuiuSMTP port has been set to %susmtp_return: Subject is '%s't	gnupghomeu~{0}/.gnupgtoptionsu--trust-model alwaysu"smtp_return: Encryption successfulu;SMTP: Encryption failed, only an error message will be sentu<Encryption failed, the return data was not sent.

{0}
{1}u2From: {0}
To: {1}
Date: {2}
Subject: {3}

{4}t	localtimeu(smtp_return: Connecting to the server...usmtp_return: TLS enabledusmtp_return: Authenticatedusmtp_return: Message sent.N(
usmtp.tou	smtp.fromu	smtp.hostu	smtp.portusmtp.tlsu
smtp.usernameu
smtp.passwordusmtp.subjectu
smtp.gpgownerusmtp.content(tgettupdatetlogtdebugt	HAS_GNUPGtgnupgtGPGtostpatht
expandusertformattencrypttokRt	text_typeterrortstatuststderrRtTruetsmtplibtSMTPtinttstarttlstlogintsendmailtquit(	tkwargstoptstopt_keystconfigtkeytgpgtencrypted_datatmessagetserver((s3/usr/lib/python2.7/site-packages/salt/utils/smtp.pytsend2s`



			


 

(t__doc__t
__future__RRRRtloggingRtemail.utilsRtsalt.extRR
RRtImportErrortFalset	getLoggert__name__R
R*(((s3/usr/lib/python2.7/site-packages/salt/utils/smtp.pyt<module>s




Zerion Mini Shell 1.0