From 2e6c786f4f11d93207c801c5f4b6b3d5eddf394a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Poulain?= Date: Tue, 25 Aug 2020 09:26:21 +0200 Subject: [PATCH] ajoute une option very-verbose pour les trames smtp --- mailing.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mailing.py b/mailing.py index 405dfc1..bf1b3c2 100755 --- a/mailing.py +++ b/mailing.py @@ -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()