"Can“t locate" and "permission denied" seems to be a directory permission issue
2018-04-18 14:03 GMT-03:00 Rainer Dorsch <m...@bokomoko.de>: > Hello, > > I have a strange problem when reporting spam using spamassassin -rD > > I monitor an imap directory using inotifywait: > > inotifywait --monitor --quiet --event moved_to,create --format '%f' > /home/rd/ > Maildir/.SPAM-learned/cur/ | /home/rd/bin/reportspam-line.sh 2>&1 > > and then report spam using > > rd@netcup:~$ cat bin/reportspam-line.sh > !#/bin/bash > > while read line > do > echo "$line" > spamassassin -rD < /home/rd/Maildir/.SPAM-learned/cur/$line > done < "${1:-/dev/stdin}" > rd@netcup:~$ > > Then spamassassin report errors like > > Apr 18 18:44:40.902 [5112] warn: plugin: failed to parse plugin (from > @INC): > Can't locate Mail/SpamAssassin/Plugin/SpamCop.pm: lib/Mail/SpamAssassin/ > Plugin/SpamCop.pm: Permission denied at (eval 31) line 1. > Apr 18 18:44:40.902 [5112] dbg: plugin: loading > Mail::SpamAssassin::Plugin::AutoLearnThreshold from @INC > Apr 18 18:44:40.902 [5112] warn: plugin: failed to parse plugin (from > @INC): > Can't locate Mail/SpamAssassin/Plugin/AutoLearnThreshold.pm: lib/Mail/ > SpamAssassin/Plugin/AutoLearnThreshold.pm: Permission denied at (eval 32) > line > 1. > [...] > 0 message(s) examined. > > When I run directly from cmd line, these errors do not show up: > > rd@netcup:~$ spamassassin -rD < /home/rd/Maildir/.SPAM-learned/cur/ > 1524003783.H176971P29357.netcup.bokomoko.de\:2\,S > [...] > Apr 18 18:49:52.980 [5164] dbg: config: using "/home/rd/.spamassassin/ > user_prefs" for user prefs file > Apr 18 18:49:52.980 [5164] dbg: config: read file /home/rd/.spamassassin/ > user_prefs > Apr 18 18:49:52.981 [5164] dbg: plugin: loading > Mail::SpamAssassin::Plugin::URIDNSBL from @INC > Apr 18 18:49:52.986 [5164] dbg: plugin: loading > Mail::SpamAssassin::Plugin::Hashcash from @INC > Apr 18 18:49:52.995 [5164] dbg: plugin: loading > Mail::SpamAssassin::Plugin::SPF from @INC > [...] > Apr 18 18:50:11.222 [5164] info: reporter: spam reported to SpamCop > 1 message(s) examined. > Apr 18 18:50:11.301 [5164] dbg: plugin: > Mail::SpamAssassin::Plugin::MIMEHeader=HASH(0x372cf68) implements > 'finish_tests', priority 0 > Apr 18 18:50:11.301 [5164] dbg: plugin: > Mail::SpamAssassin::Plugin::Check=HASH(0x372d220) implements > 'finish_tests', > priority 0 > > It almost seems that a prefix is missing when running through inotifywait. > > Any hint is welcome :-) > > Many thanks > Rainer > > -- > Rainer Dorsch > http://bokomoko.de/ >