From 0954364c14fd4951e8cc391fd68dfa27e5be3c88 Mon Sep 17 00:00:00 2001 From: Amit Dhingra Date: Mon, 23 Oct 2023 21:17:57 +0000 Subject: [PATCH] Fix gmi send -d (dry-run) msg within send function is used to read in stdin first. Later on in the function msg is used to get back data from the message send, however this occurs inside a `not dry-run` condition. When a dry-run is made, msg is not updated and holds stale data from stdin.read. The function then fails trying to print the stale msg data. Fix by seperating into two print statements, one for the dry-run, and one without. --- lieer/gmailieer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lieer/gmailieer.py b/lieer/gmailieer.py index d267f02..243f1be 100755 --- a/lieer/gmailieer.py +++ b/lieer/gmailieer.py @@ -1093,8 +1093,10 @@ def send(self, args): msg = self.remote.send(msg, threadId) self.get_content([msg["id"]]) self.get_meta([msg["id"]]) + self.vprint("message sent successfully: %s" % msg["id"]) + else: + self.vprint("message sent successfully: dry-run") - self.vprint("message sent successfully: %s" % msg["id"]) def set(self, args): args.credentials = "" # for setup()