Re: [PATCH] notmuch: Add Maildir directory name as

classic Classic list List threaded Threaded
1 message Options
Michiel Buddingh' Michiel Buddingh'
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] notmuch: Add Maildir directory name as

 =?UTF-8?Q?tag=09name=20for=20messages?=
MIME-Version: 1.0
Date: Sun, 22 Nov 2009 00:25:43 +0100
From: Michiel Buddingh' <[hidden email]>
Cc: Carl Worth <[hidden email]>, notmuch <[hidden email]>
In-Reply-To: <[hidden email]>
References: <[hidden email]> <[hidden email]> <[hidden email]> <[hidden email]>
Message-ID: <9cce5525b093b87fe74d427954ffad89@localhost>
X-Sender: [hidden email]
User-Agent: RoundCube Webmail/0.1
Content-Type: multipart/mixed;
        boundary="=_365db8948ca90006e4bd3511ef958271"


--=_365db8948ca90006e4bd3511ef958271
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=UTF-8

On Sat, 21 Nov 2009 17:12:07 -0500, Bart Trojanowski <[hidden email]>
wrote:

>> I realized that I actually don't want my mail tagged based on the
>> maildir directories I'm using, (they are arbitrarily-named directories
>> used only to keep the per-directory number of files below about 10
>> thousand).
>>
>> So we'll probably need to make this an opt-in feature from the
>> configuration file.
>
> I think notmuch needs something that will add tags based on the
> attributes of a message (headers or body), as it imports data from a
> maildir.
>
> I am currently considering having procmail deliver to date based
> (YYYY-MM) folders and have notmuch determine what tags they should get.

(hi, new here, just subscribed today.  Wanted to reply to Carl's
 earlier message I read in the archives, but since I don't have that,
 I'm replying to Bart's reply to that message)

Any attempt to match tags up to directories will eventually have
to deal with with the fact that tags can't be neatly mapped onto
them.  If I remove a directory-tag from a message, does this
mean the message is removed from that directory?  What if a
message has two directory-tags, does it mean it's present in both
directories?

At the same time, this kind of interoperability would be highly
desirable to those of us who access their mail using other  
clients (webmail, mobile phones, etc.) that expect hierarchical
ordering.

In the mean time, I've made a smaller, hopefully more harmless
patch to let 'notmuch new' mark messages stored in a Maildir 'cur'
folder as 'read' rather than 'unread'.

via webmail,
Michiel Buddingh'
--=_365db8948ca90006e4bd3511ef958271
Content-Transfer-Encoding: base64
Content-Type: application/octet-stream; charset=UTF-8;
 name=0001-Derive-read-status-from-Maildir-cur-folder.patch;
Content-Disposition: attachment;
 filename=0001-Derive-read-status-from-Maildir-cur-folder.patch;

RnJvbSA4YTJkZTEwNjk2YzBlOGVjYWI3ZmU1NDQxYjk5YTMzYTkwNGRiNzY5IE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBNaWNoaWVsIEJ1ZGRpbmdoIDxtaWNoaWVsQG1pY2hpZWxidWRk
aW5naC5uZXQ+CkRhdGU6IFN1biwgMjIgTm92IDIwMDkgMDA6MTQ6MTkgKzAxMDAKU3ViamVjdDog
W1BBVENIXSBEZXJpdmUgcmVhZCBzdGF0dXMgZnJvbSBNYWlsZGlyIGN1ciBmb2xkZXIKCi0tLQog
bm90bXVjaC1uZXcuYyB8ICAgNDIgKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrLS0tLS0t
LS0tLS0tCiAxIGZpbGVzIGNoYW5nZWQsIDMwIGluc2VydGlvbnMoKyksIDEyIGRlbGV0aW9ucygt
KQoKZGlmZiAtLWdpdCBhL25vdG11Y2gtbmV3LmMgYi9ub3RtdWNoLW5ldy5jCmluZGV4IGJjMzVi
NGUuLmEzNjY0NTMgMTAwNjQ0Ci0tLSBhL25vdG11Y2gtbmV3LmMKKysrIGIvbm90bXVjaC1uZXcu
YwpAQCAtMzksMTIgKzM5LDE3IEBAIGhhbmRsZV9zaWdpbnQgKHVudXNlZCAoaW50IHNpZykpCiB9
CiAKIHN0YXRpYyB2b2lkCi10YWdfaW5ib3hfYW5kX3VucmVhZCAobm90bXVjaF9tZXNzYWdlX3Qg
Km1lc3NhZ2UpCit0YWdfYXNfaW5ib3ggKG5vdG11Y2hfbWVzc2FnZV90ICptZXNzYWdlLCBjb25z
dCBpbnQgcmVhZCkKIHsKICAgICBub3RtdWNoX21lc3NhZ2VfYWRkX3RhZyAobWVzc2FnZSwgIml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