mutt AND Gmail AND imaps - easy new setup
mutt meets the cloud
mutt is a pretty decent terminal based mail-client. It reliably runs on almost every platform, is RFC conform by default, lightweight, fast, extremely versatile and sweet as leet. In order to take advantage of all the kewl features of Gmail many people use heavyweight mail-clients like Mail.app (>300 MB), Outlook (infinite waste of space and time), or Thunderbird (the compromise).
In the past mutt was just a MUA, but since ~ 1.5 there's a useable smtp, imap and pop3 backend. In the following I hacked mutt to sync with multiple Gmail imap accounts to use the great filters and infinite space - from a terminal. Just mutt and Gmail.
A config with account- and folder-hooks
In fact this article basically summed it up. I don't repeat it, but I added some more fun.
account-hook imaps://someone@imap.gmail.com 'set imap_user=someone@gmail.com imap_pass="password1" folder = "imaps://someone@imap.gmail.com" spoolfile = "+INBOX" postponed="+[Gmail]/Drafts"'
Where the account hooks are described there's to consider, that you have to put the credentials and stuff into one line.
First of all you add the account data in some kind of struct to have them listed in the specific account-hooks. then you set a folder, a mailbox for each folder, and unset imap_passive. His macro to mark spam is an example for good interacting with Gmail from mutt. Surely I use that, too ;).
But you can do more
set hdrs set edit_headers ignore * unignore From: unignore To: unignore Message-ID: unignore Date: unignore X-Mailer: unignore X-OS: unignore X-Operating-System: unignore X-Knaller: unignore X-Virus: unignore User-Agent: unignore Subject: unignore X-Newsreader: # here you'd define the account- and folder-hooks # header config, for mutt smtpd my_hdr From: Marius <wishinet@gmail.com> # one standard account hdr_order Date From To Subject X-Mailer User-Agent Organization my_hdr XSearch: this helps me googling for your mails # you could add your PGP key here, too - makes sense at least
That's pretty funny: sometimes your replies end up forwarded. But giving a URL for the PGP key is more interesting of course.
So you can manage it
With the header_cache patch (hcache backend: tokyocabinet 1.4.23 - for the speeds):
# speeds up checking-in enormously set header_cache=~/.mutt/cache/headers set message_cachedir=~/.mutt/cache/bodies set certificate_file=~/.mutt/certificates # keep the box in the cloud set move = no
The sidebar-patch allows you to change the imap folders easily. All folders of all imap accs, whether gmail, your own imapd setup, or some pop3, show up there.
Furthermore of course Gmail's Anti-Spam and message-filtering backend work for you. You can configure that in Gmail and take full advantage of that in mutt.
While I refer to the cloud-based mail-service here: no, it's not priceless. But mutt has great crypto handlers.
So... this is no big deal. But the effect is great: Gmail's power meets a really sophisticated mail-client. I just like that mail-setup currently. Thunderbird needs ages to start.
Have fun,
wishi

Post new comment