Backup and copy mail-in-a-box backup files to stack using rsync to a local webdav mount.
I wanted to use my free TransIP Stack as a backup target for my MIAB.
The TransIP Stack service has a free 1TB of cloud storage plan and is based on Owncloud.
It currently is invite only for the free plan, but if you enter your e-mail at https://www.transip.nl/stack/, you’ll generally receive an invite quite quickly. Furthermore, the invite page is currently in Dutch only, but all you have to do is enter your mail address and hit “inschrijven”.
TransIP also offers a 2TB plan for 10 euros per month or 10 TB for 50 euros per month. It than also supports backups so you never lose data when by mistake deleting files. I do not need this, so I went with the free plan.
Your data will be hosted in the Netherlands and TransIP promises to not analyse your data. There is no maximum file size.
Unfortunately, the MIAB web interface does not support using WebDAV, it currently only supports Rsync and Amazon S3, even though duplicity does seem to support backing up to a WebDAV target. I did not want to mess with the code of my MIAB, therefore I created the following workaround.
Stack
- Create separate user / password combination to be used by mail-in-a-box
Setup system
Install Ubuntu 14.04
Install mailinabox using the instructions or video on https://mailinabox.email
Install davfs2
Login to the system
sudo apt-get install davfs2
usermod -aG davfs2 yourusername
logout & login
dpkg-reconfigure davfs2
- allow non-root users to mount davfs2 volumes. -> yes
Create mount point
Create save credentials storage folder and add credentials
mkdir ~/.davfs2
sudo cp /etc/davfs2/secrets ~/.davfs2/secrets
sudo chown yourusername:yourusername ~/.davfs2/secrets
sudo chmod 600 ~/.davfs2/secrets
nano ~/.davfs2/secrets
- add:
https://yourstackname.stackstorage.com/remote.php/webdav/ username password
Add mount point to fstab
- add:
- logout & login
Perform initial mount and mount after reboot and network services are up.
mount ~/stack
crontab -e
- add:
@reboot sleep 60 && mount ~/stack
Create backup folder if not existing
Configure Mail-in-a-box
- Go to System -> Backup status
Enter the following settings:
- Backup to: rsync
- Hostname: localhost
- Path: /home/yourusername/stack/backups/
- Username: yourusername
- Click “Save”
Make sure Mail-in-a-box can authenticate:
- Copy the public SSH key
- Paste key underneath existing content
Create initial backup
cd mailinabox sudo management/backup.py
Save backup key
Copy
to secure offline location to enable decryption of backups on other machines. Put Stack credentials in the same folder as well.
Do this by opening it:
Copy all contents and paste it in a local notepad text editor like Notepad++ on your computer and save the file.
Be sure to make an exact copy, including enters at the end of the file, otherwise the key might not work.