3 # Copyright © 2011 Nick Bowler
5 # Check mail for spam, automatically spawning spamd as necessary. This
6 # script can therefore be used in a procmail recipe to efficiently handle
9 # Runs plain old spamassassin if the daemon cannot be started for any reason.
11 # License WTFPL2: Do What The Fuck You Want To Public License, version 2.
12 # This is free software: you are free to do what the fuck you want to.
13 # There is NO WARRANTY, to the extent permitted by law.
15 spamd_sock=$HOME/.spamd
16 spamd_log=$HOME/.spamdlog
17 spamd_pid=$HOME/.spamdpid
21 flock -n $spamd_pid $spamd --pidfile=$spamd_pid --syslog=$spamd_log \
22 --socketpath=$spamd_sock $@
25 if ! spamc -K -U $spamd_sock &>/dev/null; then
26 run_spamd --daemonize || exec spamassassin
29 exec spamc -U $spamd_sock