supprime du code mort

This commit is contained in:
François Poulain 2020-08-24 22:36:13 +02:00
parent 68b053ee91
commit e7b20230ee

View File

@ -22,9 +22,8 @@
# This program is used to mail a message to several recipients, thus
# providing customization for each recipient.
import argparse, csv, sys, re
import argparse, csv, sys
import smtplib, time, mimetypes
from email.header import Header
from email.message import EmailMessage
from jinja2 import Environment, FileSystemLoader, select_autoescape
@ -140,16 +139,6 @@ BCCPATTERN = re.compile(r"^Bcc: *(.*)")
REPLYTOPATTERN = re.compile(r"^Reply-To: *(.*)")
def qencode_subject(message):
subjectmatches = re.search(r"^Subject: *(.*)$", message, re.MULTILINE)
if subjectmatches == None:
return message
subjectstr = subjectmatches.group(1)
h = Header(subjectstr, "utf-8")
qsubjectstr = h.encode()
return message.replace(subjectstr, qsubjectstr, 1)
def send_message(message, to, attachments, args):
lines = message.split("\n")