LWN.net Logo

IMAP

IMAP

Posted Jun 24, 2004 7:09 UTC (Thu) by cras (guest, #7000)
In reply to: IMAP by corbet
Parent article: The Grumpy Editor's guide to mail clients: introduction

I've had exactly the same thoughts about scriptability. IMAP isn't very well suited to it by itself. The protocol is too complex to access directly with simple shell scripts, you'd need separate utilities that provide easier interface for it.

For example I quite often want to search a message from a specific sender where message body contains specific words. While IMAP itself allows this with SEARCH command, it only gives back a list of message numbers which have to be separately fetched. I can't just do "echo ... | nc imap.server | less". grepping mailboxes directly doesn't work very well either. I'm using Evolution which would allow it with advanced search, but it needs so many mouse clicks that I usually just begin grepping.

Fortunately, I've finally gotten my IMAP server's (dovecot.org) internals very flexible. It's no longer limited to only what IMAP can provide, so I can easily do pretty much any kind of mail accessing with it. First I'll add new IMAP extension which allows pipelining commands together, something like:

search from "user name" body "text" | fetch body.peek[]

This would allow me to do most of what I want. Perhaps the next step would be to create new protocol which allows much easier scriptability.


(Log in to post comments)

Copyright © 2008, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds