Match only on the header field body

The match_field() method should match on the header field body and not
the whole header field, thus the field name part is ignored.
This commit is contained in:
Lefteris Chatzimparmpas 2011-08-16 22:51:01 +02:00
parent c6515ebf7f
commit 2599efc94e

View File

@ -1123,7 +1123,7 @@ function Mailbox.match_field(self, field, pattern, messages)
local results = {}
for m, f in pairs(fields) do
if (regex_search(pattern, f)) then
if (regex_search(pattern, (string.gsub(f, "^[^:]*: ?(.*)$", "%1")))) then
table.insert(results, {self, m})
end
end