#1130266 barfs on lost+found if mail is on its own filesystem

Package:
notmuch
Source:
notmuch
Description:
thread-based email index, search and tagging
Submitter:
Marc Haber
Date:
2026-03-13 01:21:02 UTC
Severity:
normal
#1130266#5
Date:
2026-03-10 17:05:33 UTC
From:
To:
Hi,

I have my mail in ~/.mail, and that's its own filesystem because my
Maildir is not much, eh, HUGE.

Notmuch doesn't much like that:

Warning: failed to open directory /home/mh/.mail/lost+found: Permission denied
Found 3311631 total files (that's not much mail).
Error opening directory /home/mh/.mail/lost+found: Permission denied
No new mail.
Note: A fatal error was encountered: Something went wrong trying to read or write a file

Neither ignore=lost+found nor ignore=/home/mh/mail/lost+found seems to
help here.

Greetings
Marc

#1130266#14
Date:
2026-03-10 22:39:14 UTC
From:
To:
Marc Haber <mh+debian-packages@zugschlus.de> writes:

I reassigned to notmuch, since the "Error" message is coming from
notmuch.

Running "notmuch new" with

           drwx------ 2 root root 4096 Mar 11 07:22 lost+found

(but _not_ a separate file system)

I get

    Error opening directory /home/bremner/Maildir/lost+found: Permission denied
    No new mail.
    Note: A fatal error was encountered: Something went wrong trying to read
    or write a file

For me

    ignore=.git;_notmuch_metadata;.gitignore;lost+found

seems to work, but I haven't tested on a separate file system yet.

If you can duplicate the problem with the "notmuch" command, without
using notmuch-mutt, that would be helpful.

#1130266#19
Date:
2026-03-10 23:00:11 UTC
From:
To:
David Bremner <david@tethera.net> writes:

I now tested on a separate (ext4, loop mounted) file system, and the
behaviour seems the same. In particular
ignore=lost+found seems to work.

#1130266#24
Date:
2026-03-11 08:54:03 UTC
From:
To:
Hi David,

thanks for your quick reply:
#       ignore  A list (separated by ';') of file and directory names
#               names will be ignored, independent of its depth/location
ignore=lost+found
[2/4938]mh@torres:~ $ notmuch new
Warning: failed to open directory /home/mh/.mail/lost+found: Permission denied
Found 3314249 total files (that's not much mail).
Error opening directory /home/mh/.mail/lost+found: Permission denied
No new mail.
Note: A fatal error was encountered: Something went wrong trying to read or write a file
[7/4940]mh@torres:~ $ ls -al .mail | grep lost
drwx------   2 root root  16K Sep 22  2015 lost+found/
[8/4940]mh@torres:~ $

Greetings
Marc

#1130266#29
Date:
2026-03-12 00:26:38 UTC
From:
To:
Marc Haber <mh+debian-packages@zugschlus.de> writes:

I'm a bit stumped, but here are a few ideas to try. All are
somewhat long shots.

1) I just uploaded 0.40 to trixie backports, so in a few days maybe you
could try that.

2) To double check for ignore being in the wrong section, can you please
run

        $ notmuch config get new.ignore

3) Run notmuch new with --debug, it should chatter about what it is
ignoring.

4) Let me know what details you can about the partition ~/.mail. In my
experiments I ended up with a root owned mail_root, which did not seem
to bother notmuch, but it does seem a bit inconvenient. What is your
underlying filesystem? Is there bind mounting involved?

#1130266#34
Date:
2026-03-12 09:29:11 UTC
From:
To:
That might be the reason. my ignore is in the [user] section, right
below the comment that documents the ignore option:

[user]
primary_email=mh+*@zugschlus.de
# Configuration for "notmuch new"
#
# The following options are supported here:
#
#       tags    A list (separated by ';') of the tags that will be
#               added to all messages incorporated by "notmuch new".
#
#       ignore  A list (separated by ';') of file and directory names
#               that will not be searched for messages by "notmuch new".
#
#               NOTE: *Every* file/directory that goes by one of those
#               names will be ignored, independent of its depth/location
#               in the mail store.
ignore=lost+found
#
[new]
# Search configuration
#
# The following option is supported here:
#
#       exclude_tags
#               A ;-separated list of tags that will be excluded from
#               search results by default.  Using an excluded tag in a
#               query will override that exclusion.
#

Duplicating the ignore line in the new section seems to fix the issue,
so this remains just a "documentation" issue in the default generated
configuration file.

No bind mounting, ext4, and a stupid
/dev/disk/by-label/torres-mh_mail /home/mh/.mail ext4   nofail 0        2
line in fstab.

Greetings
Marc

#1130266#39
Date:
2026-03-12 21:26:34 UTC
From:
To:
Marc Haber <mh+debian-bugs@zugschlus.de> writes:

I see. As you probably figured out, the descriptions are meant to apply
to the following section. If you have some ideas about how to make that
more clear, I do plan to rework that part of the code before the next
upstream release.

#1130266#48
Date:
2026-03-12 21:36:27 UTC
From:
To:
I would find it more intuitive if it was formatted like:

[database]
path=/home/mh/.mail

[user]
# User configuration
#
# Here is where you can let notmuch know how you would like to be
# addressed. Valid settings are
#
#       name            Your full name.
#       primary_email   Your primary email address.
#       other_email     A list (separated by ';') of other email addresses
#                       at which you receive email.
#
# Notmuch will use the various email addresses configured here when
# formatting replies. It will avoid including your own addresses in the
# recipient list of replies, and will set the From address based on the
# address to which the original email was addressed.
#
primary_email=---

[new]
# Configuration for "notmuch new"
#
# The following options are supported here:
#
#       tags    A list (separated by ';') of the tags that will be
#               added to all messages incorporated by "notmuch new".
#
#       ignore  A list (separated by ';') of file and directory names
#               that will not be searched for messages by "notmuch new".
#
#               NOTE: *Every* file/directory that goes by one of those
#               names will be ignored, independent of its depth/location
#               in the mail store.
ignore=lost+found

[search]
# Search configuration
#
# The following option is supported here:


But I might be the person with the skewed expectations.

Greetings
Marc

#1130266#53
Date:
2026-03-13 01:17:56 UTC
From:
To:
Marc Haber <mh+debian-bugs@zugschlus.de> writes:

Your version looks OK to me, but honestly I never look at this file, so
let's see if anyone else has opinions. The other question is how much
control we have over the output. We're using `g_key_file_set_comment`,
so this might be a glib feature request.

d