* notmuch is e-email library for e-mail fulltext indexing and tagging; see
http://notmuchmail.org/ for more information.
+
* compile:
$ git clone git://github.com/karelzak/mutt-kz.git
$ ./configure --enable-notmuch
$ make
+
+ * virtual mailboxes
+
+ .muttrc:
+
+ synopsis:
+
+ virtual-mailboxes <desciption> <uri> [ ...]
+
+ example:
+
+ virtual-mailboxes "Linux Kernel" "notmuch:///whereis/db?query=tag:lkml&limit=1000" \
+ "Filesystems" "notmuch:///whereis/db?query=tag:fs" \
+ "Music" "notmuch:///another/db?query=tag:hard and tag:heavy"
static void buffy_free (BUFFY **mailbox)
{
+ if (mailbox && *mailbox)
+ FREE (&(*mailbox)->desc);
FREE (mailbox); /* __FREE_CHECKED__ */
}
return rc;
}
+#ifdef USE_NOTMUCH
+int mutt_parse_virtual_mailboxes (BUFFER *path, BUFFER *s, unsigned long data, BUFFER *err)
+{
+ BUFFY **tmp;
+ char buf[_POSIX_PATH_MAX];
+
+ while (MoreArgs (s))
+ {
+ mutt_extract_token (path, s, 0);
+ strfcpy (buf, path->data, sizeof (buf));
+
+ /* Skip empty tokens. */
+ if(!*buf) continue;
+
+ /* avoid duplicates */
+ for (tmp = &VirtIncoming; *tmp; tmp = &((*tmp)->next))
+ {
+ if (mutt_strcmp (buf, (*tmp)->path) == 0)
+ {
+ dprint(3,(debugfile,"vistual mailbox '%s' already registered as '%s'\n", buf, (*tmp)->path));
+ break;
+ }
+ }
+
+ if (!*tmp)
+ *tmp = buffy_new (buf);
+
+ mutt_extract_token (path, s, 0);
+ if (path->data && *path->data)
+ (*tmp)->desc = safe_strdup( path->data);
+
+ (*tmp)->new = 0;
+ (*tmp)->notified = 1;
+ (*tmp)->newly_created = 0;
+ (*tmp)->size = 0;
+ }
+ return 0;
+}
+#endif
+
/* returns 1 if maildir has new mail */
static int buffy_maildir_hasnew (BUFFY* mailbox)
{
#ifdef USE_SIDEBAR
char realpath[_POSIX_PATH_MAX];
#endif
+ char *desc;
off_t size;
struct buffy_t *next;
#ifdef USE_SIDEBAR
WHERE BUFFY *Incoming INITVAL (0);
WHERE short BuffyTimeout INITVAL (3);
+#ifdef USE_NOTMUCH
+WHERE BUFFY *VirtIncoming INITVAL (0);
+#endif
+
extern time_t BuffyDoneTime; /* last time we knew for sure how much mail there was */
BUFFY *mutt_find_mailbox (const char *path);
{ "macro", mutt_parse_macro, 0 },
{ "mailboxes", mutt_parse_mailboxes, M_MAILBOXES },
{ "unmailboxes", mutt_parse_mailboxes, M_UNMAILBOXES },
+#ifdef USE_NOTMUCH
+ { "virtual-mailboxes",mutt_parse_virtual_mailboxes, 0 },
+#endif
{ "message-hook", mutt_parse_hook, M_MESSAGEHOOK },
{ "mbox-hook", mutt_parse_hook, M_MBOXHOOK },
{ "mime_lookup", parse_list, UL &MimeLookupList },
void mutt_delete_parameter (const char *attribute, PARAMETER **p);
void mutt_set_parameter (const char *, const char *, PARAMETER **);
+#ifdef USE_NOTMUCH
+int mutt_parse_virtual_mailboxes (BUFFER *path, BUFFER *s, unsigned long data, BUFFER *err);
+#endif
FILE *mutt_open_read (const char *, pid_t *);