<div dir="ltr"><div>Hello Adam, and the dovecot list<br></div><div><br></div><div>Just a question, I hate to pollute the thread, so feel free to push these questions into a new thread if deemed necessary. So as you can guess I'm a bit of a newb here, so rather obvious questions are about to arrive....<br><br></div><div> As you are using GIT for your archive (which is a cool idea by the way) I'm sure you are well aware that not all files types play nicely with version control, my question therefore is : How do you plan to handle attachments ?<br><br></div><div>Also, although I appreciate the idea of using git, emails generally don't 'change', but I guess that also depends on how you are storing them (single email with links to previous / next ... etc, or as a single big file for each specific thread). Although this is hitting my limits of understanding for how dovecot works, so I probably need educating on this (a pointer to the docs would be good).<br></div><div><br></div><div>You seem concerned regarding the files that you are ignoring that you will need to 'recreate them', so why not do a complete <span style="font-family:monospace">git add .</span> prior to adding them into the git ignore, then you have an initial state for those files too.<br><br></div><div>Final thought, what advantage do you envisage by using git as opposed to simply using a filter to select the files over a certain age, and place them into a zipped TAR archive ? Although I guess you could eventually zip the git archive too, and in the interim it would remain searchable by your users mail clients whilt in git.<br><br></div><div>Thanks in advance, and apologies once again for polluting your question with my own.<br><br></div><div>David<br></div><div><br><br><br><br></div><div><br><br><br><br><br><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Oct 6, 2020 at 7:22 PM Adam <<a href="mailto:adam.ranek@seznam.cz" target="_blank">adam.ranek@seznam.cz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Everybody,<br>
<br>
I'd like to start archiving e-mails by moving them to a server with running Dovecot.<br>
<br>
I installed "dovecot-core" and "dovecot-imapd" (version 2.3.4.1) on Debian 10.<br>
<br>
One of a few configurations I made is to use Maildir:<br>
<br>
# grep '^mail_location = ' /etc/dovecot/conf.d/10-mail.conf<br>
mail_location = maildir:~/Maildir<br>
<br>
I successfully moved some e-mails (at this moment it's just a test) to subfolders that describe a year of the backup.<br>
<br>
I'd like to start using git on the whole Maildir. After going through the Maildir directory and subdirectories I realized that Dovecot saves some extra files that I might not need to backup (version control).<br>
<br>
Based on my understanding and after reading <a href="https://wiki.dovecot.org/IndexFiles" rel="noreferrer" target="_blank">https://wiki.dovecot.org/IndexFiles</a> I believe that the only files I need to archive are files in "cur/" directory and these files should start with Unix time.<br>
<br>
So I decided to write a ".gitignore" whitelist that will include only files in "cur/" that start with a number:<br>
<br>
# cat .gitignore<br>
-----------------------------------<br>
!.gitignore<br>
!*/<br>
!/Maildir/cur/[0-9]*<br>
!/Maildir/*/cur/[0-9]*<br>
-----------------------------------<br>
<br>
and it's working:<br>
<br>
# git add . --dry-run<br>
-----------------------------------<br>
add '.gitignore'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986418.M110302P17113.mail1,S=8066,W=8276:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986418.M134554P17113.mail1,S=8024,W=8234:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986418.M157569P17113.mail1,S=8005,W=8215:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986418.M180965P17113.mail1,S=8021,W=8231:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986418.M205518P17113.mail1,S=8017,W=8227:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986418.M355896P17113.mail1,S=8042,W=8252:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986418.M52133P17113.mail1,S=8053,W=8263:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986418.M555847P17113.mail1,S=8029,W=8239:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986418.M581502P17113.mail1,S=8047,W=8257:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986418.M606379P17113.mail1,S=8044,W=8254:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986418.M628850P17113.mail1,S=8036,W=8246:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986418.M657431P17113.mail1,S=8069,W=8279:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986418.M681265P17113.mail1,S=8039,W=8249:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986418.M706585P17113.mail1,S=8073,W=8283:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986418.M730046P17113.mail1,S=8059,W=8269:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986418.M753487P17113.mail1,S=8034,W=8244:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986418.M776202P17113.mail1,S=8019,W=8229:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986418.M799238P17113.mail1,S=8085,W=8295:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986418.M822106P17113.mail1,S=8081,W=8291:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986418.M844397P17113.mail1,S=8102,W=8312:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986418.M867952P17113.mail1,S=7964,W=8174:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986418.M889882P17113.mail1,S=7992,W=8202:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986418.M912429P17113.mail1,S=8005,W=8215:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986418.M935326P17113.mail1,S=8027,W=8237:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986418.M959570P17113.mail1,S=8037,W=8247:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986418.M987388P17113.mail1,S=8018,W=8228:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986419.M112704P17113.mail1,S=8044,W=8254:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986419.M13262P17113.mail1,S=8025,W=8235:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986419.M321294P17113.mail1,S=8012,W=8222:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986419.M347297P17113.mail1,S=8014,W=8224:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986419.M36960P17113.mail1,S=8037,W=8247:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986419.M371029P17113.mail1,S=8005,W=8215:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986419.M395270P17113.mail1,S=8024,W=8234:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986419.M418277P17113.mail1,S=8046,W=8256:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986419.M441021P17113.mail1,S=8047,W=8257:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986419.M466329P17113.mail1,S=8025,W=8235:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986419.M491134P17113.mail1,S=8038,W=8248:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986419.M515650P17113.mail1,S=8046,W=8256:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986419.M539950P17113.mail1,S=8017,W=8227:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986419.M563073P17113.mail1,S=7983,W=8193:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986419.M587009P17113.mail1,S=7963,W=8173:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986419.M611652P17113.mail1,S=7994,W=8204:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986419.M65180P17113.mail1,S=8015,W=8225:2,S'<br>
add 'Maildir/.INBOX.years.2020.family/cur/1601986419.M90376P17113.mail1,S=8036,W=8246:2,S'<br>
-----------------------------------<br>
<br>
Would you be so kind and confirm that this is all I need to archive and that Dovecot will/can re-create all files ignored by git?<br>
<br>
For example based on my research the following files / directories would be ignored:<br>
- new/ (empty dir)<br>
- tmp/ (empty dir)<br>
- maildirfolder/ (dir with maildirfolder file)<br>
- dovecot-uidlist<br>
- dovecot-uidvalidity<br>
- dovecot-uidvalidity.5f7c4f24<br>
- dovecot.index<br>
- dovecot.index.cache<br>
- dovecot.index.log<br>
- dovecot.index.log.2<br>
- dovecot.list.index<br>
- dovecot.list.index.log<br>
- dovecot.list.index.log.2<br>
- dovecot.mailbox.log<br>
<br>
<br>
In case of my test:<br>
# git status --ignored<br>
-----------------------------------<br>
On branch master<br>
<br>
No commits yet<br>
<br>
Untracked files:<br>
(use "git add <file>..." to include in what will be committed)<br>
<br>
.gitignore<br>
Maildir/<br>
<br>
Ignored files:<br>
(use "git add -f <file>..." to include in what will be committed)<br>
<br>
Maildir/.INBOX.years.2020.family/dovecot-uidlist<br>
Maildir/.INBOX.years.2020.family/dovecot.index<br>
Maildir/.INBOX.years.2020.family/dovecot.index.cache<br>
Maildir/.INBOX.years.2020.family/dovecot.index.log<br>
Maildir/.INBOX.years.2020.family/dovecot.index.log.2<br>
Maildir/.INBOX.years.2020.family/maildirfolder<br>
Maildir/dovecot-uidlist<br>
Maildir/dovecot-uidvalidity<br>
Maildir/dovecot-uidvalidity.5f7c4f24<br>
Maildir/dovecot.index.log<br>
Maildir/dovecot.list.index<br>
Maildir/dovecot.list.index.log<br>
Maildir/dovecot.list.index.log.2<br>
Maildir/dovecot.mailbox.log<br>
Maildir/subscriptions<br>
<br>
nothing added to commit but untracked files present (use "git add" to track)<br>
-----------------------------------<br>
<br>
Thank you.<br>
<br>
Adam<br>
</blockquote></div>