Re: [Exim] limitations with embedded Perl

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Alun
Datum:  
To: exim-users
Betreff: Re: [Exim] limitations with embedded Perl
--
Philip Hazel (ph10@???) said:
>
> On Tue, 24 Jun 2003, Mike Scott wrote:
>
> > You don't take enough credit for this thoughtful feature!!
>
> I did not implement it, so I don't deserve any credit...
>
> > #!/usr/bin/perl -Pw
> > use strict;
> > use DB_File;
> > sub isSpam {
> >    my $message_id = Exim::expand_string('$message_id');
> >    my %database = ();
> >    tie %database, "/tmp/exim.db", O_RDONLY;
> >    untie %database;
> >    return ($message_id);
> > }

> >
> > Obviously, this is a VERY simplistic example. As is, it will crash with the
> > following message in the Exim log:
> > error in filter file: failed to expand "${perl{isSpam}}\n" in logwrite
> > command: Undefined subroutine &main::isSpam called.


I could be wrong here, but something we've seen quite often here is
inconsistencies between versions of Berkeley DB. I think that the embedded
perl is using whichever version of the DB library was used when Exim was
compiled, but something in DB_File.pm picks up the version that is installed
"now". This inconsistency causes the perl interpreter to bomb out with an
error about DB versions (which I'm surprised you're not seeing) and messes
everything else up.

If you "use SDBM_File" instead, I wouldn't mind betting that the problem
goes away.

Cheers,
Alun.

--
/P{def}def/E{curveto}P/N{moveto}P/G{lineto}P/U{setgray}P/I{fill}P/n{stroke}P
(2V<;;F<K5F5=8<5K-/3/6//C3?/367/W/O6/-0+3'//K3?/3:[0[/WB>>H<W6/;/C///1W'T1Q)
6 6 scale .2 setlinewidth 1 .7 0 setrgbcolor{}forall N G G I 0 U N E E E E E
I 1 U N E E E gsave I grestore 0 U n .3 U N E E n 1 0 360 arc I showpage%auj


--
[ Content of type application/pgp-signature deleted ]
--