You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Rainer Dorsch <ml...@bokomoko.de> on 2018/04/18 17:03:21 UTC

Can't locate Mail/SpamAssassin/Plugin/SpamCop.pm: lib/Mail/SpamAssassin/Plugin/SpamCop.pm: Permission denied

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/

Re: Can't locate Mail/SpamAssassin/Plugin/SpamCop.pm: lib/Mail/SpamAssassin/Plugin/SpamCop.pm: Permission denied

Posted by Matus UHLAR - fantomas <uh...@fantomas.sk>.
>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

you don't need the lib/ directory there. 
in fact, the problem is that in original directory perl could not check if
it exists - one of directories in path (including ".") was inaccessible 

>> 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

On 19.04.18 21:03, Rainer Dorsch wrote:
>Subject: Re: Can't locate Mail/SpamAssassin/Plugin/SpamCop.pm:
> lib/Mail/SpamAssassin/Plugin/SpamCop.pm: Permission denied
>
>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....

try "mkdir -m 000 lib" and you'll see the problem is back.

I think this problem started appearing few years ago when perl started
throwing error when it could not search @INC because of permissions.

-- 
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
How does cat play with mouse? cat /dev/mouse

Re: Can't locate Mail/SpamAssassin/Plugin/SpamCop.pm: lib/Mail/SpamAssassin/Plugin/SpamCop.pm: Permission denied

Posted by Rainer Dorsch <ml...@bokomoko.de>.
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 <ml...@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/

Re: Can't locate Mail/SpamAssassin/Plugin/SpamCop.pm: lib/Mail/SpamAssassin/Plugin/SpamCop.pm: Permission denied

Posted by Rainer Dorsch <ml...@bokomoko.de>.
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 <ml...@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/

Re: Can't locate Mail/SpamAssassin/Plugin/SpamCop.pm: lib/Mail/SpamAssassin/Plugin/SpamCop.pm: Permission denied

Posted by Jesse Norell <je...@kci.net>.
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 <ml...@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/
> 
-- 
Jesse Norell
Kentec Communications, Inc.
970-522-8107  -  www.kci.net


Re: Can't locate Mail/SpamAssassin/Plugin/SpamCop.pm: lib/Mail/SpamAssassin/Plugin/SpamCop.pm: Permission denied

Posted by Rainer Dorsch <ml...@bokomoko.de>.
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 <ml...@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/

Re: Can't locate Mail/SpamAssassin/Plugin/SpamCop.pm: lib/Mail/SpamAssassin/Plugin/SpamCop.pm: Permission denied

Posted by Reio Remma <re...@mrstuudio.ee>.
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 <ml...@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/
>


Re: Can't locate Mail/SpamAssassin/Plugin/SpamCop.pm: lib/Mail/SpamAssassin/Plugin/SpamCop.pm: Permission denied

Posted by Rainer Dorsch <ml...@bokomoko.de>.
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 <ml...@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/

Re: Can't locate Mail/SpamAssassin/Plugin/SpamCop.pm: lib/Mail/SpamAssassin/Plugin/SpamCop.pm: Permission denied

Posted by Christian Grunfeld <ch...@gmail.com>.
"Can´t locate" and "permission denied" seems to be a directory permission
issue

2018-04-18 14:03 GMT-03:00 Rainer Dorsch <ml...@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/
>

Re: Can't locate Mail/SpamAssassin/Plugin/SpamCop.pm: lib/Mail/SpamAssassin/Plugin/SpamCop.pm: Permission denied

Posted by Matus UHLAR - fantomas <uh...@fantomas.sk>.
On 18.04.18 19:03, Rainer Dorsch wrote:
>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.

I have seen similar commands when ./lib/Mail/SpamAssassin/Plugin/SpamCop.pm
directory was not readable by the user running spamassassin checks.

if by any chance you have lib/ or lib/Mail/ etc.  in current directory that
is not readable by current user, this can happen.


-- 
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
The only substitute for good manners is fast reflexes.