summaryrefslogtreecommitdiff
path: root/program/steps/mail/search.inc
diff options
context:
space:
mode:
Diffstat (limited to 'program/steps/mail/search.inc')
-rw-r--r--program/steps/mail/search.inc3
1 files changed, 2 insertions, 1 deletions
diff --git a/program/steps/mail/search.inc b/program/steps/mail/search.inc
index a3f6dda66..5ed6627ef 100644
--- a/program/steps/mail/search.inc
+++ b/program/steps/mail/search.inc
@@ -64,7 +64,8 @@ else if (preg_match("/^body:/i", $str))
// search in subject and sender by default
else
{
- $subject = array("HEADER SUBJECT", "HEADER FROM");
+ $from = ($mbox == $CONFIG['sent_mbox'] || $mbox == $CONFIG['drafts_mbox']) ? "TO" : "FROM";
+ $subject = array("HEADER SUBJECT", "HEADER $from");
$search = trim($str);
}