/* notmuch - Not much of an email program, (just index and search)
*
* Copyright © 2009 Carl Worth
+ * Copyright © 2009 Keith Packard
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/ .
*
- * Author: Carl Worth <cworth@cworth.org>
+ * Authors: Carl Worth <cworth@cworth.org>
+ * Keith Packard <keithp@keithp.com>
*/
#include "notmuch-client.h"
"\t\tthe Boolean operators, but will have to be protected from\n"
"\t\tinterpretation by the shell, (such as by putting quotation\n"
"\t\tmarks around any parenthesized expression)." },
+ { "reply", notmuch_reply_command,
+ "<search-terms> [...]\n\n"
+ "\t\tFormats a reply from a set of existing messages.",
+ "\t\tConstructs a new message as a reply to a set of existing\n"
+ "\t\tmessages. The From: address is used as a To: address\n"
+ "\t\talong with all old To: addresses. All of the Cc: addresses\n"
+ "\t\tare copied as new Cc: addresses. An In-Reply-To: header\n"
+ "\t\twill be constructed from the name and date of the original\n"
+ "\t\tmessage, and the original Message-ID will be added to the\n"
+ "\t\tlist of References in the new message. The text of each\n"
+ "\t\tmessage (as described in the \"show\" command) will be\n"
+ "\t\tpresented, each line prefixed with \"> \" The resulting\n"
+ "\t\tmessage will be dumped to stdout." },
{ "show", notmuch_show_command,
"<search-terms> [...]\n\n"
"\t\tShows all messages matching the search terms.",
argv[0]);
return 1;
}
-
+
+/* Handle the case of "notmuch" being invoked with no command
+ * argument. Print a welcome and explanatory message, then invoke
+ * notmuch_setup_command.
+ */
+static int
+notmuch (void *ctx)
+{
+ int ret;
+
+ printf (
+"Welcome to notmuch!\n\n"
+
+"The goal of notmuch is to help you manage and search your collection of\n"
+"email, and to efficiently keep up with the flow of email as it comes in.\n\n"
+
+"Notmuch needs to know a few things about you such as your name and email\n"
+"address, as well as the directory that contains your email. This is where\n"
+"you already have mail stored and where messages will be delivered in the\n"
+"future. This directory can contain any number of sub-directories. Regular\n"
+"files in these directories should be individual email messages. If there\n"
+"are other, non-email files (such as indexes maintained by other email\n"
+"programs) then notmuch will do its best to detect those and ignore them.\n\n"
+
+"If you already have your email being delivered to directories in either\n"
+"maildir or mh format, then that's perfect. Mail storage that uses mbox\n"
+"format, (where one mbox file contains many messages), will not work with\n"
+"notmuch. If that's how your mail is currently stored, we recommend you\n"
+"first convert it to maildir format with a utility such as mb2md. You can\n"
+"continue configuring notmuch now, but be sure to complete the conversion\n"
+"before you run \"notmuch new\" for the first time.\n\n");
+
+ ret = notmuch_setup_command (ctx, 0, NULL);
+
+ printf ("\n"
+"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"
+
+"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"
+"the initial indexing process can take a long time, so expect that.\n"
+"Also, the resulting database will require roughly the same amount of\n"
+"storage space as your current collection of email. So please ensure you\n"
+"have sufficient storage space available now.\n\n");
+
+ return ret;
+}
+
int
main (int argc, char *argv[])
{
- void *local = talloc_new (NULL);
+ void *local;
command_t *command;
unsigned int i;
+ local = talloc_new (NULL);
+
+ g_mime_init (0);
+
if (argc == 1)
- return notmuch_setup_command (local, 0, NULL);
+ return notmuch (local);
for (i = 0; i < ARRAY_SIZE (commands); i++) {
command = &commands[i];