On Wed, Oct 05, 2016 at 08:42:06AM +0200, Oswald Buddenhagen wrote:
> On Tue, Oct 04, 2016 at 05:57:35PM -0400, Nik Melchior wrote:
> > I don't know whose interpretation of Maildir++ is correct, but Courier
> > does in fact prepend a '.' for top-level mailboxes.
> > 
> please post your on-disk layout and the imap view (output from mbsync -l
> -Dn -a is sufficient, provided you didn't misconfigure it too much).

First of all, I realized I suggested "courier" support, when I'm actually
using "dovecot".  Sorry for that, I'm not sure how I made that mistake.

I recreated the issue on a VM by creating two Maildirs.  I pointed dovecot at
~/Mail and mbsync's localstore at ~/OtherMail.  I saved a message in mailbox
"foo" using dovecot, which created ~/Mail/.foo/{cur,new,tmp}.  Then, I used
mbsync to perform a synchronization, which created
~/OtherMail/foo/{cur,new,tmp}.

In my real use case, ~/OtherMail is on another machine that should support
IMAP as well, but dovecot doesn't see ~/OtherMail/foo.  If I swap mentions of
~/Mail and ~/OtherMail in the relevant configuration files, mbsync fails to
synchronize.

My full recipe for reproducing the issue is below (including the requested
output from "mbsync -l -Dn -a"), and my .mbsyncrc is attached.  Please let me
know if I can provide any additional information.

===========================================

1. Spin up Debian 8.6 VM named mbsynctest
2. Install mutt, dovecot-imapd, bsd-mailx
3. Install self-built isync from git 167964933f42d32f1cc2a119453e71c5048e86e2
   + Guillem's patch 0002
4. Configure dovecot for maildir (in /etc/dovecot/conf.d/10-mail.conf):
   mail_location = maildir:~/Mail
5. mkdir Mail OtherMail
6. Send myself a test mail:
   echo Test | mail -s Test debian@localhost
7. Configure mutt for IMAP.  Create .muttrc containing:
   set tunnel="MAIL=maildir:~/Mail /usr/lib/dovecot/imap 2>/dev/null"
   set folder="imap://localhost/"
8. Use mutt to save the message from my spool to =foo (Creating the mailbox
   via IMAP)
9. $ ls -a Mail/
   .  ..  dovecot-uidvalidity  dovecot-uidvalidity.57f7f165  .foo
10. Create minimal(?) .mbsyncrc (attached)
11. mbsync -l -Dn -a

Reading configuration file /home/debian/.mbsyncrc
Channel localhost
Opening master store localhost...
Starting tunnel 'ssh -C -q localhost 'MAIL=maildir:~/Mail 
/usr/lib/dovecot/imap''... ok
Opening slave store local...
* PREAUTH [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE 
SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT 
MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS 
LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN 
CONTEXT=SEARCH LIST-STATUS SPECIAL-USE BINARY MOVE] Logged in as debian
>>> 1 NAMESPACE
* NAMESPACE (("" ".")) NIL NIL
1 OK Namespace completed.
>>> 2 LIST "" "*"
* LIST (\HasNoChildren) "." foo
* LIST (\HasNoChildren) "." INBOX
2 OK List completed.
INBOX
foo
>>> 3 LOGOUT
imap(debian): Info: Disconnected: Logged out in=36 out=559
* BYE Logging out
3 OK Logout completed.

12. mbsync -a
13. $ ls -a OtherMail/
    .  ..  foo  INBOX
14. Swap instances of Mail and OtherMail in dovecot config and .mbsync
15. mbsync -l -Dn -a

Reading configuration file /home/debian/.mbsyncrc
Channel localhost
Opening master store localhost...
Starting tunnel 'ssh -C -q localhost 'MAIL=maildir:~/OtherMail 
/usr/lib/dovecot/imap''... ok
Opening slave store local...
* PREAUTH [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE 
SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT 
MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS 
LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN 
CONTEXT=SEARCH LIST-STATUS SPECIAL-USE BINARY MOVE] Logged in as debian
>>> 1 NAMESPACE
* NAMESPACE (("" ".")) NIL NIL
1 OK Namespace completed.
>>> 2 LIST "" "*"
* LIST (\HasNoChildren) "." INBOX
2 OK List completed.
INBOX
.foo
>>> 3 LOGOUT
imap(debian): Info: Disconnected: Logged out in=36 out=526
* BYE Logging out
3 OK Logout completed.

16. $ mbsync -a
C: 0/1  B: 0/2  M: +0/0 *0/0 #0/0  S: +0/0 *0/0 #0/0
Maildir notice: no UIDVALIDITY, creating new.
C: 0/1  B: 1/2  M: +0/0 *0/0 #0/0  S: +0/0 *0/0 #0/0
Maildir notice: no UIDVALIDITY, creating new.
Error: channel localhost: master .foo cannot be opened.
C: 1/1  B: 2/2  M: +0/0 *0/0 #0/0  S: +0/0 *0/0 #0/0imap(debian): Info: 
Disconnected: Logged out in=63 out=840

===========================================

-- Nik
SyncState *
Create Slave

MaildirStore local
Path "~/OtherMail/"
Inbox "~/OtherMail/INBOX"
AltMap no

IMAPAccount localhost
Tunnel "ssh -C -q localhost 'MAIL=maildir:~/Mail /usr/lib/dovecot/imap'"
User debian

IMAPStore localhost
Account localhost
UseNamespace yes

Channel localhost
Master :localhost:
Slave :local:
Pattern *
Expunge Both

Reply via email to