You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by "Shreyansh Shrivastava." <sh...@nitk.edu.in> on 2019/08/16 21:41:16 UTC

Failed to parse plugin (from @INC)

I added a plugin to Spamassassin.
.cf and .pre files are in /etc/mail/spamassassin
.pm file in lib/Mail/SpamAssassin/Plugin

On passing the mail, I got the following output
plugin: failed to parse plugin (from @INC): Can't locate
Mail/SpamAssassin/Plugin/Svm.pm in @INC (@INC contains:
/usr/local/share/perl5 /usr/local/lib64/perl5 /usr/lib64/perl5/vendor_perl
/usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at (eval
104) line 1.

Although after adding Plugin.pm to one of the mentioned directories
resolved the issue, but I am not really sure how @INC works. Is it like all
the plugins that we want to use, we have to add them to one of the metioned
directories ? Or can we specify lib/Mail/SpamAssassin/Plugin as @INC also
somehow ?

Regards,
Shreyansh Shrivastava

Re: Failed to parse plugin (from @INC)

Posted by Henrik K <he...@hege.li>.
On Sat, Aug 17, 2019 at 03:11:16AM +0530, Shreyansh Shrivastava. wrote:
> I added a plugin to Spamassassin.
> .cf and .pre files are in /etc/mail/spamassassin
> .pm file in lib/Mail/SpamAssassin/Plugin
> 
> On passing the mail, I got the following output
> plugin: failed to parse plugin (from @INC): Can't locate Mail/SpamAssassin/
> Plugin/Svm.pm in @INC (@INC contains: /usr/local/share/perl5 /usr/local/lib64/
> perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/
> perl5 /usr/share/perl5) at (eval 104) line 1.
> 
> Although after adding Plugin.pm to one of the mentioned directories resolved
> the issue, but I am not really sure how @INC works. Is it like all the plugins
> that we want to use, we have to add them to one of the metioned directories ?
> Or can we specify lib/Mail/SpamAssassin/Plugin as @INC also somehow ?

When you are using extra modules they go to /etc/mail/spamassassin, so put
Svm.pm there.

This will work then:
loadplugin Mail::SpamAssassin::Plugin::Svm Svm.pm

When using core modules from "lib/Mail/SpamAssassin/Plugin" source, it's
completely different procedure and requires atleast adding things to
MANIFEST file so make install will install it.  There is really no need for
you to do this.