Discussion:
Sync remote INBOX to different local name (IMAP-to-IMAP)?
John Goggan
2013-05-03 19:00:54 UTC
Permalink
I've just started using isync/mbsync today. My goal is to make periodic one-way backups of my Gmail account -- and later be able to easily access them from various IMAP clients. Therefore, I am doing a one-way (master to slave only) IMAP-to-IMAP transfer using mbsync by using "Sync Pull".

Things work GREAT for everything except the main INBOX. I can't find a way to put those messages into a DIFFERENTLY NAMED box at the slave end. I can use MapInbox to specify a new INBOX name at the slave end -- but that appears to be just for doing a DUPLICATE of the INBOX. It still syncs to my default INBOX at the slave end too. I don't want to do that -- I don't want to mix the remote INBOX into my local INBOX. I just want to dump it somewhere else so that I have it.

I use the Path keyword to specify a different location to dump all of the other folders being backed up -- plus the MapInbox copy -- so I actually end up with exactly what I want. Again, the only problem is that it ALSO syncs the remote INBOX to my local INBOX -- regardless of what I specify.

Am I missing some obvious way to do this? Basically, if I just wanted to back up a remote IMAP INBOX to a local IMAP with some other name (e.g. "backup-INBOX") and not put it into the local IMAP INBOX, can that be done with mbsync?

Thank you!

- John
Oswald Buddenhagen
2013-05-04 07:01:46 UTC
Permalink
Post by John Goggan
Things work GREAT for everything except the main INBOX. I can't find
a way to put those messages into a DIFFERENTLY NAMED box at the slave
end. I can use MapInbox to specify a new INBOX name at the slave end
-- but that appears to be just for doing a DUPLICATE of the INBOX. It
still syncs to my default INBOX at the slave end too.
that doesn't sound right. please post your config file (edit out the
passwords, obviously).
John Goggan
2013-05-06 15:29:52 UTC
Permalink
Post by Oswald Buddenhagen
Post by John Goggan
Things work GREAT for everything except the main INBOX. I can't find
a way to put those messages into a DIFFERENTLY NAMED box at the slave
end. I can use MapInbox to specify a new INBOX name at the slave end
-- but that appears to be just for doing a DUPLICATE of the INBOX. It
still syncs to my default INBOX at the slave end too.
that doesn't sound right. please post your config file (edit out the
passwords, obviously).
Here it is:

----
# Local Account:
IMAPAccount local-john
Host dcgtech.com
User john
Pass XXXXXXX
UseIMAPS yes
CertificateFile ~/.mbsync/dcgtech.crt

# GMAIL:
IMAPAccount gmail-john
Host imap.gmail.com
User ***@gmail.com
Pass XXXXXXX
UseIMAPS yes
CertificateFile /etc/ssl/certs/ca-certificates.crt

IMAPStore gmail-john-cloud
MapInbox INBOX-gmail
Account gmail-john

IMAPStore local-john-gmail
Path ~/mail/GmailArchive/
Account local-john

Channel gmail-john
Master :gmail-john-cloud:
Slave :local-john-gmail:
Create Slave
Expunge Slave
Sync Pull
Patterns *
---

There are 6 messages in my gmail account. When I run mbsync with this configuration, it pulls the 6 emails and puts them into my default INBOX. Then it pulls the same 6 emails again and puts them into the INBOX-gmail box that I specified with the "MapInbox" line (and does so in the proper directory as specified: ~/mail/GmailArchive/).

What I want is for it to JUST put them into the INBOX-gmail box -- and not also put them into my default INBOX.

Thanks!

- John
John Goggan
2013-05-06 15:36:57 UTC
Permalink
I think I just figured this out myself. I changed my Pattern line to exclude INBOX -- and it still gets the messages from my Gmail INBOX and puts them into INBOX-gmail as desired -- but does not put them into my local INBOX also. I had misunderstood how the Pattern line would work. I thought that excluding INBOX there would make it not pull from INBOX at all. It appears that excluding INBOX on the Pattern line still does what I want: pulls them and puts them into my MapInbox location.

So, I think I'm all set unless someone notices something else in my config that should be changed. Thanks!

- John
Post by John Goggan
Post by Oswald Buddenhagen
Post by John Goggan
Things work GREAT for everything except the main INBOX. I can't find
a way to put those messages into a DIFFERENTLY NAMED box at the slave
end. I can use MapInbox to specify a new INBOX name at the slave end
-- but that appears to be just for doing a DUPLICATE of the INBOX. It
still syncs to my default INBOX at the slave end too.
that doesn't sound right. please post your config file (edit out the
passwords, obviously).
----
IMAPAccount local-john
Host dcgtech.com
User john
Pass XXXXXXX
UseIMAPS yes
CertificateFile ~/.mbsync/dcgtech.crt
IMAPAccount gmail-john
Host imap.gmail.com
Pass XXXXXXX
UseIMAPS yes
CertificateFile /etc/ssl/certs/ca-certificates.crt
IMAPStore gmail-john-cloud
MapInbox INBOX-gmail
Account gmail-john
IMAPStore local-john-gmail
Path ~/mail/GmailArchive/
Account local-john
Channel gmail-john
Create Slave
Expunge Slave
Sync Pull
Patterns *
---
There are 6 messages in my gmail account. When I run mbsync with this configuration, it pulls the 6 emails and puts them into my default INBOX. Then it pulls the same 6 emails again and puts them into the INBOX-gmail box that I specified with the "MapInbox" line (and does so in the proper directory as specified: ~/mail/GmailArchive/).
What I want is for it to JUST put them into the INBOX-gmail box -- and not also put them into my default INBOX.
Thanks!
- John
Loading...