[Dovecot] Execute Script on LMTP Deliver?
Is it possible to have dovecot 2.0.8 using LMTP run a shell script each time it delivers a message to a users mailbox?
I see there's an "execute = script /path/to/script" but when i added it to lmtp service in 10-master.conf, it didnt do anything and stopped delivering mail altogether
service lmtp { executable = script /usr/local/bin/test.sh u%
unix_listener /var/spool/postfix/private/dovecot-lmtp { group = postfix user = postfix }
inet_listener lmtp { port = 24 } }
$ ls -lh | grep test -rwxrwxrwx 1 root staff 270 2010-12-09 18:05 test.sh
$ cat test.sh #!/bin/sh USER=$1 echo $USER > /tmp/newfile
basically when a message arrives, it will execute a shellscript which will notify another service that mail has arrived in their inbox
On Thu, 2010-12-09 at 15:59 -0500, Edward Carraro wrote:
Is it possible to have dovecot 2.0.8 using LMTP run a shell script each time it delivers a message to a users mailbox?
Nope.
basically when a message arrives, it will execute a shellscript which will notify another service that mail has arrived in their inbox
Maybe with Sieve enotify extension? I think you can cause it to send another mail :) Then point it to some address where MTA is configured to execute your script.
Ah ok. Actually enotify xmpp is what I would like, but I couldn't get it compiled on a debian system with dovecot 2.0.8 and pigeonhole 0.2.2.
*Compile against installed dovecot* (attempt 1) $ ./configure --with-dovecot=/usr/local/lib/dovecot/ ... Pigeonhole Sieve headers not found from /home/edward/pigeonhole-enotify-xmpp-56ad0f423143 and they are not installed in the Dovecot include path, use --with-pigeonhole=PATH to give path to Pigeonhole sources or installed headers. configure: error: pigeonhole not found
*Compile against installed dovecot* (attempt 2) $ ./configure --with-dovecot=/usr/local/lib/dovecot/ --with-pigeonhole=/usr/local/include/dovecot/sieve/ $ make ... make[2]: Entering directory `/home/edward/pigeonhole-enotify-xmpp-56ad0f423143/src' /bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I -I/usr/local/include/dovecot/sieve -g -O2 -MT ntfy-xmpp.lo -MD -MP -MF .deps/ntfy-xmpp.Tpo -c -o ntfy-xmpp.lo ntfy-xmpp.c gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I -I/usr/local/include/dovecot/sieve -g -O2 -MT ntfy-xmpp.lo -MD -MP -MF .deps/ntfy-xmpp.Tpo -c ntfy-xmpp.c -fPIC -DPIC -o .libs/ntfy-xmpp.o ntfy-xmpp.c:14:17: error: lib.h: No such file or directory ntfy-xmpp.c:15:19: error: array.h: No such file or directory ntfy-xmpp.c:16:17: error: str.h: No such file or directory ntfy-xmpp.c:17:20: error: ioloop.h: No such file or directory ntfy-xmpp.c:18:26: error: str-sanitize.h: No such file or directory ntfy-xmpp.c:20:26: error: sieve-common.h: No such file or directory ntfy-xmpp.c:21:28: error: sieve-settings.h: No such file or directory ntfy-xmpp.c:22:27: error: sieve-address.h: No such file or directory ntfy-xmpp.c:23:31: error: sieve-ext-enotify.h: No such file or directory ntfy-xmpp.c:25:21: error: rfc2822.h: No such file or directory ... Continues on but more errors
*Compiled against source* $ ./configure --with-dovecot=/home/edward/dovecot-2.0.8/ --with-pigeonhole=/home/edward/dovecot-2.0-pigeonhole-0.2.2/ $ make ntfy-xmpp.c: In function 'ntfy_xmpp_load': ntfy-xmpp.c:105: warning: passing argument 1 of 'sieve_sys_warning' from incompatible pointer type ntfy-xmpp.c:105: error: too few arguments to function 'sieve_sys_warning'
After that, I tried to go the script way :P
On Thu, Dec 9, 2010 at 6:16 PM, Timo Sirainen tss@iki.fi wrote:
On Thu, 2010-12-09 at 15:59 -0500, Edward Carraro wrote:
Is it possible to have dovecot 2.0.8 using LMTP run a shell script each time it delivers a message to a users mailbox?
Nope.
basically when a message arrives, it will execute a shellscript which will notify another service that mail has arrived in their inbox
Maybe with Sieve enotify extension? I think you can cause it to send another mail :) Then point it to some address where MTA is configured to execute your script.
participants (2)
-
Edward Carraro
-
Timo Sirainen