Using GMVault to back up Google Apps email to my Synology DS214 has been great, when it works. And it seems like it fails pretty often: software update, token expiration, strong gust of wind, etc.
My original article from April 2014 turned into a bit of a mess, but after a few reinstalls and helpful comments (thanks David and Simon) I’ve got a much shorter set of instructions:
- Install the Python (2.7) package from the Synology package manager.
 - SSH into the Synology box as root.
 Download and install pip:
wget https://bootstrap.pypa.io/get-pip.pypython get-pip.pyUse pip to install virtualenv:
<pre><code>pip install virtualenv</code></pre>- Log in as your normal user, and 
cdto wherever you want to install GMVault. Set up a virtual environment for GMVault to run in:
<pre><code>virtualenv gmvault_env</code></pre>- Install GMVault in this little environment: <pre><code>cd gmvault_env/bin./pip install --verbose --pre gmvault --allow-external IMAPClient</code></pre>
 
Now you can run ./gmvault from this directory, or put together scripts that reference it by full path.
If you’re like me and your backups frequently see IMAP timeouts, don’t forget to cd ~/.gmvault and edit gmvault_defaults.conf so that enable_imap_compression=False.