Re: Confusing message from notmuch-maildir-fcc-with-notmuch-insert

2022-03-04 Thread Miguel Bernabeu
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
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: Confusing message from notmuch-maildir-fcc-with-notmuch-insert

2022-03-04 Thread David Bremner
Carl Worth  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

___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Confusing message from notmuch-maildir-fcc-with-notmuch-insert

2022-03-03 Thread Carl Worth
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
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org