unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* search for date received possible?
@ 2011-10-23 14:53 Gregor Zattler
  2011-10-23 16:47 ` Ivy Foster
  0 siblings, 1 reply; 8+ messages in thread
From: Gregor Zattler @ 2011-10-23 14:53 UTC (permalink / raw)
  To: notmuch

Hi notmuch users, notmuch developers,

is it possible to limit searches to date received ranges instead
of date (sent) ranges?

Rationale:
- In order to read current emails I want to search for messages
  received (for instance) within the last hour. [Is there another
  way to read last incoming emails?]

- For "real" searches: I usually know when I got a specific email
  I'm searching for but not necessarily if the clock was adjusted
  on the sending computer.



Thanx a bundle, Gregor
-- 
 -... --- .-. . -.. ..--.. ...-.-

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: search for date received possible?
  2011-10-23 14:53 search for date received possible? Gregor Zattler
@ 2011-10-23 16:47 ` Ivy Foster
  2011-10-23 21:42   ` Gregor Zattler
  0 siblings, 1 reply; 8+ messages in thread
From: Ivy Foster @ 2011-10-23 16:47 UTC (permalink / raw)
  To: Gregor Zattler, notmuch

[-- Attachment #1: Type: text/plain, Size: 528 bytes --]

On Sun, 23 Oct 2011 16:53:29 +0200, Gregor Zattler <telegraph@gmx.net> wrote:
> Hi notmuch users, notmuch developers,

Howdy,

> is it possible to limit searches to date received ranges
> instead of date (sent) ranges?

If your mail is delivered by procmail, I know you can insert
arbitrary headers as part of the mail-processing stage,
generally using formail. Such a recipe could look something
like this:

      NOW=$(date)
      :0 fhw
      | /usr/bin/formail -a "X-Date-Received: " $NOW

Hope that works out for you.

Ivy

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: search for date received possible?
  2011-10-23 16:47 ` Ivy Foster
@ 2011-10-23 21:42   ` Gregor Zattler
  2011-10-23 22:33     ` Ivy Foster
  2011-10-24 11:53     ` Daniel Schoepe
  0 siblings, 2 replies; 8+ messages in thread
From: Gregor Zattler @ 2011-10-23 21:42 UTC (permalink / raw)
  To: Ivy Foster, Gregor Zattler, notmuch

Hi Ivy,
On Sun, 23 Oct 2011 12:47:41 -0400, Ivy Foster <joyfulgirl@archlinux.us> wrote:
> On Sun, 23 Oct 2011 16:53:29 +0200, Gregor Zattler <telegraph@gmx.net> wrote:
> > is it possible to limit searches to date received ranges
> > instead of date (sent) ranges?
> 
> If your mail is delivered by procmail, I know you can insert
> arbitrary headers as part of the mail-processing stage,
> generally using formail. Such a recipe could look something
> like this:
> 
>       NOW=$(date)
>       :0 fhw
>       | /usr/bin/formail -a "X-Date-Received: " $NOW

Obviously I miss something here?  There are already Received:-Headers in
emails which contain the date when the mail was received.  How do I
search on arbitrary headers?  This is especially difficult since date
specifications are so complex.

Ciao; gregor

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: search for date received possible?
  2011-10-23 21:42   ` Gregor Zattler
@ 2011-10-23 22:33     ` Ivy Foster
  2011-10-24 11:53     ` Daniel Schoepe
  1 sibling, 0 replies; 8+ messages in thread
From: Ivy Foster @ 2011-10-23 22:33 UTC (permalink / raw)
  To: Gregor Zattler, Gregor Zattler, notmuch

