Running a shell command on update/creation of an item
Bron Gondwana
brong at fastmail.fm
Wed Jan 31 00:32:22 EST 2007
On Tue, Jan 30, 2007 at 12:31:58PM +0100, Jochem Meyers wrote:
> Hi all,
>
> Currently, I'm trying to build an application involving synchronizing some
> data stored in a cyrus imap store (as messages with attachments) to an sql
> database. To accomplish this, I would like to have cyrus run a shell script
> when a item in it's store is updated or created. The items don't arrive
> through the MTA, but rather through a direct connection with the IMAP
> server, so using something like procmail is out of the question. Updates
> also need to be caught and processed.
>
> If this isn't a possibility, I'll have to write an application that checks
> the mailbox status periodically and synchronizes if it finds updates, but
> for an improved user experience, I'd rather use the above method.
>
> Thanks in advance for any advice,
If you wanted to be cheeky about it you could enable replication and
then just not run a copy of sync_client. You would then need a separate
process to tail the $confdir/sync/log file and parse out mailbox names
to call the shell script for.
Not that I would endorse such a trick of course - oh the hackery.
Bron.
More information about the Info-cyrus
mailing list