gares / syncmaildir

Maildir synchronization tool
GNU General Public License v3.0
17 stars 3 forks source link

should ignore symlinks in "mailboxes" #5

Open anarcat opened 6 years ago

anarcat commented 6 years ago

I use notmuch to index my mails. This means that in my Maildir folder, there is a Maildir/.notmuch/hooks/ subfolder which has various programs that run before and after notmuch is ran. To version-control that stuff, I use symlinks, so things look like this:

[264]anarcat@curie:syncmaildir$ ll ~/Maildir/.notmuch/hooks/
total 0
lrwxrwxrwx 1 anarcat anarcat 29 2017-01-04 22:51 post-new -> /home/anarcat/bin/notmuch-tag*
lrwxrwxrwx 1 anarcat anarcat 31 2017-01-04 22:51 pre-new -> /home/anarcat/bin/notmuch-purge*

When smd-check-conf finds this folder, it freaks out:

Remote mailboxes translated to local and back:
error [stat]: Maildir/.notmuch/hooks/pre-new in not a directory
Error while listing the content of Maildir, skipping
Endpoint default configuration file successfully checked

I don't think it should freak out like that - those files should just be ignored out of the box. Naturally, I can easily make smd ignore those files with:

EXCLUDE="Maildir/.notmuch/hooks/* Maildir/.notmuch/xapian/*"

I'm not sure I need to ignore the Xapian folder as well, but it seems safer.

gares commented 6 years ago

You are definitely right

gares commented 6 years ago

Before fixing the bug I want to improve https://github.com/gares/syncmaildir/blob/master/tests.d/mddiff/06-listing-folders

I have some troubles reproducing your bug, since it seems your configuration is such that mddiff is called as follows: mddiff -l GoodDirectory SymlinkToANonDirectory. Looking at https://github.com/gares/syncmaildir/blob/master/smd-check-conf#L59 . Can you confirm the value of your MAILBOX_LOCAL variable?

anarcat commented 6 years ago

i must admit i also had trouble reproducing this while filing this bug report. it sometimes happens, sometimes not, and it's unclear to me when...

right now i have this:

MAILBOX_LOCAL=Maildir-smd/
MAILBOX_REMOTE=Maildir/

... but before it was:

MAILBOX_LOCAL=Maildir/Anarcat/
MAILBOX_REMOTE=Maildir/

In both cases, the notmuch directory is in Maildir/.notmuch, in remote and local. Now that I use Maildir-smd however, there's no .notmuch directory there but there will be when i move that folder back in Maildir/Anarcat.