sexta-feira, fevereiro 29, 2008

Using Mutt with Gmail

Gmail is the best e-mail service and Firefox is the best browser. But if you keep Gmail's page open for a long time then Firefox will waste a lot of memory of your computer.

If you have an old machine like me, you know that each byte is important. So, I decided to come back to my old mail client: Mutt (http://www.mutt.org/).

Here I'm showing some steps you need to let mutt access Gmail with IMAP protocol.

I'm using Ubuntu 7.04 with mutt 1.5.13, but it should work with other distros.

You must replace my_mail@gmail.com and my_password occurrences with real values.

  1. First of all you must enable IMAP access to your Gmail account. To enable IMAP in your Gmail account:
    1.1. Log in to your Gmail account.
    1.2. Click Settings at the top of any Gmail page.
    1.3. Click Forwarding and POP/IMAP.
    1.4. Select Enable IMAP.

  2. Install mutt, msmtp and ssl. I won't show you how to do it because it is different for each distro.

  3. Create msmtp configuration file (~/.msmtprc) as shown:

    account default
    host smtp.gmail.com
    port 587
    from my_mail@gmail.com
    tls on
    tls_starttls on
    auth on
    user my_mail@gmail.com
    password my_password
    logfile ~/.msmtp.log

  4. Create mutt configuration file (~/.muttrc) as shown:

    set imap_user = "my_mail@gmail.com"
    set imap_pass = "my_password"

    set from = "my_mail@gmail.com"
    set realname = "Your Real Name"

    set folder = "imaps://imap.gmail.com:993"
    set spoolfile = imaps://imap.gmail.com:993/INBOX
    set record=""
    set postponed="imaps://imap.gmail.com/[Gmail]/Drafts"

    set header_cache="~/.mutt/cache/headers"
    set message_cachedir="~/.mutt/cache/bodies"
    set certificate_file=~/.mutt/certificates
    set move = no
    set imap_check_subscribed="yes"
    set imap_list_subscribed="yes"
    set mbox="imaps://imap.gmail.com/[Gmail]/All Mail"
    # this line instructs mutt to refresh my IMAP mailbox every 60 seconds
    set mail_check=60
    #I'm using ^ character to instruct mutt to update e-mail list immediately
    bind index "^" imap-fetch-mail

And that's all folks.

Nenhum comentário: