#1007840 [notmuch-slurp-debbug] notmuch-slurp-debbug should use "notmuch insert"

#1007840#5
Date:
2022-03-17 17:51:39 UTC
From:
To:
notmuch has had an "insert" subcommand since notmuch 0.16 (2013-08-03,
according to /usr/share/doc/notmuch/NEWS.gz

rather than guessing at maildir paths or whatever, notmuch-slurp-debbug
should just feed the retreived messages into "notmuch insert".

For backward compatibility, if a "maildir" configuration variable is
present, it could fall back to the old form of insertion, but emit a
warning that it is doing so.

When the old method is *not* used, we could add a passthrough option
that lets the user append arbitrary arguments to "notmuch insert", which
would also conveniently solve #995842.

#1007840#10
Date:
2022-03-17 18:34:32 UTC
From:
To:
Hello,

How about using 'notmuch insert --folder=<maildir>' if the old config
key is present, and not issuing a warning?

Nice.

#1007840#15
Date:
2022-03-17 22:18:45 UTC
From:
To:
Hi Sean, thanks for the prompt response.

The trouble with that is that --insert is defined "relative to the
top-level directory given by the value of database.mail_root.", whereas
the maildir is a full filesystem path.

Seems better to me to do a deprecation cycle.  It's noisier short term,
but cleaner longterm.

The other open question here is that "notmuch insert" on its own
defaults to delivering at the top level, whereas notmuch-slurp-debbug
wants to use the "inbox" folder just below the top level.

I'm personally fine with the default delivery location changing, but if
you think we ought to default to something like --folder=inbox
--create-folder i'd be willing to do that too.

If we go the --folder=inbox --create-folder route, then we'd need to
decide whether the passthrough arguments would *append* to
--folder=inbox --create-folder, or whether they would *replace*
--folder=inbox --create-folder.  I'd lean toward replacement in that
case.

Also, what would you like this configuration key to be named?  I was
thinking "insert_args".

So, four questions:

a) how to deal with existing maildir configuration key?
    (i prefer emitting a warning and falling back to old behavior)

b) what should the config key be named?
    (i prefer "insert_args")

c) where to place the new messages?
    (i prefer the "notmuch insert" defaults, but could be
    "--folder=inbox --create-folder")

d) if messages are placed by default via "--folder=inbox
   --create-folder", how should the config key interact with the default
   args?
      (if we get to this question, i prefer replacement)

Let me know what you prefer and i'll see whether i can offer a patch in
the coming days.

#1007840#20
Date:
2022-03-17 22:49:57 UTC
From:
To:
Hello,

I was thinking that some users might want to ensure the new mail goes
into a particular subdirectory, as they can do at present (I know
Vagrant does this, for example).  You can do that with your new
insert_args, but why not support both ways?  We just File::Spec::abs2rel
the old configuration key and use it.

Most people won't want to pass any tags, this way the user doesn't have
to go read notmuch-insert(1), and we also get backwards compatibility
for free.

Fine with me.

Replacement is okay with me.