[-- Attachment #1: Type: text/plain, Size: 1170 bytes --]

On Sun, 23 Oct 2011 23:42:54 +0200, Gregor Zattler <telegraph@gmx.net> wrote:
> On Sun, 23 Oct 2011 12:47:41 -0400, Ivy Foster <joyfulgirl@archlinux.us> wrote:
> > On Sun, 23 Oct 2011 16:53:29 +0200, Gregor Zattler <telegraph@gmx.net> wrote:
> > > is it possible to limit searches to date received
> > > ranges instead of date (sent) ranges?

> > If your mail is delivered by procmail, I know you can
> > insert arbitrary headers as part of the mail-processing
> > stage, generally using formail.

> There are already Received:-Headers in emails which
> contain the date when the mail was received. 

True; I just figured a unique one would be easier to search
for, since (at least in mail I receive) there are generally
several "Received:" headers.

> How do I search on arbitrary headers? This is especially
> difficult since date specifications are so complex.

You should be able to search for any free-form text just by
leaving out the "from:", "to:", etc., prefix. To be honest,
however, I'm new to notmuch myself and still learning my way
around.

iff

-- 
For every action, there is an equal and opposite criticism.
    -- Harrison

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: search for date received possible?
  2011-10-23 21:42   ` Gregor Zattler
  2011-10-23 22:33     ` Ivy Foster
@ 2011-10-24 11:53     ` Daniel Schoepe
  2011-10-25 17:31       ` how do you do everyday mail catchup with notmuch? (was: Re: search for date received possible?) Gregor Zattler
  1 sibling, 1 reply; 8+ messages in thread
From: Daniel Schoepe @ 2011-10-24 11:53 UTC (permalink / raw)
  To: Gregor Zattler, Ivy Foster, Gregor Zattler, notmuch

[-- Attachment #1: Type: text/plain, Size: 582 bytes --]

On Sun, 23 Oct 2011 23:42:54 +0200, Gregor Zattler <telegraph@gmx.net> wrote:
> Obviously I miss something here?  There are already Received:-Headers in
> emails which contain the date when the mail was received.  How do I
> search on arbitrary headers?  This is especially difficult since date
> specifications are so complex.

Unfortunately, notmuch doesn't index all headers at the moment (only
From, To, Cc, etc.), so I don't think this is currently possible. It has
been on the TODO list[1] for a long time though.

[1] http://notmuchmail.org/feature-requests/

Cheers,
Daniel

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* how do you do everyday mail catchup with notmuch? (was: Re: search for date received possible?)
  2011-10-24 11:53     ` Daniel Schoepe
@ 2011-10-25 17:31       ` Gregor Zattler
  2011-10-25 18:29         ` Thomas Jost
  2011-10-25 18:51         ` Daniel Schoepe
  0 siblings, 2 replies; 8+ messages in thread
From: Gregor Zattler @ 2011-10-25 17:31 UTC (permalink / raw)
  To: notmuch

Hi Daniel, notmuch users and developers,
* Daniel Schoepe <daniel@schoepe.org> [24. Oct. 2011]:
> On Sun, 23 Oct 2011 23:42:54 +0200, Gregor Zattler <telegraph@gmx.net> wrote:
> Unfortunately, notmuch doesn't index all headers at the moment (only
> From, To, Cc, etc.), so I don't think this is currently possible. It has
> been on the TODO list[1] for a long time though.
> 
> [1] http://notmuchmail.org/feature-requests/

Thank you for patiently answering my FAQ.

I asked for this feature because in my understanding of mail
handling with notmuch it is essential for the everyday task of
catching up with latest emails.  I especially run notmuch via
cron every minute in order to have up-to-date database and not
miss emails which just arrived.

With a convectional email setup, emails are filtered in
one/several folders and one looks in these folders for new emails
which weren't there last time.  (Especially outlook) users get
fooled if important emails have for one reason or another a wrong
date and are therefore not sorted at the end/beginning of their
emails so they are missed.  Best way to not miss newly arrived
email for me is to sort them chronologically according to time of
arrival.

