Update: the cd /home/rd solves the problem! I did not realize that the reportspam-line.sh is just called once and I have to restart it....
Rainer Am Donnerstag, 19. April 2018, 20:53:19 CEST schrieb Rainer Dorsch: > Thank you for your reply, Jesse. > > Hmm.....no cd /home/rd/ does not help and there is no lib directory in there > > rd@netcup:~$ ls -l lib > ls: cannot access lib: No such file or directory > rd@netcup:~$ ls -l Mail > ls: cannot access Mail: No such file or directory > rd@netcup:~$ pwd > /home/rd > rd@netcup:~$ > > I have put the complete debug output here: > > http://paste.debian.net/1021089/ > > Maybe somebody sees something suspicious... > > I am really wondering why perl is missing the prefix, e.g. here > > Apr 19 20:40:14.161 [23757] 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. > > Thanks > Rainer > > Am Donnerstag, 19. April 2018, 10:08:24 CEST schrieb Jesse Norell: > > Somewhat of a guess, but try adding "cd /home/rd/" at the top of your > > script. I've had a similar issue with a sa-learn cronjob that ended up > > with /root as the working directory. > > > > On Thu, 2018-04-19 at 08:23 +0200, Rainer Dorsch wrote: > > > Yes, but the inotify version (not working anymore) I start in > > > rc.local using > > > > > > su -c /home/rd/bin/reportspam rd 2>&1 >> /var/log/reportspam & > > > > > > Not sure if that has any side effects... > > > > > > Rainer > > > > > > Am Donnerstag, 19. April 2018, 00:23:15 CEST schrieb Reio Remma: > > > > Are you running both commands as the same user? > > > > > > > > Reio > > > > > > > > On 18.04.2018 23:00, Rainer Dorsch wrote: > > > > > That was also my first guess, but it seems not the be the case > > > > > here alll > > > > > dirs are 755 and the file 644: > > > > > > > > > > rd@netcup:~$ locate SpamCop.pm > > > > > /usr/share/perl5/Mail/SpamAssassin/Plugin/SpamCop.pm > > > > > rd@netcup:~$ ls -l > > > > > /usr/share/perl5/Mail/SpamAssassin/Plugin/SpamCop.pm > > > > > -rw-r--r-- 1 root root 8578 Feb 7 2014 > > > > > /usr/share/perl5/Mail/SpamAssassin/ Plugin/SpamCop.pm > > > > > rd@netcup:~$ ls -ld /usr/share/perl5/Mail/SpamAssassin/Plugin > > > > > drwxr-xr-x 2 root root 4096 Feb 3 2015 > > > > > /usr/share/perl5/Mail/SpamAssassin/ Plugin > > > > > rd@netcup:~$ ls -ld /usr/share/perl5/Mail/SpamAssassin > > > > > drwxr-xr-x 10 root root 4096 Feb 3 2015 > > > > > /usr/share/perl5/Mail/SpamAssassin rd@netcup:~$ ls -ld > > > > > /usr/share/perl5/Mail > > > > > drwxr-xr-x 6 root root 4096 Feb 3 2015 /usr/share/perl5/Mail > > > > > rd@netcup:~$ ls -ld /usr/share/perl5 > > > > > drwxr-xr-x 60 root root 4096 Jan 5 09:29 /usr/share/perl5 > > > > > rd@netcup:~$ ls -ld /usr/share > > > > > drwxr-xr-x 173 root root 4096 May 21 2017 /usr/share > > > > > rd@netcup:~$ ls -ld /usr > > > > > drwxr-xr-x 11 root root 4096 Feb 1 2016 /usr > > > > > rd@netcup:~$ ls -ld / > > > > > drwxr-xr-x 23 root root 4096 Jan 10 22:25 / > > > > > rd@netcup:~$ > > > > > > > > > > Rainer > > > > > > > > > > Am Mittwoch, 18. April 2018, 14:09:47 CEST schrieb Christian > > > > > > > > > > Grunfeld: > > > > > > "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/ -- Rainer Dorsch http://bokomoko.de/