Skip to content

Commit

Permalink
Fix gmi send -d (dry-run)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mechanicalamit committed Oct 23, 2023
1 parent 85f5151 commit 0954364
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lieer/gmailieer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 0954364

Please sign in to comment.