hi,

On Sat, Nov 16, 2013 at 12:09:34AM +0100, CycyX wrote:
> I'm trying to use mbsync in order to backup my mail accounts, but I'm
> facing strange behavior (or misconfiguration).
> 
> My goal is to get the following:
> 
> ~/Mails/
>   `- Account1
>   | `- Subfolders
>   `- Account2
>     `- subfolders
>    ...
> 
> I'm currently using the following configuration (only one account for
> the moment):
> 
> -----8<--------SNiP--------8<-----
> MaildirStore f-u-local
> Path ~/Mails/Account1/.
>
that trailing period is a bad idea, i think.

> Inbox ~/Mails/Account1/
>
no trailing slash here.

> Flatten .
> 
> IMAPStore f-u-remote
> Host imap.provider.org
> User cycyx
> Pass ********
> UseIMAPS yes
> CertificateFile ~/conf/certs/imap.provider.org.pem
> 
> Channel Account1
> Master :f-u-remote:
> Slave :f-u-local:
> Patterns * !*Projets* !*Listes* !*Admin !*Queue !*Junk
> Create Both
> SyncState *
> CopyArrivalDate yes
> -----8<--------SNiP--------8<-----
> 
> First issue:
> If I "mkdir ~/Mails/Account1/", mbsync complains about "no valid
> mailbox". If I "maildirmake ~Mails/Account1/" it's OK, but my "cur"
> directory is empty (I have 28 mails in my INBOX on the server).
> I can't seem to sync my INBOX. I don't even know where mbsync is trying
> to sync it... (plus I have an .mbsyncstate in every subfolder)
> 
> Second issue:
> On my server (the IMAP server is dovecot), my folder hierarchy is as
> follow
> .Amazon
> .Divers
> .Misc
> ...
> On my local machine, mbsync creates:
> .INBOX.Amazon
> .INBOX.Divers
> .INBOX.Misc
> ...
> 
> How can I get rid of the ".INBOX" part (if possible)?
> 
these two issues are actually one, i think.
first, you must consider that the Path is *not* a mailbox itself - it is
a "container" for mailboxes. this is unlike what INBOX is: it's actually
a mailbox itself, with subfolders.
now, if your INBOX does not actually contain any mail, but only
subfolders, you can "trick" mbsync:

IMAPStore f-u-remote
Path INBOX.
...

if your INBOX does contain mail, you are mostly out of luck as far as
mbsync's automatic hierarchy support is concerned: you basically want to
rename INBOX => Account1 while syncing, which is not supported in
Patterns mode (there is a related feature request in the bug tracker,
but no ETA).

the alternative to Paterns is creating a separate Channel per subfolder
- when you specify the boxes on both sides explicitly, renaming is
obviously supported. you can then join the Channels into a Group:

Create Both
SyncState *

MaildirStore f-u-local
Path ~/Mails/
Inbox ~/Mails/Account1
Flatten .

IMAPStore f-u-remote
Host imap.provider.org
User cycyx
Pass ********
UseIMAPS yes
CertificateFile ~/conf/certs/imap.provider.org.pem

Channel Account1-inbox
# in these, INBOX is implicit
Master :f-u-remote:
Slave :f-u-local:
Patterns * !*Projets* !*Listes* !*Admin !*Queue !*Junk
# whoops, this is not available as a global option. need to fix it:
CopyArrivalDate yes

Channel Account1-projets
Master :f-u-remote:INBOX.Projets
Slave :f-u-local:Account1.Projets
CopyArrivalDate yes

Channel Account1-listes-one
Master :f-u-remote:INBOX.Listes.One
Slave :f-u-local:Account1.Listes.One
CopyArrivalDate yes

...

Group Account1 Account1-inbox Account1-projets Account1-listes-one ...

of course this gets rather tedious if you have many mailboxes,
especially if you often change (add) something ...

actually, to support your mode of operation, a rather simple extension
should be sufficient:

Master :remote:INBOX
Master :local:Account1
Patterns *

i can do that soon, but no promises as to *how* soon.

regards

------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to