smtpdummy: Support SMTPUTF8

This commit is contained in:
Geoffrey Frogeye 2022-03-20 18:09:04 +01:00
parent 984d62e7ff
commit 4b9d696aee
Signed by: geoffrey
GPG key ID: C72403E7F82E6AD8

View file

@ -56,6 +56,7 @@ if __name__ == "__main__":
env_var="SUBJECT",
default=f"Test message {now.strftime('%H:%M:%S')}",
)
parser.add_argument("-8", "--smtputf8", env_var="SMTPUTF8", action="store_true")
parser.add_argument("-c", "--callout", env_var="CALLOUT", action="store_true")
parser.add_argument("-b", "--body", env_var="BODY", default="")
@ -193,7 +194,7 @@ Input arguments:
+ password.encode()
).decode()
send(f"AUTH PLAIN {encoded}")
send(f"MAIL FROM: <{args.sender}>")
send(f"MAIL FROM: <{args.sender}>" + (" SMTPUTF8" if args.smtputf8 else ""))
for receiver in args.receiver:
send(f"RCPT TO: <{receiver}>")
if not args.callout: