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.

Reply via email to