"Christmas - the time to fix the computers of your loved ones" « Lord Wyrm

IMAP Backup via isync

TOM 18.07.2024 - 10:39 994 7
Posts

TOM

Super Moderator
Oldschool OC.at'ler
Avatar
Registered: Nov 2000
Location: Vienna
Posts: 7349
Ahoi

Wer von Euch hat Erfahrung mit isync?

Ich bin auf der Suche nach sinnvollen Settings für ein einmaliges cold storage Backup eines/mehrerer IMAP E-Mailkontos

Wie schaut es aus mit Ümlauten, Attachments und co.? Gibt es da besonderes zu beachten?

Ich würd gern vermeiden, dass ich am Mailserver/Source die vorhandenen Mails lösche bei der Aktion :p

Dieses Video liefert eine ganz gute Erklärung und einige sinnvolle Settings imho.

Das lokale Backup soll nicht ständig syncen, sondern nur einmalig durchgeführt => komprimiert je E-Mail Konto und dann gesichert werden.

Würde isync vermutlich am Rasperry-Pi laufen lassen, welcher mit einer entsprechend großen SSD rennt. Keine Top-Performance, aber mit 5-20 GB pro Mailkonto sowieso eher ein längerer Prozess vermutlich.

tia

edit:

hab hier mal zwei example configs als template gefunden
muss mir noch anschauen wie sich "expunge near" von "expunge none" unterscheidet... usw.

Code:
CopyArrivalDate yes  # Don't mess up message timestamps when moving them between folders.
Sync Pull            # Download changes only, don't sync local changes up to the server.
Create Near          # Automatically create new folders in the local copy.
Remove Near          # Automatically remove deleted folders from the local copy.
Expunge Near         # Expunge deleted messages from the local copy.

IMAPAccount fastmail
Host imap.fastmail.com
User [email]YOUR_USERNAME@fastmail.com[/email]
PassCmd PASSWORDHERE
SSLType IMAPS

IMAPStore fastmail-remote
Account fastmail

MaildirStore fastmail-local
Path ~/Mail/Fastmail/
Inbox ~/Mail/Fastmail/Inbox
SubFolders Verbatim

Channel fastmail
Far :fastmail-remote:
Near :fastmail-local:
Patterns *
SyncState *

IMAPAccount gmail
Host imap.gmail.com
User [email]YOUR_USERNAME@gmail.com[/email]
PassCmd "pass mbsync/gmail"
SSLType IMAPS
Pipelinedepth 1
Timeout 60

IMAPStore gmail-remote
Account gmail

MaildirStore gmail-local
Path ~/Mail/Gmail/
Inbox ~/Mail/Gmail/Inbox
SubFolders Verbatim

Channel gmail
Far :gmail-remote:
Near :gmail-local:
Patterns *
SyncState *

Code:
# execute: /usr/bin/mbsync --all --config example.mbsyncrc

### GLOBAL CONFIG
CopyArrivalDate yes
Expunge None

### [email]mail@domain.tld[/email] START

IMAPAccount [email]mail@domain.tld[/email]
Host mxfXXX.netcup.net
User [email]mail@domain.tld[/email]
Pass PASSWORDHERE
UseIMAPS yes
CertificateFile /etc/ssl/certs/ca-certificates.crt

IMAPStore [email]mail@domain.tld[/email]-remote
Account [email]mail@domain.tld[/email]
MaildirStore [email]mail@domain.tld[/email]-local
Path ~/backup/mail/mail@domain.tld/
Inbox ~/backup/mail/mail@domain.tld/Inbox

Channel [email]mail@domain.tld[/email]
Master ":mail@domain.tld-remote:"
Slave ":mail@domain.tld-local:"
Patterns * # everything, but no INBOX
Sync Pull New ReNew Flags
Create Slave
SyncState *

Channel [email]mail@domain.tld[/email]-INBOX
Master ":mail@domain.tld-remote:"
Slave ":mail@domain.tld-local:"
#Patterns # without patterns: only INBOX, nothing else
Sync Pull New ReNew Flags
Create Slave
SyncState *
### [email]mail@domain.tld[/email] END

DAO

Si vis pacem, para bellum
Avatar
Registered: Mar 2001
Location: Austria
Posts: 4954
privat? wieviele mailkonten?

