October 2, 2007
mutt query gmail
mutt’s query_command is nice. And using gmail to archive all my mail is nice too. Managing mutt’s address book (flat text file) is somewhat annoying though.
Wouldn’t it be better if mutt could use gmail as an address book? Yeah, I thought so too.
To make this all work, you’ll need 3 things. The following instructions assume you know how to download and patch stuff.
- libgmail
- mutt_gmail_search
- to clone the above repo:
git clone http://git.chizang.net/projects/mutt_gmail_search.git
First, download and install libgmail. Verify it works.
Then, stick the mutt_gmail_search script somewhere in your $PATH.
You will need to add the following to your .muttrc:
set query_command="mutt_gmail_search '%s'"
Now you can continue to use mutt as a front-end, gmail as your archiving back-end, and avoid having to manage your mutt address book. Enjoy!
edit: on 26 March 2008 — no longer need my patch against libgmail as it’s been accepted upstream; moved mutt_gmail_search to git repo





October 2nd, 2007 at 11:14 am
[...] mutt query gmail [...]
November 3rd, 2007 at 9:25 am
hi alex,
i’m not familiar with patching python scripts. please describe the second step more more detailed.
thanks,
thomas
November 5th, 2007 at 3:01 pm
Hi Thomas,
Actually, upstream has accepted my patch, so you should just be able to pull from CVS to get the functionality.
Thanks.
November 7th, 2007 at 2:31 pm
thanks for that hint. i’ve downloaded the patched libgmail.py… i get the following error message after running the mutt_gmail_search script:
HTTP Error 302: The HTTP server returned a redirect error that would lead to an infinite loop.
The last 30x error message was:
Moved Temporarily
Successful. Saving to .muttgmailsearchrc
any ideas? many thanks in advance.
November 8th, 2007 at 6:53 am
Hi Thomas,
Have you tried just using plain old libgmail to login to your account normally? Get that working first…
Once you have verified that, I would remove ~/.muttgmailsearchrc, and run mutt_gmail_search manually from the command line. It should prompt you for your information and save it. (btw, if you are on a shared machine you might want to give that file 0600 permissions).
Finally, once you have verified that mutt_gmail_search works from your command line, you can hook it up to mutt’s query command.
Hope this helps.
November 8th, 2007 at 2:30 pm
here ist the solution: http://www.castlecops.com/p1017858-http_error_302.html
thanks for that great script!
March 26th, 2008 at 4:04 am
I created a small patch for unicode-mess :(
http://www.gerolf.ziegenhain.com/linux/content.html#configuration
/Gerolf