Commit 3b694646 authored by Pierre-Elliott Bécue's avatar Pierre-Elliott Bécue
Browse files

[chambres_vides] Headers correctement échappés = better

parent 1fff9ce1
......@@ -20,7 +20,7 @@ import sys
sendmails = False
if "--mail-all" in sys.argv:
sendmails = True
import email.Header
from email.header import Header
#: Envoyer un mail à respbats
sendmail_respbats = True
......@@ -98,7 +98,7 @@ if to_print != []:
for aid, ip, mid, hostname in to_print:
message += template % (aid, ip, mid, hostname)
message += tiret_line
headers = u"From: respbats@crans.org\nSubject: %s\n" % email.Header.make_header([("Machines supprimées pour chambre invalide", "utf8")]).encode()
headers = u"From: respbats@crans.org\nSubject: %s\n" % Header("Machines supprimées pour chambre invalide", "utf8").encode()
headers += u"Content-Type: text/plain; charset=UTF-8\n"
headers += u"To: respbats@crans.org\n"
mail = headers + "\n" + message
......
Markdown is supported
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