Tuesday, March 3, 2015

Mutt - email from the command line

Since I started using linux on my work machine I have been looking for good CLi alternatives to things I need on a daily basis. I was given a work laptop and I run my Xubuntu install off of a VM on my Windows 7 machine. What that translates to is that I'm constantly running low on RAM and CPU, therefore anything I can do from the CLi makes my computer happier. For this reason I decided to try to add my email to something I can check off of the command line. It would save me a solid 200-250 Mb of memory that I don't need to be spending on an email client that mostly just pops up incoming msgs all day. So after looking around, it seems like Mutt is the popular choice for people checking their email on the CLi.

To be perfectly honest, I really only need my client to check my mail on occasion, and if I need to respond to an email, I don't even mind opening Thunderbird then, but I just don't like keeping it open all day. But here is what you do to get Mutt running on your debian based distro:

$ sudo apt-get install mutt

this will install mutt on your distro... from there I got a Postfix Configuration screen. There you should find some details about the different types of configurations available (Internet site, Internet with SMTP, etc). For my purposes I just skipped this part and left with no changes to configuration, I will deal with that post install.

To access the configuration file for mutt use your favorite text editor (such as vim, nano, etc) and open ~/.muttrc so for me I will run

$ sudo nano ~/.muttrc

there you can add the following information for your particular email

set imap_user = “usernam@gmail.com”
set imap_pass = “passwrd”

set smtp_url = “smtp://usernam@smtp.gmail.com:587/”
set smtp_pass = “passwrd”
set from = “usernam@gmail.com”
set realname = “My name”

set folder = “imaps://imap.gmail.com:993”
set spoolfile = “+INBOX”
set postponed=”+[Gmail]/Drafts”

set header_cache=~/.mutt/cache/headers
set message_cachedir=~/.mutt/cache/bodies
set certificate_file=~/.mutt/certificates

set move = no

I probably don't need to tsay it, but change it to the information relevant to your email account of course. Leave the password fields blank if you prefer, and that will cause mutt to prompt you for it which may be a bit of a safer option.

From here you will need to run the program by typing

$ mutt

From your inbox use your

up/down arrow keys - move through your inbox
PgUp/PgDwn - move quickly through your inbox
Enter - opens the msg

Once you open a msg use

space - scroll down the msg
'-' (minus) - scroll up the msg (unfortunately you don't use up/down for this)
i - returns to inbox (seems like q works as well, which seems more natural to me)

For more information on how to use Mutt, this post was very useful to me:

http://www.linuxuser.co.uk/tutorials/get-started-with-mutt/1

No comments:

Post a Comment