Article 56B5V Mail from cron not deliverable when using procmail with exim

Mail from cron not deliverable when using procmail with exim

by
drj000
from LinuxQuestions.org on (#56B5V)
I'm trying to mail from cron properly delivered locally. I use procmail to sort and deliver my mail. That part works fine.

I have a .forward file that contains:

Code:|/home/user/.procmail/clean_pipe.shI created this script, clean_pipe.sh, because procmail was sending output to stderr, and exim saw this output as an error, so, even though it was being delivered, I would get a second "Mail delivery failed" message as well.

So, I created this very simple script:

Code:#!/bin/bash

/usr/bin/procmail -f- >/dev/null 2>&1I can send mail to myself doing:

Code:ls | mail -s "Test email" $USERThe mail is properly delivered. Even if I send it as another user, even as nobody.

But, I don't get any mail from cron.
I've got MAILTO=user at the top of the crontab, to be sure, even though that's the default anyway.

And when a cron job runs, I see the following in my exim log:

Code:2020-07-30 12:14:01 1k1C81-00AA9O-HY ** |/home/user/.procmail/clean_pipe.sh <drj@bigbad.attlocal.net> R=userforward T=address_pipe: Child process of address_pipe transport returned 127 (could mean unable to exec or command does not exist) from command: /home/user/.procmail/clean_pipe.shSo, it's trying to deliver the mail, but failing. 127 is the code for a command not found. But the clean_pipe.sh script is there, and it refers only to /usr/bin/procmail, which does exists. There's also no output in my procmail log from those failed deliveries, so it's definitely not getting to procmail.

One other strange thing is that when delivery fails, a message is added to exim's queue. But, it's not the failed message, it's a second "Delivery failed" message. I can force that message to be delivered, and it works fine, and I can see in my procmail log that it's going through procmail properly.

At this point, I'm stumped. I'm not sure where else to try to debug this further. Any ideas?latest?d=yIl2AUoC8zA latest?i=DtkSVCW9vI8:C172Cp9NJkk:F7zBnMy latest?i=DtkSVCW9vI8:C172Cp9NJkk:V_sGLiP latest?d=qj6IDK7rITs latest?i=DtkSVCW9vI8:C172Cp9NJkk:gIN9vFwDtkSVCW9vI8
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments