Re: [PATCH] Have --format=mbox insert Status:
On Sun, 06 Feb 2011, Peter John Hartman wrote: Hi Peter, would this output be compatible with all mbox consumers or only with those who expect the Status: line? If the latter, we would probably want a command line option to enable this. Hi, As far as I've been able to tell everyone respects RO in mbox, so I don't see this as a problem. In any case, having the Status: line there won't cause problems if an MUA doesn't recognize it. That said, it would be nice to think of a place to allow the user to easily map notmuch tags to Status: or X-Status: rules, perhaps in the notmuch config file as follows: [mbox] synchronize_flags=true I would call this differently - perhaps 'export_flags'. In maildir section of config file synchronize_flags has the meaning of bi-directional synchronization and this is only uni-directional. xstatus_A=replied xstatus_F=flagged xstatus_T=draft #xstatus_D=deleted status_R=-unread status_O=unread Is it necessary for this to be configurable? Given the list bellow, it seems it is already defined by the standard, so users would rarely want different mapping. Reference: http://wiki.dovecot.org/MailboxFormat/mbox: Status: R (\Seen) and O (non-\Recent) flags X-Status: A (\Answered), F (\Flagged), T (\Draft) and D (\Deleted) flags (I know that alpine/pine and mutt recognize at least RO, and probably AFTD.) -Michal ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
Re: [PATCH] Have --format=mbox insert Status:
On Mon, Feb 07, 2011 at 10:04:41AM +0100, Michal Sojka wrote: [mbox] synchronize_flags=true I would call this differently - perhaps 'export_flags'. In maildir section of config file synchronize_flags has the meaning of bi-directional synchronization and this is only uni-directional. I agree. xstatus_A=replied xstatus_F=flagged xstatus_T=draft #xstatus_D=deleted status_R=-unread status_O=unread Is it necessary for this to be configurable? Given the list bellow, it seems it is already defined by the standard, so users would rarely want different mapping. I agree. In fact, I would think we don't need to add anything to the notmuch config file at all. I can't think of a use case where we'd want show --format=mbox to *not* also replicate/export the Status/X-Status tags. I personally don't use X-Status: but I don't have a problem with my patch being patched to include them. It won't cause any problems. Peter -- sic dicit magister P PhD Candidate Collaborative Programme in Ancient and Medieval Philosophy University of Toronto http://individual.utoronto.ca/peterjh ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
Re: [PATCH] Have --format=mbox insert Status:
Hi Peter, would this output be compatible with all mbox consumers or only with those who expect the Status: line? If the latter, we would probably want a command line option to enable this. Hi, As far as I've been able to tell everyone respects RO in mbox, so I don't see this as a problem. In any case, having the Status: line there won't cause problems if an MUA doesn't recognize it. That said, it would be nice to think of a place to allow the user to easily map notmuch tags to Status: or X-Status: rules, perhaps in the notmuch config file as follows: [mbox] synchronize_flags=true xstatus_A=replied xstatus_F=flagged xstatus_T=draft #xstatus_D=deleted status_R=-unread status_O=unread Reference: http://wiki.dovecot.org/MailboxFormat/mbox: Status: R (\Seen) and O (non-\Recent) flags X-Status: A (\Answered), F (\Flagged), T (\Draft) and D (\Deleted) flags (I know that alpine/pine and mutt recognize at least RO, and probably AFTD.) Peter -- sic dicit magister P PhD Candidate Collaborative Programme in Ancient and Medieval Philosophy University of Toronto http://individual.utoronto.ca/peterjh ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
Re: [PATCH] Have --format=mbox insert Status:
On Wed, 02 Feb 2011, Peter John Hartman wrote: Hi folks, This is not a complete patch, but should give you an idea. (It works well enough for me, but I think it could do more). diff --git a/notmuch-show.c b/notmuch-show.c index ef421ec..dff66de 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -272,6 +272,12 @@ format_message_mbox (const void *ctx, printf (From %s %s, from, date_asctime); +if (strstr(_get_tags_as_string(ctx,message),unread) != NULL) { + printf (Status: O\n); +} else { + printf (Status: RO\n); +} + Hi Peter, would this output be compatible with all mbox consumers or only with those who expect the Status: line? If the latter, we would probably want a command line option to enable this. For instance, I combine notmuch with mutt as follows: notmuch show --format=mbox $(notmuch search thread:xxx | cut -d' ' -f1) tmp.mbox mutt -f tmp.mbox rm -f tmp.mbox Interesting :) -Michal ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch