Re: [notmuch] Notmuch doesn't index new mails when mail location contains symlinks

Subject: Re: [notmuch] Notmuch doesn't index new mails when mail location contains symlinks

Date: Mon, 23 Nov 2009 16:03:00 +0100

To: Tassilo Horn, Mikhail Gusarov

Cc: notmuch@notmuchmail.org

From: Jed Brown


On Mon, 23 Nov 2009 15:43:41 +0100, Tassilo Horn <tassilo@member.fsf.org> wrote:
> First, I only touched the two symlinks.

Unfortunately, this actually touched the file pointed to by the symlink,
if you stat the symlink you will see that mtime did not change.

> This didn't help.  Then I used
> "find . -type d | xargs touch" to touch all directories inside the
> directories the symlinks point to.

Actually, this would not have followed the symlinks so it does the same
thing as before.  I think it is actually hard (or not possible) to
change mtime on symlinks under Linux.

> But still no luck.  Finally, I deleted the symlinks and created them
> anew, and then it indexed the 12 new mails that arrived in the
> meantime.

If /var is on the same filesystem, you could use hard links instead of
symlinks.  Otherwise I would just add the appropriate ln -sf in the hook
before notmuch new.

The real solution is for notmuch to check mtime of whatever the
symlink's target.

Jed

Thread: