[notmuch] notmuch and imap [musing, no code :)]

2009-12-15 Thread Alec Berryman
David Bremner on 2009-12-15 08:05:13 -0400:

> Recent discussions on IRC (I forget with whom, sorry), brought me back
> to thinking about syncing notmuch with imap.  In addition to the flags
> \Seen, \Answered, \Draft, \Deleted, and \Flagged, imap servers can
> optionally support user defined keywords (i.e. tags). At least courier
> and dovecot do.  These keywords are imap "atoms", which, without tracing
> though the BNF [1] completely look like they can can have (ascii)
> alphanumeric, and punctuation other than brackets, quotes and "%", "*".

I am also very interested in syncing tags between computers.  I started
implementing storage of tags in message headers.  It's has been done
before - several mutt extensions and systems use X-Label.  This approach
offers several advantages to notmuch dump/restore and IMAP flags:

  - compatability: most mail clients can search on headers, so even if
you're not using notmuch full-time (squirrelmail? phone?), you can
get some benefit from it

  - works with offlineimap without further effort: no new transport
mechanism required

  - a migration path: text-based mail sorting tools like procmail can
easily set headers

  - backups are easy: you can't miss backing up your tags because
they're in the messages

There are security concerns (need to strip incoming messages of tags so
no one tags your mail for you), privacy concerns (if you forward the
entire message as an attachment, may want to strip tags), and space
concerns (how many flags?), but I think they can be worked around.

I haven't gotten very far with my implementation due to time
constraints.  It reads tags fine, but I haven't implemented writing,
which is the involved part.  I hope to get to this between Christmas and
New Years, but who knows.



[notmuch] [PATCH] Send mail to notmuch list, not Carl

2009-11-28 Thread Alec Berryman
---
 configure |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index b4770ec..e55f067 100755
--- a/configure
+++ b/configure
@@ -10,8 +10,8 @@ more efficiently than ever.
 If anything goes wrong in this process, please do as much as you can
 to figure out what could be different on your machine compared to
 those of the notmuch developers. Then, please email those details to
-Carl Worth  so that we can hopefully make future
-versions of notmuch easier for you to use.
+the Notmuch list (notmuch at notmuchmail.org) so that we can hopefully make
+future versions of notmuch easier for you to use.

 We'll now investigate your system to find verify that various software
 components that notmuch relies on are available.
-- 
1.6.5




[notmuch] [patch] Trivial fix for non-root install

2009-11-23 Thread Alec Berryman
Brett Viren on 2009-11-23 10:31:47 -0500:

> Installing as a normal user fails because the bash completion config
> files try to install into /etc.  This trivial patch fixes this.

I worked around this by using $DESTDIR as the prefix and unsetting
prefix during the install.



[notmuch] [PATCH] Support multiple configuration files via $NOTMUCH_CONFIG

2009-11-21 Thread Alec Berryman
If present, $NOTMUCH_CONFIG will be used as the configuration file
location.
---
 notmuch-config.c |   16 +++-
 notmuch-setup.c  |3 ++-
 notmuch.1|7 ---
 notmuch.c|3 ++-
 4 files changed, 19 insertions(+), 10 deletions(-)

I'd like to have multiple configurations for personal and work email;
this solution worked for me.

I've been having trouble with git send-email and this list; sorry if
this comes a few times.

diff --git a/notmuch-config.c b/notmuch-config.c
index aaa0372..fc65d6b 100644
--- a/notmuch-config.c
+++ b/notmuch-config.c
@@ -132,9 +132,10 @@ get_username_from_passwd_file (void *ctx)
 return name;
 }

-/* Open the named notmuch configuration file. A filename of NULL will
- * be interpreted as the default configuration file
- * ($HOME/.notmuch-config).
+/* Open the named notmuch configuration file. If the filename is NULL,
+ * the value of the environment variable $NOTMUCH_CONFIG will be used.
+ * If $NOTMUCH_CONFIG is unset, the default configuration file
+ * ($HOME/.notmuch-config) will be used.
  *
  * If any error occurs, (out of memory, or a permission-denied error,
  * etc.), this function will print a message to stderr and return
@@ -168,6 +169,7 @@ notmuch_config_open (void *ctx,
 {
 GError *error = NULL;
 int is_new = 0;
+char *notmuch_config_env = NULL;

 if (is_new_ret)
*is_new_ret = 0;
@@ -180,11 +182,15 @@ notmuch_config_open (void *ctx,

 talloc_set_destructor (config, notmuch_config_destructor);

-if (filename)
+if (filename) {
config->filename = talloc_strdup (config, filename);
-else
+} else if ((notmuch_config_env = getenv ("NOTMUCH_CONFIG"))) {
+   config->filename = talloc_strdup (config, notmuch_config_env);
+   notmuch_config_env = NULL;
+} else {
config->filename = talloc_asprintf (config, "%s/.notmuch-config",
getenv ("HOME"));
+}

 config->key_file = g_key_file_new ();

diff --git a/notmuch-setup.c b/notmuch-setup.c
index 482efd2..d06fbf8 100644
--- a/notmuch-setup.c
+++ b/notmuch-setup.c
@@ -76,7 +76,8 @@ welcome_message_post_setup (void)
 "Notmuch is now configured, and the configuration settings are saved in\n"
 "a file in your home directory named .notmuch-config . If you'd like to\n"
 "change the configuration in the future, you can either edit that file\n"
-"directly or run \"notmuch setup\".\n\n"
+"directly or run \"notmuch setup\".  To choose an alternate configuration\n"
+"location, set ${NOTMUCH_CONFIG}.\n\n"

 "The next step is to run \"notmuch new\" which will create a database\n"
 "that indexes all of your mail. Depending on the amount of mail you have\n"
diff --git a/notmuch.1 b/notmuch.1
index 8a3fb40..eeb1a94 100644
--- a/notmuch.1
+++ b/notmuch.1
@@ -53,9 +53,10 @@ Interactively sets up notmuch for first use.
 The setup command will prompt for your full name, your primary email
 address, any alternate email addresses you use, and the directory
 containing your email archives. Your answers will be written to a
-configuration file in ${HOME}/.notmuch-config . This configuration
-file will be created with descriptive comments, making it easy to edit
-by hand later to change the configuration. Or you can run
+configuration file in ${NOTMUCH_CONFIG} (if set) or
+${HOME}/.notmuch-config . This configuration file will be created with
+descriptive comments, making it easy to edit by hand later to change the
+configuration. Or you can run
 .B "notmuch setup"
 again to change the configuration.

diff --git a/notmuch.c b/notmuch.c
index 5cc8e4c..d7ea5aa 100644
--- a/notmuch.c
+++ b/notmuch.c
@@ -98,7 +98,8 @@ command_t commands[] = {
   "\t\tThe setup command will prompt for your full name, your primary\n"
   "\t\temail address, any alternate email addresses you use, and the\n"
   "\t\tdirectory containing your email archives. Your answers will be\n"
-  "\t\twritten to a configuration file in ${HOME}/.notmuch-config .\n"
+  "\t\twritten to a configuration file in ${NOTMUCH_CONFIG} (if set)\n"
+  "\t\tor ${HOME}/.notmuch-config.\n"
   "\n"
   "\t\tThis configuration file will be created with descriptive\n"
   "\t\tcomments, making it easy to edit by hand later to change the\n"
-- 
1.6.5