I'm looking for an E-Mail search command that will find an *exact* date.
I.e. I know the E-Mail I'm looking for has:-
Date: 19 Jan 2010 15:30:24
However none of the mail search programs I've tried seems to be able to handle this, they all want to search for mails in a date range, usually with no time at all specified.
I've only tried mairix and grepmail so far but it looks as if notmuch will have the same issues.
I know I could simply use grep but that doesn't "know about" E-Mails so although it can find the specific E-Mail it can't show me the E-Mail body which is what I'm after.
On Mon, Nov 29, 2021 at 10:52:00AM +0000, Chris Green wrote:
I know I could simply use grep but that doesn't "know about" E-Mails so although it can find the specific E-Mail it can't show me the E-Mail body which is what I'm after.
I'm guessing this is just an mbox file rather than something else? However I would just add the -A and -B options to grep to add however many lines you need before and after the date search to get the rest of the email and redirect it into a file. Any more tidying required to get just the bit you want can be done in a text editor.
Adam
On Mon, Nov 29, 2021 at 11:19:23AM +0000, Adam Bower wrote:
On Mon, Nov 29, 2021 at 10:52:00AM +0000, Chris Green wrote:
I know I could simply use grep but that doesn't "know about" E-Mails so although it can find the specific E-Mail it can't show me the E-Mail body which is what I'm after.
I'm guessing this is just an mbox file rather than something else? However I would just add the -A and -B options to grep to add however many lines you need before and after the date search to get the rest of the email and redirect it into a file. Any more tidying required to get just the bit you want can be done in a text editor.
The E-Mails I'm searching are actually in maildir directories, not that it makes much difference.
However a lot of them are mult-ipart so I need to be able to extract the text/plain part at least.
On Mon, Nov 29, 2021 at 11:49:18AM +0000, Chris Green wrote:
The E-Mails I'm searching are actually in maildir directories, not that it makes much difference.
However a lot of them are mult-ipart so I need to be able to extract the text/plain part at least.
In that case you should be able to find the individual files with grep -f? If not then I really don't understand the problem as it's not been explained with all the detail required to form a sensible answer.
Anyway, you can probably use something like mu to extract what you need.
Adam