unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org
Subject: [PATCH] fixup! support splitting mail from database location.
Date: Thu,  7 Jan 2021 07:50:18 -0400	[thread overview]
Message-ID: <20210107115018.2115759-1-david@tethera.net> (raw)
In-Reply-To: <20210105022350.643917-3-david@tethera.net>

---
 notmuch-insert.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/notmuch-insert.c b/notmuch-insert.c
index e483b949..4ae65d4d 100644
--- a/notmuch-insert.c
+++ b/notmuch-insert.c
@@ -448,7 +448,7 @@ notmuch_insert_command (unused(notmuch_config_t *config),notmuch_database_t *not
 {
     notmuch_status_t status, close_status;
     struct sigaction action;
-    const char *db_path;
+    const char *db_path, *mail_root;
     notmuch_config_values_t *new_tags = NULL;
     tag_op_list_t *tag_ops;
     char *query_string = NULL;
@@ -489,6 +489,8 @@ notmuch_insert_command (unused(notmuch_config_t *config),notmuch_database_t *not
     else
 	db_path = talloc_strdup (local, db_path);
 
+    mail_root = notmuch_config_get (notmuch, NOTMUCH_CONFIG_MAIL_ROOT);
+
     new_tags = notmuch_config_get_values (notmuch, NOTMUCH_CONFIG_NEW_TAGS);
 
     if (print_status_database (
@@ -533,7 +535,7 @@ notmuch_insert_command (unused(notmuch_config_t *config),notmuch_database_t *not
 	return EXIT_FAILURE;
     }
 
-    maildir = talloc_asprintf (local, "%s/%s", db_path, folder);
+    maildir = talloc_asprintf (local, "%s/%s", mail_root, folder);
     if (! maildir) {
 	fprintf (stderr, "Out of memory\n");
 	return EXIT_FAILURE;
-- 
2.29.2

  reply	other threads:[~2021-01-07 11:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-05  2:23 v1 flexible database location David Bremner
2021-01-05  2:23 ` [PATCH 1/5] lib/open: support NOTMUCH_DATABASE environment variable David Bremner
2021-01-05  2:23 ` [PATCH 2/5] support splitting mail from database location David Bremner
2021-01-07 11:50   ` David Bremner [this message]
2021-01-05  2:23 ` [PATCH 3/5] lib/open: move path calculations after notmuch object creation David Bremner
2021-01-05  2:23 ` [PATCH 4/5] lib/open: open xapian database without .notmuch prefix David Bremner
2021-01-05  2:23 ` [PATCH 5/5] lib/open: support XDG_DATA_HOME as a fallback database location David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210107115018.2115759-1-david@tethera.net \
    --to=david@tethera.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).