Re: [Exim] Calling Perl

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Malcolm Beattie
Date:  
À: Malik Baichi
CC: exim-users
Sujet: Re: [Exim] Calling Perl
Malik Baichi writes:
> I have problems installing Exim, especially when it comes to execute a PERL
> subroutine or accessing MySql, and I have the same error when I use the
> relevant commands/expressions.
> My problem is very simple. I have a .forward file from which I would like to
> call a PERL subroutine.
>
> # Exim filter
>
> ${perl{my_subroutine}}
>
> That's it. When I receive an email, the filtering starts as the debugging
> outputs show, and the following error is returned:
>
> Filter: start of processing
> Filter: end of processing
> Filter error: unknown filtering command "${perl{my_subroutine}}" near

                                  ^^^^^^^


${perl{...}} is an expansion that can be used in place of a variable,
not a whole command.

> line 14 of filter file
> search_tidyup called
>
> However when I do from the prompt:
>
> exim -be    // Carriage Return
> >${perl{my_subroutine}}

>
> The PERL script is called and executed properly with the expected result (it
> is just a subroutine with a PRINT). However,


Maybe "exim -be" is doing an initial expansion before executing
your command.

You need to write a proper filter file which includes your Perl
expression somewhere in it. For example, something like (untested):

    if error_message then finish endif
    if ${perl{my_subroutine}} is not "ok" then finish endif


and then have your Perl subroutine return "ok" when everything's OK.

--Malcolm

-- 
Malcolm Beattie <mbeattie@???>   <-- This email address will break
Unix Systems Programmer                   when I quit OUCS on Jul 20th. Send
Oxford University Computing Services    private mail to mbeattie@???
                                      I'll sort out my IBM email address soon.