Mail search / filter preview not matching on email addresses in from header


One of our users was trying to test his mail filters using the 'Show Matching Email in Folder' button in the filter edit dialog of Usermin and found the search results were coming up empty when part of the email address was used in the header From: field. For example, if a message contains a From: of "Joe User" and you search for 'support' or '', there are no results, but 'Joe' or 'User' will properly display the message.

This applies to a plain old mail search as well, using Any or From. I'm guessing the filter preview just runs through the regular mail search function. It seems like the email address part of the From: is stripped off or completely ignored.

The actual filter itself works fine when mail is run through the server via SMTP/procmail. The message is matched on the partial email address and the filter action is performed.

I'm sure this worked properly at one time, but I couldn't tell you when since we're mostly working over IMAP. I'm thinking this is a more recent bug, perhaps something introduced with the big webmail rewrite from last year?

Webmin: 1.900 Usermin: 1.751 Virtualmin: 6.06-2 Authentic theme: 19.31 (also tried 19.32-beta3)





Can you post the full raw From: line of one of these problematic emails here? I'd like to see exactly how it is formatted..

Sure. I added to my Virtualmin server, a user test2 with a real name of 'Jack Johnson', then sent a message from the account to itself. Here's the headers right from the maildir file:

From: "Jack Johnson" <>
Subject: Hello, hello, hello JJ!
Date: Wed, 03 Apr 2019 14:03:17 -0500 (CDT)
(snip headers, multipart/mime)

This is a test message.

Then if I do a (has the words) search right from the message index (or create a filter and do a Show Matching) for Jack, John, Johnson, hello, or JJ, I see the test message. A search for test, testing (message body), test2,, or (from) comes up empty, a little popup that shows "No messages matched your search" or a NO MAIL when doing a Show Matching from the filter editor.

The From: header looks fine to me, formatted as I'd expect, email in brackets and name quoted.



This problem still persists. The search does not find when searching by email address like Using latest version from Debian 10 repo. Webmin 1.932, Virtualmin 6.08, Usermin 1.780. We are using this to search through support emails and not being able to search through by email address is a bit of a bummer.

That's really odd, as I personally use this feature all the time.

Is this only an issue when testing a mail filter?

Hey Jamie, listen, there is a bug and I am very willing to help to get this sorted. I can get you a temp login for our server so you can inspect the headers and see for yourself. Email me with your public gpg key for login details.