[slighly offtopic] use notmuch as the sole msg store?
by Douglas Campos
Howdy! Happy mutt-kz user here.
I'm wondering whether any of you thought on going further and using
notmuch/xapian as the sole store for mail. Why am I asking this?
Mutt does a bazillion file operations which is insanely slow under OSX;
I'm wondering whether could we plug libetpan and feed mail directly to
the database, sync the changes back. This would mean we would have all
the mutt-kz awesomeness without having to muck with mbsync/offlineimap
and having to use double storage space (Maildir + notmuch db).
I'm not asking for anyone to do it, more interested in hearing if this
is crazy talk and I'm insane of wanting this :)
Thoughts?
--
qmx
9 years, 6 months
[PATCH] Virtual folder path might be longer than _POSIX_PATH_MAX.
by Ondrej Balaz
Since the path member of BUFFY struct is used to store notmuch queries it
should be able to hold more than _POSIX_PATH_MAX characters.
This patch changes it to dynamically allocated buffer and in case of virtual
folder copies whole path token, not only first _POSIX_PATH_MAX characters.
Signed-off-by: Ondrej Balaz <blami(a)blami.net>
---
buffy.c | 24 ++++++++++++++----------
buffy.h | 2 +-
2 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/buffy.c b/buffy.c
index 91bc480..7ef984f 100644
--- a/buffy.c
+++ b/buffy.c
@@ -203,7 +203,7 @@ static BUFFY *buffy_new (const char *path)
BUFFY* buffy;
buffy = (BUFFY *) safe_calloc (1, sizeof (BUFFY));
- strfcpy (buffy->path, path, sizeof (buffy->path));
+ buffy->path = safe_strdup(path);
buffy->next = NULL;
buffy->magic = 0;
@@ -212,8 +212,10 @@ static BUFFY *buffy_new (const char *path)
static void buffy_free (BUFFY **mailbox)
{
- if (mailbox && *mailbox)
+ if (mailbox && *mailbox) {
+ FREE (&(*mailbox)->path);
FREE (&(*mailbox)->desc);
+ }
FREE (mailbox); /* __FREE_CHECKED__ */
}
@@ -296,7 +298,7 @@ int mutt_parse_mailboxes (BUFFER *path, BUFFER *s, unsigned long data, BUFFER *e
int mutt_parse_virtual_mailboxes (BUFFER *path, BUFFER *s, unsigned long data, BUFFER *err)
{
BUFFY **tmp;
- char buf[_POSIX_PATH_MAX];
+ char *buf; /* notmuch query might be longer than _POSIX_PATH_MAX */
while (MoreArgs (s))
{
@@ -309,12 +311,12 @@ int mutt_parse_virtual_mailboxes (BUFFER *path, BUFFER *s, unsigned long data, B
continue;
mutt_extract_token (path, s, 0);
- strfcpy (buf, path->data, sizeof (buf));
-
- /* Skip empty tokens. */
- if(!*buf) {
- FREE(&desc);
- continue;
+ if (path->data && *path->data) {
+ buf = safe_strdup(path->data);
+ } else {
+ /* skip empty tokens */
+ FREE(&desc);
+ continue;
}
/* avoid duplicates */
@@ -322,7 +324,7 @@ int mutt_parse_virtual_mailboxes (BUFFER *path, BUFFER *s, unsigned long data, B
{
if (mutt_strcmp (buf, (*tmp)->path) == 0)
{
- dprint(3,(debugfile,"vistual mailbox '%s' already registered as '%s'\n", buf, (*tmp)->path));
+ dprint(3,(debugfile,"virtual mailbox '%s' already registered as '%s'\n", buf, (*tmp)->path));
break;
}
}
@@ -335,6 +337,8 @@ int mutt_parse_virtual_mailboxes (BUFFER *path, BUFFER *s, unsigned long data, B
(*tmp)->newly_created = 0;
(*tmp)->size = 0;
(*tmp)->desc = desc;
+
+ FREE(&buf);
}
return 0;
}
diff --git a/buffy.h b/buffy.h
index 5cbc06f..10508a5 100644
--- a/buffy.h
+++ b/buffy.h
@@ -22,7 +22,7 @@
typedef struct buffy_t
{
- char path[_POSIX_PATH_MAX];
+ char *path;
char *desc;
off_t size;
struct buffy_t *next;
--
2.0.0.rc2
9 years, 6 months
Display notmuch tags in index view
by Cédric Macquat
Hello,
I want to display the notmuch tags in the index view. To display them I
saw I can use "%g" in the variable index_format. I have the following in
my .muttrc:
set index_format="%4C %Z %{%b %d} %-15.15L (%<l?%4l&%4c>) %s %> (%g)"
Did I understand right: the notmuch tags are only displayed in virtual
folders. If I use regular folders, the notmuch tags are not displayed.
And if it's not right: how can I display notmuch tags for messages in
regular folders in the index view ?
Thank you!
Cédric
9 years, 6 months
Search in multiple mailboxes
by Cédric Macquat
Hello,
I'm testing mutt-kz because it has notmuch support, but something is not
clear for me. Because it has notmuch support, I think it's possible to
search from mutt in multiple mailboxes. Like the features provided from
notmuch-mutt. But I can't find how. Did I miss something or it's not
possible ?
Thank you!
Cedric
9 years, 7 months