procmail Not Available for sendmail Programs

We ran into a procmail problem with sendmail today. One user tried to set up procmail to send out vacation message. He crated a .forward file to execute procmail whenever an email is received. The .forward file has a only one line.

"|exec /usr/bin/procmail"

The error message we got is

smrsh: "procmail" not available for sendmail programs (stat failed)

While I was searching for a fix, my user actually found the solution first. The problem is sendmail is running in a restricted smrsh shell. If you want it to invoke external programs, you have to create symbolic links for these programs in smrsh’s directory. On CentOS, the directory is at /etc/smrsh. To fix this, I have to run the following commands.

cd /etc/smrsh
ln -s /usr/bin/procmail