Imapbox
I have an inbox included in my domain but at 1 GB it is a rather small one. I always knew that I will have to come up with a solution to effectively archive old emails to keep them but I did not want to run my own email server. At least not yet..
I have an inbox included in my domain but at 1 GB it is a rather small one. I always knew that I will have to come up with a solution to effectively archive old emails to keep them but I did not want to run my own email server. At least not yet..
I thought that I will run just something like IMAP server, which will keep my messages as I would still use 3rd party SMTP server. That way I would not have to keep an eye on the reputation of the IP, if it is even possible to run full blown email server on my residential IP. Unfortunately I did not find such a solution. There are many email servers and most of them are very easy and straightforward to setup, but I don't feel like doing it.
That is where Imapbox comes in. It is a service that can download messages and save them in HTML, PDF, TXT and ZIP/EML formats. Also accompanies these with json which contains metadata for search engines, like Elasticsearch.
Container setup
Following docker run command worked for me:
docker run
-d
--name='imapbox'
--net='bridge'
-e TZ="Europe/Budapest"
-e HOST_OS="Unraid"
-e HOST_HOSTNAME="ClearSky"
-e HOST_CONTAINERNAME="imapbox"
-l net.unraid.docker.managed=dockerman
-l net.unraid.docker.icon='https://github.com/polo2ro/imapbox/raw/master/logo.png'
-v '/mnt/user/email/viktor-at-example-dot-cz/mail/':'/var/imapbox':'rw'
-v '/mnt/user/email/viktor-at-example-dot-cz/config/':'/etc/imapbox/':'ro'
-v '/mnt/user/email/wkhtmltopdf/wkhtmltopdf':'/opt/bin/wkhtmltopdf':'ro' 'mauricemueller/imapbox' Imapbox's author polo2ro points to repository mauricemueller/imapboax which is not the only one on Docker Hub. The docker is run as root, which is not the best solution so keep that in mind.
Following config.cfg accompanies my container:
[imapbox]
local_folder=/var/imapbox
days=365
wkhtmltopdf=/opt/bin/wkhtmltopdf
[account1]
host=imap.example.com
[email protected]
password=mysecretpassword
remote_folder=INBOX,"INBOX.Sent Items",INBOX.Archive
port=993
ssl=TrueMore details on the config, can be found on Imapbox GitHub page. There is nothing re
Running the container
Out of the box the pdf generation was not working. Even though the dockerfile contains line where it should download wkhtmltopdf it just was not working. There was also an error in the logs, that was pointing to some permissions error
MailboxClient.saveEmail() failed: Permission denied
The container is running on Debian Buster so the solution was to download the Buster package from wkhtmltopdf download section. Unzip the deb package and go to wkhtmltox_0.12.6-1.buster_amd64\data\usr\local\bin where the binary resides. We are only interested in the wkhtmltopdf. I copied that one to /mnt/user/email/wkhtmltopdf/ and changed its permissions to 0744.
Imapbox did not run for me with Gmail. I was not able to generate single app password as my account was not eligible for that. I am using different mail service anyway. But YMMW..
Noticed that empty messages also generate error. So don't worry if you occasionally see this one in the logs
MailboxClient.saveEmail() failed: None
Container use
The container can download messages from multiple inboxes at once, so that is something you can do. There is a bit of an issue with the resulting folder structure - see the Github issue below. I am personally using it for archiving my email, so I would probably run separate container for each user if necessary. Also would be nice to have separate backups for each user.
In case that __ALL__ as a remote folder does not work, like with email.seznam.cz, there is still a chance to download all mail from your account. Imapbox does support multiple remote folders, it is just not obvious. You just use comma separated list of remote folders, that you are interested in (more info Imapbox/issue #42).
Para escoger cómo elegir una camiseta de mujer para uso diario, es práctico verificar la combinación entre libertad de movimiento y estilo. La decisión queda mejor respaldada al comprobar la composición del tejido y el acabado de las costuras.
You can also go one level higher with this and run a container for every single remote folder, but that might take to much resources. Although imapbox is not that demanding, so you should be fine.