Elric's random thoughts in idle times

"Why stop now, when I'm just starting to hate it?" – Marvin the robot

mutt tips

leave a comment »

Mutt and abook

Abook is great in how it converts addressbooks in different formats. I found thunderbird->abook problems with csv, yet none with ldif. It also works fine outputting vcard, in a format compatible with gmail contacts.
I found abook to be the best in my hunt for a simple addressbook with the biggest compatibility with other apps and formats. Not perfect, though, and development seems stalled.
It’s easy to integrate it with Mutt. You only need to define the following in your configuration files.

set query_command= "abook --mutt-query '%s'"
macro index,pager A "abook --add-email" "add the sender address to abook"
macro generic,index,pager \ca "abook" "launch abook"

If you want your contacts to appear alphabetically, not by alias, add the following to your ~/.abook/abookrc file.

set sort_field=name

Mutt and Vim

The regular way to do this is to add in your muttrc
set editor="gvim -f -c +/^$"
placing the cursor at the first empty line. However, you can enhance its integration with Cedric’s Duval mail.vim file.

You can also have a look at the mail.vim file available in your $VIMRUNTIME, written by the very Bram Moolenaar!

Mutt and foldernames with spaces

If your gmail server sends you foldernames with spaces, you may have some issues. The solution for you mutt is to specify them in a regular mailboxes file for offlineimap, yet not source it in muttrc, making it available only for the aforementioned program.

Mutt will need those folders specified in the following manner in muttrc, particullary if you are using mutt-patched sidebar:

mailboxes =GMAIL/INBOX =GMAIL/[Google\ Mail].All\ Mail\
=GMAIL/[Google\ Mail].Bin =GMAIL/[Google\ Mail].Drafts =GMAIL/[Google\ Mail].Sent\ Mail\
=GMAIL/[Google\ Mail].Spam =GMAIL/[Google\ Mail].Starred

If you set them in such manner in your mailboxes file, offlineimap will “corrupt” it every sync.

If you want to use macros, you may find issues with the spaces. Solve it with the following:
macro index,pager ga "<change-folder> =GMAIL/[Google<quote-char> Mail].All<quote-char> Mail<enter>" "Go to all mail"

Note the <quote-char>. This solves the issue.

Sidebar

I found problems with foldernames with spaces and the sidebar too. Just follow the above tip. One advantage of such an approach is that you can select what mailboxes appear, and block the ones you don’t want to sync with offlineimap (such as All Mail, I just let gmail to handle that one).
If you have multiple accounts, you can make it look more organized by defining fake mailboxes, such as “=0Gmail1”. Setting the first character to zero will make it show up a the top of each account’s folders group in the sidebar. It will not appear in regular mutt’s navigation.

This is my sidebar’s config (similar to most people ones, and offered in /usr/share/doc/mutt* in Debian)

############################################################################
# Sidebar
set sidebar_width=30
set sidebar_visible=yes
set sidebar_delim='|'
set sidebar_sort=yes
color sidebar_new brightblue black# b toggles sidebar visibility
macro index b 'toggle sidebar_visible'
macro pager b 'toggle sidebar_visible'

bind index \CP sidebar-prev
bind index \CN sidebar-next
bind index \CO sidebar-open
bind pager \CP sidebar-prev
bind pager \CN sidebar-next
bind pager \CO sidebar-open
##############################################################################

Back to main.

Advertisements

Written by elric80

November 21, 2009 at 4:34 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: