Mutt + ProtonMail
Il y a maintenant plusieurs semaines que j’utilise ProtonMail. Bien que rassembler mes 7 adresses précédentes sur une seule m’a grandement simplifié la vie, je ne suis toujours pas satisfait des clients disponibles. Sous Linux, seul Thunderbird est actuellement disponible, à moins d’utiliser de webmail – ce que je fais pour l’instant.
Il y a quelques années, j’avais testé Mutt un peu comme un jeu. La raison pour laquelle j’avais arrêté de l’utiliser était justement le nombre d’adresse que je devais gérer : l’outil était certes intéressant, mais difficile à utiliser avec autant de compte.
Maintenant que j’ai résolu ce problème, j’avais envie de redonner une chance à ce client minimaliste et, par la même occasion, voir s’il était possible de faire cohabiter Mutt et ProtonMail.
Installation et premier lancement
Pour installer mutt, il suffit d’installer le paquet du même nom :
sudo apt install mutt
En lancant pour la première fois la commande mutt, je reçois une erreur :
/var/mail/cedric: Aucun fichier ou dossier de ce type (errno = 2)
Je crée le fichier en question et je lui donne les permissions nécessaire à mon utilisateur :
sudo mkdir -p /var/mail/$(whoami) sudo chown $(whoami):$(whoami) /var/mail/$(whoami)
J’en profite pour initialiser le fichier de configuration .muttrc
vim ~/.muttrc
set realname = "Your Name" set header_cache =~/.mutt/cache/headers set certificate_file =~/.mutt/certificates set message_cachedir =~/.mutt/cache/bodies
Lancer une nouvelle fois la commande mutt, ne donne plus d’erreur.

Premier écran du logiciel Mutt – un client mail en ligne de commande. Au moins, c’est épuré 
Configuration de mutt
Note : je pars du principe que le Bridge pour Linux est installé et lancé.
J’ajoute au fichier de configuration .muttrc les lignes suivantes:
# "+" substitutes for `folder` set mbox_type=Maildir set folder=/var/mail/cedric/ set spoolfile=+INBOX set record=+Sent set postponed=+Drafts set trash=+Trash set mail_check=2 # seconds # smtp source ~/docs/keys/mail set smtp_url=smtp://$my_user:$my_pass@127.0.0.1:1025 set ssl_force_tls set ssl_starttls
Et dans le fichier ~/docs/keys/mail:
set my_user=EMAIL set my_pass=MOT_DE_PASSE_DU_BRIDGE
Installation et configuration de OfflineIMAP
J’installe OfflineIMAP :
sudo pip install offlineimap
Puis je crée un fichier de configuration .offlineimaprc :
[general] accounts = main [Account main] localrepository = main-local remoterepository = main-remote # full refresh, in min autorefresh = 0.2 # quick refreshs between each full refresh quick = 10 # update notmuch index after sync postsynchook = notmuch new[Repository main-local] type = Maildir localfolders = /var/mail/cedric # delete remote mails that were deleted locally sync_deletes = yes [Repository main-remote] type = IMAP remoteport = 1143 remotehost = 127.0.0.1 remoteuser = EMAIL remotepass = MOT_DE_PASSE_DU_BRIDGE keepalive = 60 holdconnectionopen = yes # delete local mails that were deleted on the remote server expunge = yes # sync only these folders folderfilter = lambda foldername: foldername in ['INBOX', 'Archive', 'Sent'] # is broken, but connecting locally to bridge so should be ok ssl = no
On lance la commande offlineimap, et, si tout s’est bien passé, on peut commencer à voir la progression de la synchronisation avec ProtonMail :
OfflineIMAP 7.2.1 Licensed under the GNU GPL v2 or any later version (with an OpenSSL exception) imaplib2 v2.57 (bundled), Python v2.7.14, OpenSSL 1.0.2g 1 Mar 2016 Account sync main: 3d-printed-mario-wallart-with-wooden-frame.html accelerer-lexecution-de-la-commande-bundle-et-linstallation-des-gems.html adguard-home-et-nginx-proxy-manager.html all_posts.html all_tags.html autoportrait---noah-4-ans.html bb.sh blog.css building-myself-a-framed-e-calendar.html cleanup-old-git-branches.html configurer-firefox-avec-miniflux.html desencombrer-mon-telephone.html dns-dynamique-dyndns-avec-gandi.html drafts du-yoga-avec-linkin-park.html feed.rss going-back-in-time-with-git.html hello-world.html how-to-install-solargraph-with-sublime-text-lsp.html i-built-a-teepee-bed-for-my-son.html i-built-steve-ramseys-wwmm-potting-bench-out-of-palet-wood.html i-made-a-bird-feeder-from-scraps.html i3wm---displaying-slack-incoming-call-floating-window-in-the-current-workspace.html images import.sh incoming_feed.rss index.html index.html.1 ive-built-a-mallet-woodworking-is-a-recursive-hobby--you-build-stuff-so-you-can-build-more-stuff.html jai-vraiment-voulu-aimer-le-fairphone.html letrange-noel-de-monsieur-jack---shadowbox-en-impression-3d.html ma-voiture-est-en-panne-mais-je-veux-bien-garder-la-voiture-de-remplacement.html ma-voiture-est-en-panne-mais-je-veux-bien-garder-la-voiture-de-remplacement.html.valid magibook-vtech-explor-park-under-linux-with-wine.html main.css migrating-photos-from-icloud--iphone-to-nextcloud---part-1.html mutt--protonmail.html new-wall--apptweak-hq.html passer-une-journee-en-suisse-amp-se-faire-depouiller-de-300eur-par-mobilevikingsbe-et-proximus.html qutebrowser-and-lastpass.html remise-en-etat-de-mon-game-boy-original remise-en-etat-de-mon-game-boy-original.html remove-git-branches-older-than-x-months.html remove-the-currently-opened-file-without-leaving-vim.html sauvegarde-automatique-de-yunohost-avec-borg.html something.html spotify-playlists-curated-by-music-subreddits.html tag_example.html tag_keep-this-tag-format.html tag_tags-are-optional.html til-about-the-ability-to-rollback-multiple-migrations-in-a-rails-project-at-once.html til-how-to-remove-every-consolelog-added-since-i-branched-out-of-master.html til-how-to-use-markdown-inside-a-custom-liquid-tag.html title-on-this-line.html ton-premier-jour-decole.html tridactyl-the-clipboard-and-the-urls.html triggering-a-command-line-on-file-change.html woodworking-vim-and-openscad.html Processing account main Establishing connection to 127.0.0.1:1143 (main-remote) Creating folder INBOX[main-local] Creating new Local Status db for main-local:INBOX Creating folder Archive[main-local] Creating new Local Status db for main-local:Archive Creating folder Sent[main-local] Creating new Local Status db for main-local:Sent Folder Archive [acc: main]: Syncing Archive: IMAP -> Maildir Folder INBOX [acc: main]: Syncing INBOX: IMAP -> Maildir Folder Archive [acc: main]: Copy message UID 1 (1/263) main-remote:Archive -> main-local:Archive Folder INBOX [acc: main]: Copy message UID 1 (1/49) main-remote:INBOX -> main-local:INBOX Folder Archive [acc: main]: Copy message UID 2 (2/263) main-remote:Archive -> main-local:Archive Folder INBOX [acc: main]: Copy message UID 2 (2/49) main-remote:INBOX -> main-local:INBOX
Il ne reste plus maintenant qu’à relancer la commande mutt pour visualiser ses mails.

L’interface de Mutt une fois la configuration terminée