summaryrefslogtreecommitdiff
path: root/spelling-rbead
diff options
context:
space:
mode:
authorSimon Parri <simonparri@ganzeria.com>2023-04-29 19:39:49 -0500
committerSimon Parri <simonparri@ganzeria.com>2023-04-29 19:39:49 -0500
commitb99d71047a4fcc7d379bdb0db0169809cf98d343 (patch)
tree69f0208f79c44b6f5155644a7a94afa1ad5e7917 /spelling-rbead
parent03247c99d2ed5fe6bb614de76353868df0f0823e (diff)
downloadspelling-rbee-b99d71047a4fcc7d379bdb0db0169809cf98d343.tar.gz
spelling-rbee-b99d71047a4fcc7d379bdb0db0169809cf98d343.zip
spelling-rbead: Allow for running without --from
Diffstat (limited to 'spelling-rbead')
-rwxr-xr-xspelling-rbead4
1 files changed, 3 insertions, 1 deletions
diff --git a/spelling-rbead b/spelling-rbead
index 4e92938..00f01eb 100755
--- a/spelling-rbead
+++ b/spelling-rbead
@@ -28,7 +28,9 @@ unless $help
imap = Net::IMAP.new $server
imap.login $user, $password
imap.select "inbox"
- n = imap.search("FROM \"#{$from}\" SUBJECT \"#{$subject}\"").last
+
+ from = $from ? "FROM \"#{$from}\" " : ""
+ n = imap.search("#{from}SUBJECT \"#{$subject}\"").last
if n
msgs = imap.fetch n, "body[1.text]"
c = msgs[0].attr["BODY[1.TEXT]"]