COLOSSUS

Administrator
GNUltra
Avatar
Registered: Dec 2000
Location: ~
Posts: 12060
FTR, Ich synce seit Jahren zwei GMX-Accounts mit dem Tool (isync 1.4.4) "append only" in lokale Maildirs, meine Config dafuer schaut so aus:

Code:
# cat ~/.mbsyncrc
Expunge None

IMAPAccount GMX-topmail
Host imap.gmx.com
SSLType IMAPS
User $meinusername
Pass $meinpasswort

IMAPAccount GMX-freemail
Host imap.gmx.com
SSLType IMAPS
User $meinandererusername
Pass $meinanderespasswort

IMAPStore GMX-topmail
Account GMX-topmail

IMAPStore GMX-freemail
Account GMX-freemail

MaildirStore local-topmail
Path /home/colo/backup/imap-backup/gmx-topmail/
Inbox /home/colo/backup/imap-backup/gmx-topmail/Inbox

MaildirStore local-freemail
Path /home/colo/backup/imap-backup/gmx-freemail/
Inbox /home/colo/backup/imap-backup/gmx-freemail/Inbox


Channel GMX-topmail
Far :GMX-topmail:
Near :local-topmail:
Create Near
Sync Pull
SyncState *
Patterns *

Channel GMX-freemail
Far :GMX-freemail:
Near :local-freemail:
Create Near
Sync Pull
SyncState *
Patterns *

Falls damit irgendwas nicht mitgesichert wird, ist es mir zumindest noch nicht schmerzlich aufgefallen :D

Das Backup selber wird per Cronjob getriggert:

Code:
30 4 * * Wed,Sun /usr/bin/chronic /usr/bin/mbsync -a -C

(chronic ist aus den moreutils)

TOM

Super Moderator
Oldschool OC.at'ler
Avatar
Registered: Nov 2000
Location: Vienna
Posts: 7349
Zitat aus einem Post von DAO
privat? wieviele mailkonten?

drei private e-mail konten

@ colo

danke für die config

Sanity check, passt so?

Code:
# execute: /usr/bin/mbsync --all --config example.mbsyncrc

### GLOBAL CONFIG
CopyArrivalDate yes
Expunge None

### tom@$domain.at START

IMAPAccount tom@$domain.at
Host $HOST
SSLType IMAPS
User $USERNAME
Pass $PASSWORD

IMAPStore tom@$domain.at-remote
Account tom@$domain.at
MaildirStore tom@$domain-local
Path ~/imap-backup/tom@$domain.at/
Inbox ~/imap-backup/tom@$domain.at/Inbox
SubFolders Verbatim

Channel tom@$domain.at
Far :tom@$domain.at:
Near :tom@$domain-local:
Create Near
Sync Pull
SyncState *
Patterns *

DAO

Si vis pacem, para bellum
Avatar
Registered: Mar 2001
Location: Austria
Posts: 4954
für solche zwecke empfehle ich meinen freunden gern mailstore home (gratis).

Joe_the_tulip

Editor
banned by FireGuy
Avatar
Registered: Mar 2003
Location: Wien
Posts: 16418
Zitat aus einem Post von DAO
für solche zwecke empfehle ich meinen freunden gern mailstore home (gratis).

cooles tool, danke.
Klingt gut geeignet zum portieren!

Rektal

Here to stay
Registered: Dec 2002
Location: Inside
Posts: 4436
Wollte nur ein weitere Tool reinwerfen: https://imapsync.lamiral.info/

Hab ich letztes Jahr verwendet und einen sehr sehr sehr grossen lokalen IMAP account nach gmail kopiert. Ueber 500k messages, nach ein paar Tests und tunen, hatte fast 1 Woche gedauert, reibungslos geklappt

b_d

natürlich unwissend
Avatar
Registered: Jul 2002
Location: 0x3FC
Posts: 10538
mail credentials in ein 3rd party web tool reinklopfen? idk :p – da hilft nichtmal das durchaus vertrauenserweckende 90er styling ;D

e: mir ist schon bewusst, dass mans auch lokal machen kann, aber dann kostet es was?

+1 für mbsync
Kontakt | Unser Forum | Über overclockers.at | Impressum | Datenschutz