Find Me On

My Homepage

Google+

Twitter

Newsvine

Email

RSS Feeds

My Stuff

Shared Items

Search This Blog

Archives

Josh Braun’s Blog // I have it written down somewhere . . .

Setting Up a VM Mail Client in Emacs Jun 22, 2011

Here’s another Emacs setup guide, this time for checking your email within Emacs using a mail client mode called View Mail, or ‘vm’.  Like the Emacs-w3m Web browser I went over earlier, this one is easy to use, but can be a bit tricky to set up.  Here are step-by-step instructions for getting it working; advanced users can skip the mundane stuff and grab the things they need.  I’m also going to cut and paste a bit from my previous tutorial on installing Emacs-w3m where steps are redundant.  As usual, this worked for me, but there’s no warranty here, express or implied.

The System

Everyone hates outdated instructions, so I’m going to include the version numbers I’m working with.  This guide is for a standard installation of Ubuntu 11.04 Natty Narwhal running Emacs v23.  If you’re reading this two years from the date it was written, your mileage may vary.  The same is true if you’re using a non-standard Ubuntu installation, a different *buntu, or a different Linux distro altogether. Mac users can also follow along at home, but if you’re trying this on a Mac you’ll need to translate a little, and you’ll probably have to resort to Fink or similar to get ahold of the necessary packages.

Step One: Install Some Preliminary Packages

First off, open your Terminal application, as almost everything here is going to be done from the command line.  Before attempting to install the software, you’ll need to make sure that you’ve got the ‘stunnel4′ package installed on your machine, which enables vm to sign into secure mail servers.  If you’ve been using your Ubuntu install for awhile, it may already have been installed for another purpose or as part of another program programs.  So we’ll start by checking to see if it’s already there.

% dpkg -l 'stunnel4'

If the package is missing, you’ll get a message reading ‘No packages found matching stunnel4.’ Otherwise, the system will return something more verbose, which means that the package is already installed.  If you need to install it, run the following command:

% sudo apt-get install stunnel4

After this, you’re ready to proceed.

Step Two: Install View Mail

To download vm, direct your browser to https://launchpad.net/vm and select a stable version of the source code to download.  As I write this, the most recent stable version is vm-8.2.0a, but it appears to have some nasty bug reports (e.g., ‘Bug #797300: Mailbox size doubles each time it’s saved‘) [See comment from Uday Reddy on this issue].  So I’m going to go with version 8.1.93a (download page | direct download link), which I happen to know is well behaved.  The directions I’m going to give are for compiling from source, so if you’re following along step by step—whichever version you choose—download the file without the trailing characters, ‘gnu23′.

Once you’ve downloaded the compressed file, move it to your home directory.  Then go to your home directory in Terminal and uncompress the file there:

% cd ~
% tar -xvf vm-8.1.93a.tgz

Remember in the above instruction, and all that follow, to replace ’8.1.93′ with whatever the version number of the file you downloaded is.  Now, go to the newly created vm-8.1.93a directory:

% cd vm-8.1.93a

Then run the following two commands to install vm:

% ./configure
% sudo make

That’s it.  You don’t need to run an ‘install’ command.  Next you’ll need to configure vm to work with your email account(s).

Step Three: Creating a .vm File

Create a file titled ‘.vm’ in your home directory and populate it with the following.  View Mail will look for it to find your login info.  I’m going to assume you’re using an IMAP connection.  There are instructions elsewhere for configuring other sorts of accounts.

(setq vm-primary-inbox "imap-ssl:yourmailserver.com:993:Inbox:login:yourusername:*")
(setq vm-crash-box "~/email/inbox.crash.mbox")

Obviously you should replace ‘yourmailserver.com’ and ’yourusername’ with your real mail server and username.  Note that if your inbox is called something other than ‘Inbox’, you’ll also need to change that part of the string above to reflect the mailbox you want to check.  The asterisk at the end of the login string, in case you’re wondering, causes vm to prompt you for your password the first time you log in after opening Emacs.

Step Four: Changes to Your .emacs File

Finally, add the following lines to your .emacs file to inform Emacs of all the stuff you just installed.  If your vm directory has a different version number or no version number, remember to make the appropriate changes.

(add-to-list 'load-path
(expand-file-name "~/vm-8.1.93a/lisp"))
(add-to-list 'Info-default-directory-list
(expand-file-name "~/vm-8.1.93a/info"))
(require 'vm-autoloads)
(setq vm-stunnel-program "/usr/bin/X11/stunnel4")

A note to Mac users: Using Fink or similar, you can install a package called ‘stunnel’ on your Mac in place of ‘stunnel4′; if you’ve done this, use the following line in place of the final line of the above block:

(setq vm-stunnel-program "/sw/sbin/stunnel")

//end of note to Mac users

Finally, if you have the Emacs-w3m browser installed, adding the following line to the .emacs file will tell View Mail to use the browser to help render HTML emails, which is a nice touch.

(setq vm-mime-text/html-handler 'emacs-w3m)

That’s it!  Enjoy your Emacs mail client.  Here’s a handy in-depth manual for learning your way around vm.  Note that the configuration I’ve provided here only allows you to receive mail.  Some further setup is required to send mail.

This entry was posted in Technology and tagged , , , , . Bookmark the permalink.
  • http://wideaperture.net/blog/ Josh Braun

    Some Notes for Solaris Users

    I’ve been tinkering with an install of OpenIndiana, a FLOSS descendant of the OpenSolaris project.  I thought I’d leave some notes as to how to configure this on an OpenIndiana/OpenSolaris system.  I was using the official OpenIndiana development repository.

    Basically, everything’s the same except the stunnel package.  Rather than ‘stunnel4′, the relevant package in OpenIndiana was simply ‘stunnel’.  You can install it using OpenIndiana’s nice GUI IPS package manager, or from the command line if you’re comfortable with IPS-related commands.

    ‘stunnel’ will also reside in a different place on your file system under OpenIndiana than under Ubuntu or OS X, so after you’re done with the rest of the install, enter the following line in your .emacs file instead of the corresponding one in the instructions above:

    (setq vm-stunnel-program "/usr/bin/stunnel")

  • Uday Reddy

    Actually, I think the version 8.2.0a has been fine.  There were over 400 downloads from Launchpad and there were no significant issues with it.  The issue mentioned in this blog (about the doubling of mail folder size) was only noticed with a beta version of XEmacs, and there were no further instances of it.  A new version 8.2.0b (beta testing release) is soon to be released.

    Uday Reddy

    • http://wideaperture.net/blog/ Josh Braun

      This is really good to know, thanks!  I may go ahead and upgrade, then.  I’ll also add a link to your comment in the post.

  • Louis Vuitton Handbags

    In the occasion when black-tie affair plus shirt suit attire takes place, a slightly additional sophisticated luxury watchLouis Vuitton Sunglasses requirements to be match along. Louis Vuitton Regardless of man’s age, StoreMichael Kors mens watches present both classically refined and vintage inspired. Despite searching opulent, Michael Kors stretch and play with their color hues from black pave crystals adorning round bezel to white ceramic bezel embellish with numeric engraving. Louis Vuitton SaleBe positive to check out Michael Kors Blackout Glitz Watch ornaments with black pave crystals along round bezel.Louis Vuitton Outlet This watch is going to be so eye catchy that a girl wouldn’t want to miss gazing at you,or perhaps your brand new Michael Kors watch? You’ll be the judge!