Lumail - An Email Client for Your Linux System

Using Email is our daily routine task and the most important method out there of sharing information with each other. The way we access emails has changed from the tradition and now there are a lot of Email clients available that are used to view and manage emails. It enables you to manage your inbox with sending, receiving and organizing messages simply from a desktop or a mobile phone. Nowadays Email clients are the powerful components of information management utilities other than just utilities for sending and receiving messages only. In this article, we are going to use and awesome email client which is Lumail that allows you to manage your email messages using your Linux terminal. More than all its free and its code is released under the GNU General Public License, version 2 or later. It runs entirely in your terminal windows with a text-based user-interface with highly customizable with keybindings and macros support and regular expression support for searching emails. This email client differs from other more established clients in its uniqueness and has a real embedded language for scripting, Lua. At the moment this client has reached the point where it is complete enough to be used exclusively.

Prerequisites

The basic requirement for Lumail client setup is that you have to login on your Linux system whether its REHL/CentOS or Debian with 'sudo' privileged user or with root user and run the necessary security updated and missing patches. Here in this article, we will be using CentOS 7 as a base operating system to perform Lumail installation setup.

After successfully login, run the command below for system update.

# yum update -y

Installing Dependencies

Lumail installation depends upon some necessary dependent packages, that must be installed on your system before you go with its installation.

Lumail is deliberately designed to only depend upon a small number of libraries, to ensure that it is possible to build it upon the widest range of systems. Following are the dependencies that we need to install first.

Lua 5.2

The scripting language.

magic

This library identifies the MIME-type of files/binaries via "magic" codes.

ncursesw

The console-graphics library (wide-version).

gmime-2.6

The MIME-library.

pcrecpp

The C++ wrapper around PCRE

Run the command below on your Debian/Ubuntu server to install these required dependencies.

# apt-get install build-essential make pkg-config
# apt-get install liblua5.2-dev libgmime-2.6-dev libncursesw5-dev libpcre3-dev libmagic-dev

lumail dependencies

Press 'Y' to continue installing its required packages and move to the next step to download the Lumail source package.

How to build Lumail from source

The source package of Lumail is available on github as well as its Official Web Page To Download. You can copy the source link and use below 'wget' command to download the package.

# wget https://lumail.org/download/lumail-2.9.tar.gz

After downloading, extract the archive and change directory to the extracted folder and run the 'make' command to compile and build the client.

# tar -zxf lumail-2.9.tar.gz
# cd lumail-2.9/
# make

Once the compilation process completes you'll find the executable './lumail2' generated binary that includes a simple test suite to validate the internal implementation using below command.

# ./lumail2 --test
..............................

OK (30 tests)

Now by running 'make install' will install the binary and the perl-utilities required for IMAP-operation. you can also do this manually by copying the contents of 'lib/' to '/etc/lumail2/lib' directory and 'perl.d' to '/etc/lumail2/perl.d' directory.

# mkdir ~/.lumail2/
# cp lumail2.user.lua ~/.lumail2/lumail2.lua

Now, move to the next step to create your own personal configuration file.

How to configure Lumail client

Open the default configuration file to ensure you set at least the following configuration parameters.

# vim ~/.lumail2/lumail2.lua
-- Set the location of your Maildir folders, and your sent-folder
 Config:set( "maildir.prefix", os.getenv( "HOME" ) .. "/Maildir/" );
 Config:set( "global.sent-mail", os.getenv( "HOME" ) .. "/Maildir/sent/" )

 -- Set your outgoing mail-handler, and email-address:
 Config:set( "global.mailer", "/usr/lib/sendmail -t" )
 Config:set( "global.sender", "Some User " )

 -- Set your preferred editor
 Config:set( "global.editor", "vim  +/^$ ++1 '+set tw=72'" )

There are many other options are possible, like if you wish to use encryption or if you wish to use IMAP then you need some more options to be configured.

How to use Lumail client

Lumail is a model client, which contains a number of distinct modes. By default, you will be in the maildir-mode, and you can navigate with j/k, and select items with ENTER.

You use the following bindings to start using Lumail on your command line terminal.

TAB
It toggle the display of the status-panel. The panel displays brief messages when "things" happen.
P - Toggle the size of the panel. ctrl-p enters you into a mode where you can view/scroll through past messages.
H - Shows the keybindings which are configured.
M - See your list of folders.
q - Always takes you out of the current mode and into the previous one. Stopping at the folder-list (maildir-mode).
Q - Exit.

You will be directed to the maildir-mode where the inverse-line represents the currently selected folder, which could be opened by pressing return.
There is an index mode with a default view of a folder, with no changes. If there is any unread email, you will see some selected line in red, which can also be indicated by the N flag.

In the last, there would a message mode, as shown below command demonstrate the display of a single message, including the default highlighting.
You will the following message format in the message mode after running the command below to start the status panel.

# ./lumail2
To: [email protected]
From: Some User 
Subject: this is a test mail
Message-ID: 
Date: Thu, 06 Apr 2017 13:30:52 -0400

It demonstrates the correct display of UTF8 characters, that makes a good sample message. You can use your own personal color preferences for its look and feel after modifying its configuration file.

Conclusion

That's it, we successfully installed and configured the Lumail client on our Ubuntu 16.04 server. It allows a client to be configured in interesting ways that demand some kind of "scripting", or the ability to set values/options conditionally in the configuration file. Some clients allow this to be achieved using their own home-grown configuration language, with perhaps a few conditional operators. Rather than inventing a simple language, spending the time required, it seems so much more natural to pick an existing implementation which is small, easy to learn, and well-documented. That's why most people prefer to use Lua for managing their emails and communicate with others.

About Kashif Siddique

Linux Systems and Security Engineer in Information and Communication Technology. Results-driven ICT Professional and Open Source Geek with technical specialties in the area of Open Source Operating systems and Applications.

Author Archive Page

Have anything to say?

Your email address will not be published. Required fields are marked *

All comments are subject to moderation.