Procmailrc redirect to PHP

Hello… i’ve been trying for several days now to forward email sent to a user to a php script for “processing”… I’ve tried several different things… i’ve now compiled PHP5 (using a wiki post by dreamhost)

none the less this is my setup

in my home directory i have


it contains one line: “|/usr/bin/procmail -t”

and my .procmailrc contains:


now to the problem… procmail recognizes the email fine, but on the last few lines gives me this error:

Folder: /home/slserver/php/bin/php /home/slserver/slmail.php 996
/home/slserver/php/bin/php: /lib/ version `GLIBC_2.3’ not found (required by /home/slserver/php/bin/php)

If anyone can point me in the right direction it’d be greatly appriciated

Did you make any progress on this?

I’m having the exact same problems.


Our mail servers have different configurations than our hosting servers so a copy of php you compile on the hosting server will not necessarily run on the mail server. Incoming mail is handled by the mail servers so that’s where the PHP is processed.

We do install PHP on the mail servers as well so you should be able to use that ok.

  • Dallas
  • DreamHost Head Honcho/Founder

I’m following the guide in the knowledge base ( post by hunsvotti), and having some problems, could you help me out.

I have a shell account with the email address I want. When I email that address procmail matches the critera and then tries to fire the PHP script, as it should.

However, PHP then reports some missing libs and doesn’t process the incoming email. Presenting such errors as:

/home/emaintemail/email/php/php: error while loading shared libraries: cannot open shared object file: No such file or directory

I have tried doing a fresh compile of PHP4 and 5, and copying the libs from /usr/libs (far more than I actually need, but I’m a bit of a newb when it comes to only copying the files I want via the command line).

In my .procmailrc file, can you tell me the path for for PHP I should be using?

When I use the copy I made, as per the instructions, I get the missing libs. When I try using /usr/local/bin/php as the path to PHP I get:

procmail: Executing “/usr/local/bin/php,/home/emaintemail/email/email.php”
/usr/local/bin/php: /usr/local/bin/php: No such file or directory

Any help you can offer would be gratefully received as this is a must have feature, and I’ve spent around 12 hours trying to get it working so far.



I’ve done some further testing, and when my .promailrc is:


|$PHP $HOME/email/email.php

I get the following output in the logfile:

procmail: Assigning "LD_LIBRARY_PATH=/home/emaintemail/email/php"
procmail: Assigning "PHP2=/home/emaintemail/email/php/php"
procmail: Assigning "LASTFOLDER=/home/emaintemail/email/email.php"
procmail: Executing "/home/emaintemail/email/email.php"
procmail: Notified comsat: "emaintemail@:/home/emaintemail/email/email.php"
From Sat Oct 22 10:21:00 2005
Subject: Test With PHP Path
Folder: /home/emaintemail/email/email.php 692
/bin/sh: /lib/ version GLIBC_PRIVATE' not found (required by /home/emaintemail/email/php/ /bin/sh: /lib/ versionGLIBC_PRIVATE’ not found (required by /home/emaintemail/email/php/

However, if I put a completly fictional patch as the path for PHP and the script in my .promailrc like:

I get the following in the log file:

procmail: Assigning "LD_LIBRARY_PATH=/home/emaintemail/email/php"
procmail: Assigning "PHP=/home/emaintemail/FAKEFOLDER/php/php"
procmail: Executing "/home/emaintemail/FAKEFOLDER/php/php,/home/emaintemail/FAKEFOLDER/email.php"
procmail: Assigning "LASTFOLDER=/home/emaintemail/FAKEFOLDER/php/php /home/emaintemail/FAKEFOLDER/email.php"
procmail: Notified comsat: "emaintemail@:/home/emaintemail/FAKEFOLDER/php/php /home/emaintemail/FAKEFOLDER/email.php"
From Sat Oct 22 10:31:38 2005
Subject: Test With Fake File Path
Folder: /home/emaintemail/FAKEFOLDER/php/php /home/emaintemail/FAKEF 697
/bin/sh: /lib/ version GLIBC_PRIVATE' not found (required by /home/emaintemail/email/php/ /bin/sh: /lib/ versionGLIBC_PRIVATE’ not found (required by /home/emaintemail/email/php/

Surly this means that the problem isn’t with PHP at all, but with Promail or something else.

Its really important to me (and my boss) that I get email to PHP working quickly. So any help anyone can offer would be great.

Otherwise I might have to host this application with someone else, because this is so easy to do with CPanel hosts.


The problem is that you recompiled all of your PHP stuff on the webserver machine (which is sarge), including the shared libraries. The error’s still popping up after changing the PHP path becuase you still have LD_LIBRARY_PATH set, so any executable run in that environment will link against the sarge libraries. You’ll either need to revert to the old version if you still have it or wait for the mail servers to be upgraded to sarge (which is probably at least a week or two away).