smtpdummy: Support Stalwart
This commit is contained in:
parent
4fd1028e1f
commit
3129ec76bf
1 changed files with 4 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
#!/usr/bin/env nix-shell
|
#!/usr/bin/env nix-shell
|
||||||
#! nix-shell -i python3
|
#! nix-shell -i python3
|
||||||
#! nix-shell -p python3 python3Packages.colorama python3Packages.configargparse
|
#! nix-shell -p python3 python3Packages.colorama python3Packages.configargparse
|
||||||
|
# vim: filetype=python
|
||||||
|
|
||||||
import base64
|
import base64
|
||||||
import datetime
|
import datetime
|
||||||
|
@ -60,6 +61,7 @@ if __name__ == "__main__":
|
||||||
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("-8", "--smtputf8", env_var="SMTPUTF8", action="store_true")
|
||||||
|
parser.add_argument("-C", "--crlf", env_var="CRLF", 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="")
|
||||||
|
@ -188,6 +190,8 @@ Input arguments:
|
||||||
|
|
||||||
assert isinstance(p.stdin, io.BufferedWriter)
|
assert isinstance(p.stdin, io.BufferedWriter)
|
||||||
cmd = command.encode() + b"\n"
|
cmd = command.encode() + b"\n"
|
||||||
|
if args.crlf:
|
||||||
|
cmd = cmd.replace(b"\n", b"\r\n")
|
||||||
p.stdin.write(cmd)
|
p.stdin.write(cmd)
|
||||||
p.stdin.flush()
|
p.stdin.flush()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue