smtpdummy: Support SMTPUTF8
This commit is contained in:
parent
984d62e7ff
commit
4b9d696aee
|
@ -56,6 +56,7 @@ if __name__ == "__main__":
|
||||||
env_var="SUBJECT",
|
env_var="SUBJECT",
|
||||||
default=f"Test message {now.strftime('%H:%M:%S')}",
|
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("-c", "--callout", env_var="CALLOUT", action="store_true")
|
||||||
|
|
||||||
parser.add_argument("-b", "--body", env_var="BODY", default="")
|
parser.add_argument("-b", "--body", env_var="BODY", default="")
|
||||||
|
@ -193,7 +194,7 @@ Input arguments:
|
||||||
+ password.encode()
|
+ password.encode()
|
||||||
).decode()
|
).decode()
|
||||||
send(f"AUTH PLAIN {encoded}")
|
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:
|
for receiver in args.receiver:
|
||||||
send(f"RCPT TO: <{receiver}>")
|
send(f"RCPT TO: <{receiver}>")
|
||||||
if not args.callout:
|
if not args.callout:
|
||||||
|
|
Loading…
Reference in a new issue