SOLVED in 7.2: Perl problems on FreeBSD (again)

Mog lists at elasticmind.net
Sat Nov 7 14:44:21 GMT 2009


So I've upgraded to 7.2 to see if that makes a difference and followed 
this upgrade procedure. Still I'm getting this recurring Perl problem 
whereby custom functions could not be required :(



Jose Amengual M wrote:
> Hi Guys.
>
> I saw some emails about perl 5.10.1 giving errors when running 
> mailscanner, I had the same problem and I follow the instructions 
> below but it din't work for me, but finally after 2 days of work I 
> found the solution!!!.
>
> This is working 7.2 should work on 8.0.
>
> if you have already mailscanner installed don't worry, portupgrade can 
> do all the job for you :).
>
> 1.- Remove old perl version :
> pkg_info|grep perl ( copy the exact name of you perl version like 
> perl5.10.1 )
> pkg_delete -f perl5.10.1
>
> 2.- Install old perl.
> pkg_add -r 
> ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-7.2-release/lang/perl-5.10.0_2.tbz 
>
>
> 3.- Clean up any work directory
> portsclean -C
>
> 4.- Update pkgdb add upgrade any perl package
> pkgdb -Ff
> portupgrade -fr perl ( this is going to upgrade everything that uses 
> perl including mailscanner).
> perl-after-upgrade && perl-after-upgrade -f
>
> After that the error was gone and everything was working fine.
>
> I was in the process of deciding of going towards mailscanner or 
> amavisd-new and I decided to use mailscanner because was easier to 
> configure and I expend 2 days fixing a problem with perl that I didn't 
> have on amavis :).
>
> I hope this help.
>
> Thanks.
>
> Jose Amengual.
>
>
> This like
> >
> Mog wrote:
>
> >>
> Hi all,
>
> >>
>
>
> >>
> I upgraded MailScanner last night along with a number of other ports,
>
>
> >>
> which unfortunately included a micro update to Perl. On FreeBSD it
>
> went
> >>
> from perl-5.10.0 to perl-5.10.1, and judging by the error messages in
>
>
> >>
> the maillog, it seems that the old taint mode problem has resurfaced:
>
> >>
>
>
> >>
> Could not use Custom Function code
>
> >>
> /usr/local/lib/MailScanner/MailScanner/CustomFunctions/SpamWhitelist.pm,
>
> >>
> it could not be "require"d. Make sure the last line is "1;" and the
>
> >>
> module is correct with perl -wc (Error: Insecure dependency in
>
> require
> >>
> while running with -T switch at
>
> >>
> /usr/local/lib/MailScanner/MailScanner/Config.pm line 754.
>
> >>
>
>
> >>
> I'm seeing this same error message being shown for these files as
>
> well:
> >>
> MyExample.pm, DavidHooton.pm, LastSpam.pm, GenericSpamScanner.pm,
>
> >>
> CustomAction.pm, Ruleset-from-Function.pm and ZMRouterDirHash.pm.
>
> >>
>
>
> >>
>
>
> >>
>  From what I understand, FreeBSD runs perl programs with the -T
>
> option
> >>
> (taint mode), which is basically some additional security check. If
>
> I'm
> >>
> reading this right, the additional security check (for some reason)
>
> >>
> seems to have a problem with 'eval { require $fullfile; };', the code
>
>
> >>
> used to require the CustomFunction modules MailScanner uses:
>
> >>
>
>
> >>
>    $fullfile = "$dir/$filename";
>
> >>
>    next unless -f $fullfile and -s $fullfile;
>
> >>
>    eval { require $fullfile; };
>
> >>
>    if ($@) {
>
> >>
>      MailScanner::Log::WarnLog("Could not use Custom Function code
>
> %s, " .
> >>
>                                "it could not be \"require\"d. Make
>
> sure " .
> >>
>                                "the last line is \"1;\" and the
>
> module " .
> >>
>                                "is correct with perl -wc (Error:
>
> %s)",
> >>
>                                $fullfile, $@);
>
> >>
>    }
>
> >>
>
>
> >>
>
>
> >>
> Does this makes sense to anyone? Naturally I've reported this problem
>
> to
> >>
> the FreeBSD people as well to see if they can help work out what is
>
> >>
> going on.
>
> >>
>
>
> >>
> Regards,
>
> >>
> mog
>
>
> >
> What process did you use to upgrade MailScanner/Perl? If you used
>
> >
> portupgrade, please give the command line you used.
>
>
> >I have the same issue, I did the normal portupgrade perl.
> >And did run the perl-after-upgrade
> >After that did not work I did a rebuild of perl with -rf portupgrade -rf
> .perl, this way all ports relying on perl are rebuild.
> >And that did also not work.
> >So I grabbed another server, installed FreeBSD 8.0RC1 upgraded the ports
> >tree, installed MailScanner, and got the same error.
> >It is the same error I got with perl 5.8.9, and with perl 5.8.8 I had no
> >problems also.
> >Now perl5.10.0_4 and 5.8.8 has no problems, but 5.10.1 and 5.8.9  has,
> >anyway on my systems (AMD64 and i386)
>
>
>


More information about the MailScanner mailing list