In this text I'd like to introduce you to IMAP system.

Most of us fetch email using POP3 servers. It's fast, it's supported by all mail clients and it Just Works. But the POP3 protocol has some drawbacks:

  • When you fetch a message, it's gone from the server for good.
  • If you set the option to keep email on the server, it's not managed properly. The mail builds up, using space and bandwidth.
  • Your account doesn't "feel" mobile. The server doesn't keep track of what you have read.

Email is one of the most important tools. We use it everyday. I have two accounts, one for work and one for my private stuff. When I'm at work, I'd like to take a peak on Ubuntu mailing lists, but when I'm at home, I need to know if something didn't fall apart when I was away. That's why I'm using IMAP.

How does it work?

The client authorizes with the IMAP server and fetches new headers, but it doesn't necessarily fetch email bodies. The folder structure is also fetched. Folders created on an IMAP account are stored on the server and retrieved when you connect. When you choose a message to read, it is downloaded from server and cached. As with web browsing, it doesn't have to be fetched again over the network. The message is marked on the server as read, but it's kept there. You can use filter rules to sort messages into folders on the server, the same way you use folders on the client when using POP3. When you log into into this same IMAP account from another computer, everything is still there: folders, messages and read/unread state. I can read some messages at work, reply to them, and when I get home, everything is still there, and I can dig through the ubuntu-users mailing list.

Summary: ''Why IMAP Rules''

  • Your account is mobile.
  • No reason to keep all your data on all your computers.
  • If you're using a slow or expensive dial-up or mobile connection, fetching headers is a better way to handle your mailbox.
  • No mess. Smile :-)

How to set up an IMAP server and clients

This may seem simple to some but here is a quick description of how to get an IMAP server set up and a couple of email clients to talk to your IMAP server. This is a minimal configuration there are lots of options you can set and you should read the respective manuals to get all the details. The basic need that I had was to have a graphical email client (for local access) and a text email client (for remote access). So I set up dovecat (IMAP server), evolution (graphical IMAP client) and mutt (text IMAP client).

Note: The first time the clients run they will ask you to accept a certificate - please examine it to ensure that the values are as you expect and if so accept it (select the always option). I have given references below to the location of the instructions which I used to install/configure the software.

1. dovecot - (dead simple)

  • For detailed instructions see Dovecot

2. evolution - (look at http://www.novell.com/documentation/nld/index.html?page=/documentation/nld/evolution/data/usage-mainwindow-starting.html for generic instructions)

  • Email Address: type in your email address you want to use
  • Receiving Options:
    • Server Type: select IMAP as the server type
    • Host: type in your host e.g. localhost
    • Username: type in your username (this is the id for the server would use for authentication)
    • SSL: select Whenever Possible
    • Authentication Type: Password
  • Sending Mail:
    • Server Type: SMTP
    • Host: type in your host e.g. localhost
  • Test by sending and email to yourself or from another account

3. mutt - (look at http://mutt.sourceforge.net/imap/ for fairly easy generic instructions)

  • Receiving Mail:
    • Using your favorite text editor open ~/.muttrc

    • type in following:

      # sets the location for your mailbox - the INBOX setting should work on most imap servers
      set spoolfile=imap://<your host name>/INBOX
      
      # Specifies  the  default  location  of your mailboxes.
      set folder=imap://<your host name>/
      
      #  Your login name on the IMAP server. 
      # Put in a value here to avoid typing in your username each time you start mutt
      set imap_user=<username on server>
      
      # Specifies the password for your IMAP account.  
      # Warning: you should only use this option when you are on a fairly secure machine
      set imap_pass=xyz
      
      # Set this to no to avoid mutt asking you whether you want to move your mail to the local mbox 
      set move=no
      
      # If you have more than one mailbox then. 
      # This is how long mutt will wait between scanning for incoming mail
      set mail_check=60
      
      # Mutt will only scan curently open mailbox for new mail every 10 minutes by default. Set to 15 seconds 
      set timeout=15
  • Sending Email:
    • If you have Mail working on your system no additional configuration is needed
  • Testing:
    • Send an email to yourself you should see it in the mutt inbox after 15 seconds . You can also check your evolution inbox where you will see the same email.

WhyIMAP (last edited 2009-04-30 21:37:43 by adsl190-027000006)