Is there another solution to this email handling problem which
works with notmuch (and of which I'm not aware ATM)?

How do you make sure you don't miss emails while using notmuch?

I appreciate your any input.  Have a nice day, Gregor

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: how do you do everyday mail catchup with notmuch? (was: Re: search for date received possible?)
  2011-10-25 17:31       ` how do you do everyday mail catchup with notmuch? (was: Re: search for date received possible?) Gregor Zattler
@ 2011-10-25 18:29         ` Thomas Jost
  2011-10-25 18:51         ` Daniel Schoepe
  1 sibling, 0 replies; 8+ messages in thread
From: Thomas Jost @ 2011-10-25 18:29 UTC (permalink / raw)
  To: Gregor Zattler, notmuch

[-- Attachment #1: Type: text/plain, Size: 3108 bytes --]

On Tue, 25 Oct 2011 19:31:01 +0200, Gregor Zattler <telegraph@gmx.net> wrote:
> With a convectional email setup, emails are filtered in
> one/several folders and one looks in these folders for new emails
> which weren't there last time.  (Especially outlook) users get
> fooled if important emails have for one reason or another a wrong
> date and are therefore not sorted at the end/beginning of their
> emails so they are missed.  Best way to not miss newly arrived
> email for me is to sort them chronologically according to time of
> arrival.
> 
> Is there another solution to this email handling problem which
> works with notmuch (and of which I'm not aware ATM)?
> 
> How do you make sure you don't miss emails while using notmuch?

Here's my setup:

- on my server, mails are sorted with Dovecot sieve module. They are put
  in several folders so that I have something usable when I use my
  webmail (RoundCube) or my phone (with IMAP access).

- on my PC, I run a script every few minutes which does the following:
  - run offlineimap to sync mails between the remote IMAP server and my
    local Maildir
  - run "notmuch new", configured to add the tags "inbox" and "new" to
    the new  messages
  - run an autotag script inspired by [1] but *much* more complex and
    longer... I wrote it in Python, which is faster than running notmuch
    several dozens of times. It only filters mails with the "new" tag,
    and removes this tag after that, so that they are only sorted once.
  - after new mails are tagged, run a "notify" script that displays a
    notification with a list of unread messages (using libnotify, so
    nicely integrated to the desktop).
  - once per day, run "notmuch dump" to a backup dir.

- I then read mails in Emacs, with several saved searches: "tag:unread",
  "tag:inbox", "tag:flagged", "tag:todo", etc. Mails are sorted
  chronologically (oldest first). Using notmuch-search-line-faces, they
  are also displayed in several colors: unread with a specific
  background, "flagged" with another, "tag:todo" with yet another, etc.,
  so that you can spot important messages instantly.

- When I have read a message, I archive it by removing both the "unread"
  and "inbox" tags (I bound that to a single key in notmuch-search and
  notmuch-show). And of course I try to keep the numbers of mails in my
  "inbox" as low as possible :)

The combination of the "inbox", "unread", "flagged" and "todo" tags and
faces works quite well for me. I've been using this setup for several
months without any problem.

You can find my whole mailsync and notify scripts on Github [2], as well
as my Emacs config [3]. However I keep my autotag script private because
there are many email addresses in plaintext there, but if you want I can
send you a copy off-list (or a stripped-down version on the list).

Regards,

[1]: http://notmuchmail.org/initial_tagging/
[2]: https://github.com/Schnouki/dotfiles/tree/master/notmuch
[3]: https://github.com/Schnouki/dotfiles/blob/master/emacs/init-50-mail.el
-- 
Thomas/Schnouki

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: how do you do everyday mail catchup with notmuch? (was: Re: search for date received possible?)
  2011-10-25 17:31       ` how do you do everyday mail catchup with notmuch? (was: Re: search for date received possible?) Gregor Zattler
  2011-10-25 18:29         ` Thomas Jost
@ 2011-10-25 18:51         ` Daniel Schoepe
  1 sibling, 0 replies; 8+ messages in thread
From: Daniel Schoepe @ 2011-10-25 18:51 UTC (permalink / raw)
  To: Gregor Zattler, notmuch

[-- Attachment #1: Type: text/plain, Size: 1683 bytes --]

On Tue, 25 Oct 2011 19:31:01 +0200, Gregor Zattler <telegraph@gmx.net> wrote:
> How do you make sure you don't miss emails while using notmuch?

My setup is similar to Thomas Jost's setup described in his reply to
this, except for a few points:

- I am subscribed to many mailing lists, but read few of them
  regularly/daily, so I automatically remove the inbox tag from them in
  my tagging script and add a tag for the list it's been sent to.

- I have a keybinding to add a "killed" tag to a thread in a search
  buffer. My sorting script automatically adds a killed tag to any
  message in a thread that's been killed. (This is inspired by Ben
  Gamari's setup[1]).

- I have a few keybindings to display all messages or unread messages
  with a given tag. These keybindings automatically add a "and not
  tag:killed" to the query in order to use my previous mechanism.

- My sorting script also adds a special tag to threads I have replied to
  and all subsequent messages in that thread. Unread messages having
  that tag are displayed more prominently via a saved search, so that I
  don't miss messages in threads that I participated in (and am
  presumably more interested in than other threads).

- Mail that isn't from a mailing list ends up in my inbox and I
  explicitly archive/retag that after reading it.

That way I don't get to see every thread on every mailing list that I
subscribed to, unless I specifically ask to see that list, but I find
this more comfortable than having to decide for each new thread whether
I will want to read that or not.

[1] http://notmuchmail.org/pipermail/notmuch/2011/003976.html /
    id:"87tyfu3k5a.fsf@gmail.com"

Cheers,
Daniel

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-10-25 18:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-23 14:53 search for date received possible? Gregor Zattler
2011-10-23 16:47 ` Ivy Foster
2011-10-23 21:42   ` Gregor Zattler
2011-10-23 22:33     ` Ivy Foster
2011-10-24 11:53     ` Daniel Schoepe
2011-10-25 17:31       ` how do you do everyday mail catchup with notmuch? (was: Re: search for date received possible?) Gregor Zattler
2011-10-25 18:29         ` Thomas Jost
2011-10-25 18:51         ` Daniel Schoepe

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).