How to "feed to program"


I need to execute a PHP script when a message come to inbox of a specific email address.

I tried to do that using ALIA but this is not possible due to some permission problem.

I asked my provider who privately asked the author of Virtualmin and his answer was this:

This is unfortunately expected and un-avoidable - when you create an alias like that, the command is run by the mail server (Postfix) which doesn’t have permissions to run scripts as other users.

One work-around would be to have the mail go to a Virtualmin user who had a procmail rule setup to run whatever command you want, which will run with the user’s privileges.

So I created my specific Email address “” and I tried to setup a “Procmail Mail Filter” rule. I choose on the drop-down menu the option “feed to program” Then I set the URL of my script who look like:


But when I send a message to “” the script is not executed even if the mail is delivered in the mailbox.

I tried to play with some Options in “Procmail Mail Filter” but no change and the script is always not executed.

Actually my script contain only few line of code planned for send a test email to a specific email address. If I type the URL of the script in my browser, the script is well executed…

My goal right now was to test “feed to program” feature for see if is well possible to fire a script by email. Then later I will need to fetch the email content and process it by my script.

Somebody can tell me why the script is not executed ?



If you look in the procmail logs, in /var/log/procmail.log, do you see any errors being generated when your script is running?

Also, if you look in /home/myusername/, do you see a .procmailrc file? If so, you may want to verify that it contains something telling your system to execute that script when an email arrives?


thank for your reply…

In logs I get this:

Folder: /home/myusername/domains/ 1215
Time:1361176681 Size:1266 Dest:/home/myusername/domains/ Mode:None

and I don’t have any file.procmailrc in /home/myusername

So it seem defintely something is wrong in my setup. I attached a screenshot of my setup. I miss something ??

Oh I see, so the .procmailrc file should actually be here in this directory:


Ok I got the file and inside I have this:

| /home/myusername/domains/

So something more must be present in this file ?