adding offline imap to the email stack

This commit is contained in:
JesseBot 2022-12-29 15:45:13 +00:00
parent 51b40f0781
commit de99a212df
4 changed files with 66 additions and 0 deletions

View file

@ -0,0 +1,39 @@
# Offlineimap configuration file for protonmail
#
# examples on linux: /home/linuxbrew/.linuxbrew/etc/offlineimap.conf.minimal
# /home/linuxbrew/.linuxbrew/etc/offlineimap.conf
[general]
accounts = protonmail
# this just runs a line of python to env vars below: from os import environ
pythonfile = ~/.config/offlineimap/offlineimap_account_setup.py
metadata = ~/.cache/offlineimap
[Account protonmail]
remoterepository = protonmail-remote
localrepository = protonmail-local
[Repository protonmail-local]
type = Maildir
localfolders = ~/.local/share/offlineimap
sync_deletes = no
[Repository protonmail-remote]
type = IMAP
# These are just environment variables, and won't work without the python file
remotehosteval = environ["MAIL_SERVER"]
remoteporteval = int(environ["MAIL_PORT"])
remoteusereval = environ["MAIL_USER"]
remotepasseval = environ["MAIL_PASS"]
# this part is important for protonmail
starttls = yes
ssl = no
ssl_version = tls1_2
sslcacertfile = ~/.config/protonmail/bridge/cert.pem
# I don't know what this does
expunge = yes
# --------- section for what folders and labels you pull ------------
nametrans = lambda foldername: re.sub ('^Folders.', '', foldername)
folderfilter = lambda foldername: foldername not in ['All Mail']

View file

@ -0,0 +1,2 @@
#!/usr/bin/env python3.11
from os import environ

View file

@ -0,0 +1 @@
this is just so the directory structure is created

View file

@ -400,6 +400,30 @@ These directories/files are installed to your home directory and follow the [XDG
</details>
<details>
<summary><code>offlineimap</code></summary>
<blockquote>
File: [`~/.config/offlineimap/config`](.config/offlineimap/config)
This is to sync your email from whereever, but it's default configured for
protonmail right now :) You will need to export the following env variables:
(if using protonmail bridge, these should be the credentials from there)
- `MAIL_SERVER` - normally 127.0.0.1 for protonmail
- `MAIL_USER` - normally youruser@protonmail.com for protonmail
- `MAIL_PASS` - normally generated from the protonmail bridge app
- `MAIL_PORT` - typically 1143 for protonmail
Currently we import ALL folders except the "All Mail" folder, which is just
all the mail from all the other folders (including inbox, sent, trash, etc)
</blockquote>
</details>
<details>
<summary><code>powerline</code></summary>