ajoute une option very-verbose pour les trames smtp

This commit is contained in:
François Poulain 2020-08-25 09:26:21 +02:00
parent f8d0bbd001
commit 2e6c786f4f
1 changed files with 5 additions and 1 deletions

View File

@ -56,6 +56,9 @@ def parse_args():
parser.add_argument(
"-v", "--verbose", action="store_true",
)
parser.add_argument(
"-vv", "--very-verbose", action="store_true",
)
parser.add_argument(
"-a", "--attachement", type=str, nargs="+", help="Optionnal attachments.",
)
@ -157,7 +160,8 @@ def send_message(templates, data, attachments, args):
if not args.dry_run:
# sending the mail to its recipients using the local mailer via SMTP
server = smtplib.SMTP("localhost", "25")
server.set_debuglevel(1)
if args.very_verbose:
server.set_debuglevel(1)
server.send_message(msg)
server.quit()