Sa-learn-pipe.sh script modification

Pierre Barre skyice at openmailbox.org
Sat Nov 1 14:38:48 UTC 2014


Hello,

I've seen on this wiki page: http://wiki2.dovecot.org/Plugins/Antispam

A script called "sa-learn-pipe.sh". I've tested it but it slow things 
down because dovecot wait for the script termination.

So, I've made a modification. Now, the task is running in the background 
and dovecot move the mail without waiting for the script termination:

#!/bin/bash
echo /usr/bin/sa-learn $* /tmp/sendmail-msg-$$.txt
echo "$$-start ($*)" >> /tmp/sa-learn-pipe.log

#echo $* > /tmp/sendmail-parms.txt
cat<&0 >> /tmp/sendmail-msg-$$.txt

/usr/bin/sa-learn $* /tmp/sendmail-msg-$$.txt && rm -f 
/tmp/sendmail-msg-$$.txt &

echo "$$-end" >> /tmp/sa-learn-pipe.log

exit 0

I want know if this can cause any problem ?

Thanks.

-- 
Best regards,
Pierre Barre.



More information about the dovecot mailing list