From: Sebastian Fischmeister Date: Sun, 21 Dec 2014 15:54:22 +0000 (+1900) Subject: Re: email snoozing in notmuch X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6e6232f643a5cab85130f5f4715a848caa1bd023;p=notmuch-archives.git Re: email snoozing in notmuch --- diff --git a/99/9bf0499d3aa64d744aa43bb923c1fba594a4b2 b/99/9bf0499d3aa64d744aa43bb923c1fba594a4b2 new file mode 100644 index 000000000..3b5426107 --- /dev/null +++ b/99/9bf0499d3aa64d744aa43bb923c1fba594a4b2 @@ -0,0 +1,129 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id D310F431FAF + for ; Sun, 21 Dec 2014 07:54:30 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -1.686 +X-Spam-Level: +X-Spam-Status: No, score=-1.686 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_SORBS_WEB=0.614] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 3ICsR9Hbcqq1 for ; + Sun, 21 Dec 2014 07:54:27 -0800 (PST) +Received: from connect.uwaterloo.ca (connhub2.connect.uwaterloo.ca + [129.97.149.119]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 4EB14431FAE + for ; Sun, 21 Dec 2014 07:54:27 -0800 (PST) +Received: from CONNHUB3.connect.uwaterloo.ca (129.97.149.121) by + connhub2.connect.uwaterloo.ca (129.97.149.119) with Microsoft SMTP + Server (TLS) id 14.3.195.1; Sun, 21 Dec 2014 10:54:24 -0500 +Received: from uwaterloo.ca (213.162.68.60) by connhub3.connect.uwaterloo.ca + (129.97.149.121) with Microsoft SMTP Server (TLS) id 14.3.195.1; + Sun, 21 Dec 2014 10:54:22 -0500 +From: Sebastian Fischmeister +To: Richard Lawrence , + +Subject: Re: email snoozing in notmuch +In-Reply-To: <87bnnbmoda.fsf@berkeley.edu> +References: <87wq60e2q5.fsf@uwaterloo.ca> + <548800d5ecc8b_551ca3e88c@TP_L520.notmuch> + <87bnnbmoda.fsf@berkeley.edu> +User-Agent: Notmuch/0.19 (http://notmuchmail.org) Emacs/24.4.1 + (x86_64-unknown-linux-gnu) +X-Homepage: http://esg.uwaterloo.ca +Date: Sun, 21 Dec 2014 10:54:22 -0500 +Message-ID: <87h9wpngsi.fsf@uwaterloo.ca> +MIME-Version: 1.0 +Content-Type: text/plain +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +Reply-To: sfischme@uwaterloo.ca +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sun, 21 Dec 2014 15:54:31 -0000 + +Hi Richard, + +Thanks for the nice and simple solution. I prefer this one to a solution +like notmuch-snooze that stores the desnoozing in an external program +and thus complicates backups. + + Sebastian + +Richard Lawrence writes: + +> Franz Fellner +> writes: +> +>> Sebastian Fischmeister wrote: +> +>>> I'm thinking of how to realize the mail snoozing feature with notmuch, +>>> so that certain emails won't become visible (in the search) until a +>>> certain day/time (e.g., 10 days from now). +>>> +>>> Using the tag as an absolute date when the mail should become visible +>>> again, tags should be searchable and interpretable as dates. The search +>>> would then be something like: notmuch search tag-as-date < now and +>>> tag:inbox +>> +>> It is not neccessary to make notmuch interpret tags as date - just interpret them yourself ;) +>> You can easily run your own scripts and modify tags/mails. So a simple solution might be: +>> * Add "snoozed" to your notmuch exclude_tags (see config file) +>> * To snooze a mail run in your mail client "tag +snoozed +snoozeby-10-days" +>> or "tag +snoozed +snoozeuntil-2015-01-09" +>> * Your script (e.g. run as cronjob or after notmuch new) now +>> - queries for "tag:snoozed" +>> - looks for snoozeuntil-* tag and parses the tag into a date. If date < now remove snooze-tags. +>> - looks for (relative) snoozeby tag and transform it into (absolute) snoozeuntil tag. +>> (should be not too hard using e.g. the python or ruby bindings) +> +> I actually do something like this. It's not everything Sebastian was +> looking for, but it's very simple, and works great for me. +> +> I use a combination of a "pending" tag and a "byYYYYMMDD" tag. +> +> From cron, I run the following to refile pending mail back to the inbox +> when it comes due: +> +> #!/bin/bash +> DATE_STR=$(date +'%Y%m%d') +> notmuch tag +inbox -pending -by$DATE_STR -- tag:by$DATE_STR +> +> and in Emacs, I use the following key binding to snooze mail (or in the Mutt +> terminology I borrowed, `postpone' it, hence the key): +> +> (define-key notmuch-search-mode-map "P" +> (lambda () +> "postpone message (remove inbox tag, add pending tag and refile date)" +> (interactive) +> (let* ((date-string (format-time-string "%Y%m%d" (org-read-date nil t))) +> (date-tag (concat "+by" date-string))) +> (notmuch-search-tag `("-inbox" "+pending" ,date-tag))))) +> +> (The `org-read-date' function gives me a nice easy way to pick a date +> from a calendar. I bind "P" to the same function in +> notmuch-show-mode-map, too.) +> +> Hope that helps! +> +> Best, +> Richard +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch