9 Dec
2010
9 Dec
'10
10:59 p.m.
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