syncmaildir icon indicating copy to clipboard operation
syncmaildir copied to clipboard

Maildir/INBOX exception

Open anarcat opened this issue 6 years ago • 0 comments

Hi,

I'm using the following config to sync my remote folders with a local instance:

MAILBOX_LOCAL=Maildir-smd/
MAILBOX_REMOTE=Maildir/
TRANSLATOR_RL="smd-translate -m oimap-dovecot -d RL default"
TRANSLATOR_LR="smd-translate -m oimap-dovecot -d LR default"

It seems that SMD does not do the right thing for the Maildir folder, which is kind of special. Here's how "push" sees it:

translating: Maildir-smd/INBOX/cur -> Maildir/.INBOX/cur
translating: Maildir-smd/INBOX/new -> Maildir/.INBOX/new

indeed, smd-check-conf sees the following roundtrip:

$ smd-check-conf  | grep INBOX
   Maildir-smd/INBOX/cur -> Maildir/.INBOX/cur -> Maildir-smd/INBOX/cur
   Maildir-smd/INBOX/new -> Maildir/.INBOX/new -> Maildir-smd/INBOX/new

This is incorrect: the remote "INBOX" folder is really ~/Maildir itself, there's no INBOX subdirectory...

I've tried the following workaround on the remote server:

ln -s .. Maildir/.INBOX

... but this feels wrong. For one it will definitely wreck havoc with IMAP clients which will explode in an awful recursion...

Another alternative is to rename the toplevel INBOX folders like this, on the local client:

mv Maildir/INBOX/{cur,tmp,new} Maildir
rmdir Maildir/INBOX

... but somehow that doesn't actually work: i still get warnings on push about failures to write to .INBOX.

It seems to me the translators should make a special case of the INBOX folders, shouldn't they?

anarcat avatar May 15 '18 20:05 anarcat