unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Confusing message from notmuch-maildir-fcc-with-notmuch-insert
@ 2022-03-03 18:13 Carl Worth
  2022-03-04 11:10 ` David Bremner
  0 siblings, 1 reply; 3+ messages in thread
From: Carl Worth @ 2022-03-03 18:13 UTC (permalink / raw)
  To: Notmuch List

Hi folks,

I just setup notmuch from scratch for the first time in a very long
time, (as in, for the first time since I created notmuch originally).

And first, thanks to everyone who has kept notmuch going along so well!
It's delightful for me to see how much it keeps improving in the time I
have been hands off from the project. You're all wonderful!

When I first tried sending an email message from emacs with notmuch, it
apparently worked, but then the automatic fcc failed, (because I didn't
have a "sent" folder in my local mail store).

The error message I got was not entirely helpful (although it was trying
hard to be). It said:

  Insert failed: (r)etry, (c)reate folder, (i)gnore, or (e)dit the header?

I didn't clue into what "Insert" meant here. And since I was coming just
from having configured msmtp I thought maybe notmuch wasn't successful
in actually sending the email.

I hit (e) since that looked like something that would let me debug
further.

That took me back to the message where I saw "Fcc: sent" and I clued
into the fact that it was an FCC failure here.

At this point, a truly new user might have been stumped, but I started
code diving, (first with "M-x apropos fcc" since I wasn't sure if the
fcc bug I had hit was a notmuch thing or in some deeper layer).

I found notmuch-fcc-handler in the search results, and saw that it was
now defaulting to using "notmuch insert" by default, (which yes, is a
good thing, and better than the plain FCC handling I did originally that
didn't make recently-sent messages available to notmuch until the next
indexing operation).

So now I realized what "Insert" meant in "Insert failed" and I guessed
that the bug was from the fact that the "sent" directory didn't
exist.

So I ran "maildirmake ~/mail/sent" and retried sending my mail and
everything worked.

Then, I went back into the code to see why it wasn't clever enough to
make a directory itself. Here I found that
notmuch-maildir-fcc-with-notmuch-insert actually does have code to
create the missing directory, but only if told to with an optional
argument.

And the I looked at the code that emitted the error message I saw
originally and finally realized it was giving me the option to create
the missing directory if I had only understood what the message meant
and had pressed "c" to create it.

So, that's the long story of my little confusion this morning. I'm
trying to decide what would be a clean fix here.

Certainly if the code had just created the directory for me, everything
would have been fine. But I guess I can understand why the code doesn't
do that if we're trying to support a case where users are manually
typing random strings in for the Fcc header and might typo something?  I
don't know how much I _really_ care about that use case, (if notmuch
creates a directory based on a typo the mail will still be indexed and
perhaps some notmuch users don't care much about directory names inside
the mail store).

Otherwise, if the message had said:

  Failed to save sent message in local mail store. Directory
  /home/cworth/mail/sent does not exist. Create? (y/n)

Then I definitely would have understood the message and things would
have been much smoother for me.

Thoughts?

-Carl

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Confusing message from notmuch-maildir-fcc-with-notmuch-insert
  2022-03-03 18:13 Confusing message from notmuch-maildir-fcc-with-notmuch-insert Carl Worth
@ 2022-03-04 11:10 ` David Bremner
  2022-03-04 15:11   ` Miguel Bernabeu
  0 siblings, 1 reply; 3+ messages in thread
From: David Bremner @ 2022-03-04 11:10 UTC (permalink / raw)
  To: Carl Worth, Notmuch List

Carl Worth <cworth@cworth.org> writes:

>
> Certainly if the code had just created the directory for me, everything
> would have been fine. But I guess I can understand why the code doesn't
> do that if we're trying to support a case where users are manually
> typing random strings in for the Fcc header and might typo something?  I
> don't know how much I _really_ care about that use case, (if notmuch
> creates a directory based on a typo the mail will still be indexed and
> perhaps some notmuch users don't care much about directory names inside
> the mail store).
>
> Otherwise, if the message had said:
>
>   Failed to save sent message in local mail store. Directory
>   /home/cworth/mail/sent does not exist. Create? (y/n)
>
> Then I definitely would have understood the message and things would
> have been much smoother for me.
>

I agree your message is clearer, if the only possible failure is a
missing directory. I'm not sure if that's the case though. Probably a
first step is to make sure a sensible description of the error is
reported by notmuch insert and made available to the user.

d

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Confusing message from notmuch-maildir-fcc-with-notmuch-insert
  2022-03-04 11:10 ` David Bremner
@ 2022-03-04 15:11   ` Miguel Bernabeu
  0 siblings, 0 replies; 3+ messages in thread
From: Miguel Bernabeu @ 2022-03-04 15:11 UTC (permalink / raw)
  To: notmuch, David Bremner, Carl Worth, Notmuch List

I have encountered that message several times, and in my case, just creating the directory is not a good solution. My use case is that I have several email accounts in the same notmuch database that I want to treat separately (personal gmail, personal non-gmail, work...). I encounter this error when I manually change the sending address (it defaults to the one used most often) and then the FCC does not match properly. I use the error to signal that I should edit the FCC line as well.

This was an accident, as I did not originally intend to use the error to catch my mistakes and sometimes it cannot detect that. But just creating extra directories would be worse from my POV. I do agree a clearer error message would be helpful (it took me a while to figure out the email is actually sent before the error and I should not resend).

Thanks for all your combined efforts!
Miguel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-04 15:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-03 18:13 Confusing message from notmuch-maildir-fcc-with-notmuch-insert Carl Worth
2022-03-04 11:10 ` David Bremner
2022-03-04 15:11   ` Miguel Bernabeu

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).