Procmail has a strange way of saying "file not found"

samtregar on 2006-04-11T04:09:34

When I'm faced with a bizarre error message the first thing I do is search for it on the web. Chances are I'm not the first one to see it and someone else has probably already taken the time to explain it. That didn't work today with this one, offered up by procmail as an excuse for not running SpamAssassin:

/home/stregar/bin/spamc: Transport endpoint is not connected
procmail: Program failure (126) of "/home/stregar/bin/spamc"

That's coming from a call to SpamAssassin's spamc client program, but the same error happened with any pipe call in my .procmailrc. I spent a long time distracted by the "Transport endpoint" business. It just sounds so authoritative and networky. But as far as I could tell the network was completely normal.

Finally I turned to the next line with it's enigmatic magic number 126. Turns out that's a return code from the shell call to run the pipe. And 126 is bash for "file not found." It all came together when I realized that $HOME on the mail-recieving host was no longer /home/stregar! As soon as I switched to using $HOME instead of hard-coding the path everything started working.

So, google, if you would be so kind, please index this report so that others may not have to stumble around for quite so long.

-sam