Operating System - Linux
1748152 Members
3444 Online
108758 Solutions
New Discussion

Perl installation and procmail

 
Anne-Marte Krogsrud
Occasional Contributor

Perl installation and procmail

Does anyone know how I can check which perl installation procmail uses? And how I eventually can change this?

thanx in advance :-)

Anne-M
1 REPLY 1
Matti_Kurkela
Honored Contributor

Re: Perl installation and procmail

As far as I know, procmail is not a perl script. So it won't have any special handling for perl scripts.

If a perl script is called as
"/usr/local/bin/perl somescript.pl"
then "/usr/local/bin/perl" tells explicitly the location of the perl main binary, and so determines the perl installation to use.

If the script is called as
"perl somescript.pl"
then procmail takes the first perl instance that's found in PATH. Note that PATH might not be the same as the PATH of your normal session: best way to check is to make a simple procmail script that outputs the environment variables.

This quick and dirty script would replace the contents of any email which has only the word "printenv" at the subject with a printenv listing: (untested, use at your own risk)

:0 f
* ^Subject: printenv$
| printenv


If the perl script is called as "somescript.pl", then check the first line of the script. It should be something like
#!/usr/local/bin/perl
and it tells you what you need to know.

If you want to use another perl installation, just call the perl script in procmail file explicitly as:
/some/other/perl somescript.pl

If that isn't possible, change the first line of the perl script or PATH settings as appropriate.
MK