Procmailrc not forwarding to script

In my home directory I created a php file called “test.php”. When I call it from the command line (#/user/bin/local/php -q test.php) it works fine.


#!/usr/local/bin/php -q

<?php mail('','Procmail test', 'incoming mail test'); ?>

So I made a basic .procmailrc file:

|/usr/bin/local/php -q test.php

But I get nothing. I’ve read every post in tis forum on it, scoured google groups and read at least 10 tutorials. I’ve tried every possible combination. Verbose, setting a log file using a condition, but nothing seems to work.

It’s like the .procmailrc file isn’t getting called and used. Any ideas? thanks.

I’m no expert on procmail, but have you tried using the full path for test.php?

Oh, and is this an FTP user mail account, or one of those mXXXXXX ones? I don’t think procmail works for the mail-only (mXXXXXX) accounts.


You also need to make a “.forward.postfix” file that tells postfix to pipe the mail to procmail.
Put the following in your .forward.postfix file (include quotes, but not the = sign)

“| /usr/bin/procmail -t”


Hope this helps!

I have the .forward.postfix in place and it’s exactly as you put. Thanks for the response.

Yea, I have tried the full path and this is an FTP shell account and not a mail only (mxxxxx) account. When will the clouds part? Thanks for the help.

So I spoke to customer support and they are telling me you can’t pipe to php scripts any longer. I can only do it to perl. Well I tried to do that too with no luck. Something is not happening here. Calling perlMailHandler just write a log entry to a file right now. And it works fine when I run it but .procmailrc is not piping to this script. Any ideas?

|/usr/local/bin/perl perlMailHandler



As the first line of your script, make it executable, and pipe to the script directly.

  • BRoach

Thanks for the suggestions but I have that as the first line in the script.

Good. Then piping the email to the program, rather than the perl interpreter, should work.


I am working on the same issue. I have created an
entry in the DH WIKI as a way of keeping a record.
It is at:

I am stuck at the forwarding of email. I figured I would use the intermediate step of forwarding email as it has been written about more. I can not get the forward to work an there is a strange folder under the username associated with the email name, it shows up as only { (yes left bracket and that is it !) When I send to the email that is suppose to forward to another email address I see the number of bytes in this directory gets bigger. However when I try to access the directory it throws an error and denies all knowledge of said directory.

Fred :slight_smile: