[Dovecot] New experimental XEXEC plugin status

Marc Perkel marc at perkel.com
Tue Jun 12 20:24:12 EEST 2007


No to long ago I proposed an experimental extension to the IMAP protocol 
to allow IMAP to execute extername server side code and talk to email 
plugins to create custom client/server applications over an existing 
authenticated IMAP connection. I am happy to say they we have working 
code. It's not quite ready to download yet but we do have some life 
happening. I have started to document it on the Dovecot wiki here.

http://wiki.dovecot.org/Plugins/xexec

I'm looking to see if I can generate some interest in this.


  XEXEC Plugin

XEXEC is an experimental non-standard extension to the IMAP protocol 
that allows you to run and server side application and have it 
communicate with email plugins (Thunderbird) allowing custom 
client/server applications to communicate over an existing authenticated 
IMAP channel. The email client sends the XEXEC command with the name of 
the server side module that it wishes to run along with parameters to 
pass to the server. Here are some examples:

XEXEC blacklist add joe at example.com 
XEXEC whitelist del joe at example.com
XEXEC changepassword MyNewPassword
XEXEC forwardmail myaccount at yahoo.com 


    Uses for XEXEC

The XEXEC can be used to run anything but in theory it should be used 
for client server applications that relate to email or groupware 
applications like calendars and contact lists. Its main purpose is to 
allow email clients to set server side settings over the existing 
authenticated channel without having the user have to log in separately 
using a different application to control user settings. Examples of 
possible usage includes:

    * Setting server side white lists and black lists
    * Changing the password for the email account
    * Allowing users to set email forwarding preferences
    * Allowing users to set vacation messages
    * Allowing users to exclude email from specific countries or
      language character sets
    * Allowing users to control server side spam filter settings
    * Server Side Calendar and Group Contact Applications like MS
      Exchange has
    * SMTP over IMAP for sending outgoing email without separate SMTP
      settings
    * Setting rules for server side folder delivery.
    * Setting text message alerts to cell phones for important email
      notification

Wouldn't it be nice if you could change your email password i your email 
client and have it set the new password on the server at the same time? 
This would eliminate the need to change the server and client passwords 
separately. Or imagine sending outgoing email without having to 
configure SMTP. You just set up the incoming email and the outgoing 
email works as well. Or wouldn't you like to do some of the fancy tricks 
that Microsoft Exchange Servers do without having to use Exchange? It is 
our hope that this experimental protocol will lead to significant 
expansion of IMAP functionality.


    About this Plugin

This plugin is the idea of Marc Perkel of Junk Email Filter 
<http://www.junkemailfilter.com> who hired Nicolas Boullis ( 
nicolas.boullis at free.fr <mailto:nicolas.boullis at free.fr>) to write the 
code. I (Marc Perkel marc at perkel.com <mailto:marc at perkel.com>) am trying 
to get the concept out there in some sort of working form with the idea 
that it will catch on. Hopefully other people who find this concept 
useful will build on the idea, do it right, and perhaps some variation 
of this concept will eventually become a standard.


    Status

This plugin is a nonstandard experimental extension to the IMAP 
protocol. It is offered as a proof of concept and it is my hope that it 
will catch on in some form and make it into the IMAP officially. At this 
point there is nothing on the client side to talk to anything on the 
server side. So this code is presently useless until more development is 
done.


    Configuration

To activate and configure this plugin you have to first add it to your 
dovecot.conf file. You can do so as follows:

protocol imap { 
   mail_plugins = xexec
} 

Then to add applications you specify the module name and map it to a 
server side executable program.

 xexec = module:executable

Here are some examples:

plugin { 
  xexec = blacklist:/usr/local/dovecot/blacklist.sh %u
  xexec2 = whitelist:/usr/local/dovecot/whitelist.sh %u
  xexec3 = average:/usr/local/dovecot/average
  xexec4 = smtp:/usr/local/dovecot/smtp
} 

The idea is that the module name will be a reference to an executable 
and will hide what is happening on the server. When the command XEXEC 
module <parameters> is passed then the server will run the executable 
and pass the parameters to the executable.


    Interacting with XEXEC

A typical session with XEXEC might look like this.

* OK Dovecot ready. 
001 login marc at perkel.com password
001 OK Logged in.
002 xexec blacklist add joe at example.com
* OK Adding joe at example.com to server side blacklist for marc at perkel.com
002 OK command exited successfully
003 xexec changepassword MyNewPassword
* OK New Password set Sucessfully for marc at perkel.com
003 OK command exited successfully 

Many of the details of how everything will work under different 
conditions have yet to be developed.


    Download and Installation

Coming Soon!


    License

This software and the concepts behind is are free. No patent or 
copyrights are asserted on the concept. This is a gift to the world 
community. Code is released under GPL2.


    Help Needed

We could use some help with this project. We haven't even started 
writing any client side code. We are looking for sharp people with good 
ideas to help develop this concept in a way that will eventually lead to 
becoming part of the standard. We envision that certian commands to do 
ordinary universal stuff (password, smpt, whit list, black list, 
forwarding) will become standardized so that features to set server side 
settings can become part of standard email applications.





More information about the dovecot mailing list