IMAP Backup via isync

Seite 1 von 1 - Forum: Coding Stuff auf overclockers.at

URL: https://www.overclockers.at/coding-stuff/imap-backup-via-isync_263754/page_1 - zur Vollversion wechseln!


TOM schrieb am 18.07.2024 um 10:39

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 schrieb am 18.07.2024 um 11:37

privat? wieviele mailkonten?


COLOSSUS schrieb am 18.07.2024 um 11:37

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 schrieb am 19.07.2024 um 08:28

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 schrieb am 19.07.2024 um 13:57

für solche zwecke empfehle ich meinen freunden gern mailstore home (gratis).


Joe_the_tulip schrieb am 29.08.2024 um 00:24

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 schrieb am 17.10.2024 um 15:41

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 schrieb am 17.10.2024 um 15:50

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


Rektal schrieb am 20.10.2024 um 16:04

K.a. auf was sich das bezieht, ich hab imapsync nicht per web tool sondern lokal verwendet.


b_d schrieb am 21.10.2024 um 06:21

https://imapsync.lamiral.info/X/

aber ja, das is eh nur eine demo mit einschränkungen, und lokal gibts ja auch.


voyager schrieb am 21.10.2024 um 06:38

Wie oben schon mal erwähnt wurde, Mailstore ist nice.

Ich nutz in der Kanzlei die Server Variante, hab aber mal mit der Home zum testen angefangen.




overclockers.at v4.thecommunity
© all rights reserved by overclockers.at 2000-2025