Commit ce5dfc7e authored by Daniel STAN's avatar Daniel STAN
Browse files templating

On répare l'envoi de mail au passage
parent 22d5baae
Envoyé à disconnect chaque jour
Upload des serveurs (à partir de {{seuil_upload}})
Disconnect team
......@@ -23,6 +23,7 @@ import psycopg2.extras
import smtplib
import gestion.config.upload as upload_config
import gestion.config as config
from gestion import mail as mail_module
ldap = lc_ldap.shortcuts.lc_ldap_readonly()
encoding = "UTF-8"
......@@ -189,27 +190,17 @@ if __name__ == "__main__":
if args.mail:
expediteur = ""
destinataire = ""
message = """From: %(From)s
To: %(To)s
Subject: Statistiques des =?utf-8?q?derni=C3=A8res?= 24h
X-Mailer: /usr/scripts/surveillance/
Content-Type: text/plain; charset="utf-8"
Upload des serveurs (à partir de %(seuil_upload)s)
corps = message % {
'From': expediteur,
'To': destinataire,
'upload_srv': fetched_upload_srv,
'seuil_upload': upload_config.pretty_seuil,
# Testing purpose:
# destinataire = ""
corps = mail_module.generate('upload_stats',
'from': expediteur,
'to': destinataire,
'upload_srv': fetched_upload_srv,
'seuil_upload': upload_config.pretty_seuil,
mail = smtplib.SMTP('localhost')
mail.sendmail(expediteur, expediteur, corps)
mail.sendmail(expediteur, destinataire, corps)
print fetched_upload_srv
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment