I have an issue where using mbsync to sync IMAP -> IMAP between two servers (from a third server) seems to be flattening the hierarchy without being told to.

I am attempting to create a 1:1 replica of an existing mailbox. Both remote systems are using maildir, and an excerpt of folder structure for each after a completed run is below:

|--------------|
| SOURCE       |
|--------------|
| cur          |
| .INBOX.Bills |
|--------------|

|--------------|
| DESTINATION  |
|--------------|
| cur          |
| .Bills       |
|--------------|

When running `mbsync -V my-channel`, I see the (relevant) output:

Connection is now encrypted
Logging in...
Connection is now encrypted
Logging in...
Opening far side box INBOX...
Opening near side box INBOX...
Loading far side box...
Loading near side box...
near side: 0 messages, 0 recent
far side: 1421 messages, 0 recent
Synchronizing...
Opening far side box INBOX/Bills...
Opening near side box INBOX/Bills...
Creating near side box INBOX/Bills...
Loading far side box...
Loading near side box...
near side: 0 messages, 0 recent
far side: 91 messages, 0 recent
Synchronizing...

Based on this, mbsync seems to think it is creating the folder "bills" as a subfolder.

My (sanitized) configuration is:
---------------------------
IMAPAccount source
    Host mail.domain1.tld
    User hayden
    Pass superawesomepasswordisawesome
    SSLType IMAPS
    CertificateFile /etc/ssl/certs/ca-certificates.crt

IMAPAccount destination
    Host mail.domain2.tld
    User hayden
    Pass superawesomepasswordisawesome
    SSLType IMAPS
    CertificateFile /etc/ssl/certs/ca-certificates.crt

IMAPStore my-remote
    PathDelimiter .
    UseNameSpace yes
    Account source

IMAPStore my-local
    PathDelimiter .
    UseNameSpace yes
    Account destination

Channel my-channel
    Master :my-remote:
    Slave :my-local:
    Create Slave
    Patterns *
    CopyArrivalDate yes
    Sync Pull
    SyncState ~/.mail/imap-transfer
---------------------------

I have tried:
with and without the PathDelimiter and UseNameSpace options in the IMAPStore blocks appending "INBOX" to the master and slave in the channel (in each combination)
Appending "INBOX" to the Patterns
Appending "INBOX.Bills" to the Patterns (Not a viable permanent solution, as I won't know the folder structure of customer mailboxes in advance, but was worth testing)
Omitting the patterns statement entirely

None of these have helped.
It's important to note that some remote users may have subfolders of INBOX, or other folders directly under the root of the account, thus a solution that re-writes in transit is likely not going to be viable.


_______________________________________________
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to