1

I would like to launch a specific command [1] on a mail server whenever a message is moved from one folder into another folder.

For example, a Thunderbird user moves a message from folder A to Folder B. I'd like to catch this move and launch a specific script on the server.

Is it possible ?

I'm using qmail with courier-imap.

[1] bash or python script, ...

Oli
  • 113
  • 4

1 Answers1

2

inotify were created for this:

inotify is a Linux kernel subsystem that provides file system event notification.

You could use inotify-tools or incron for this. To be portable between systems that do not implement inotify you can use Gamin which will fallback to supported subsystem like dnotify etc.

rkthkr
  • 8,618
  • 28
  • 38
  • Thanks very much. And with inotify it will be supported on every mail server, not just qmail. – Oli Sep 29 '09 at 07:23
  • If all your users access their email via your Courier-IMAP server, then it would make sense to make a modification to that server instead of trying to watch 'outside' with inotify. (It will be simpler, and more portable.) – jrg Sep 30 '09 at 23:04