diff --git a/imap-probe.js b/imap-probe.js index ffe101f..c500fa5 100644 --- a/imap-probe.js +++ b/imap-probe.js @@ -133,8 +133,8 @@ function searchMessage(message, needle) { if (needle.subject && message.subject[0].match(needle.subject) === null) return false; if (needle.body && message.body.match(needle.body) === null) return false; - if (needle.to && message.to.match(needle.to) === null) return false; - if (needle.from && message.from.match(needle.from) === null) return false; + if (needle.to && message.to[0].match(needle.to) === null) return false; + if (needle.from && message.from[0].match(needle.from) === null) return false; return true; }