configure emacs offlineimap and mu4e in debian for offline email

By | 22nd February 2015

This is work in progress configuration. Fetching mails is working fine. But need to check how to send mail. Ok lets get started.

A short intro. If you are looking to configure and read mail through terminal this is one of the ways to go. Most of them simply suggest mutt or gnus for emacs. But this is another method.

Install required packages and dependencies

apt-get install emacs offlineimap mu4e

Configuring offlineimap

First step is to fetch mail from the server. Edit the file ~/.offlineimaprc and add the following to the file.

[general]
accounts = Personal, Work
maxsyncaccounts = 3

If you are configuring only one account then remove others from accounts. You can give any name to your account.

Next step is to tell offlineimap were to get the mails from. Add the following to .offlineimaprc file.

[Account Personal]
localrepository = PersonalMailLocal
remoterepository = PersonalMailRemote
 
[Repository PersonalMailLocal]
type = Maildir
localfolders = ~/Maildir/Personal
 
[Repository PersonalMailRemote]
type = IMAP
remotehost = imap.gmail.com
remoteuser = email@gmail.com
remotepass = password
ssl = yes
sslcacertfile = /etc/ssl/certs/ca-certificates.crt
keepalive = 120
realdelete = yes
holdconnectionopen = true

Change the values of remotehost, remoteuser and remotepass to your email provider. If you are configuring multiple accounts then copy the above lines and change values accordingly. Make sure that what every we give in accounts should be give in [Account Personal] and what ever we give in localrepository = PersonalMailLocal should be give in [Repository PersonalMailLocal].

Create the required directories and run the command to fetch mail.

mkdir -p ~/Maildir/Work
mkdir -p ~/Maildir/Personal
cd /home/user
offlineimap

Sources:

http://0xax.blogspot.in/2014/11/emacs-mu4e-offlineimap-multiply-accounts.html

https://gist.github.com/areina/3879626