summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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]"]