Undeliverable Mail Returned to Sender (procmail-wrapper died with status 231)


Things have been running quite smoothly using virtualmin until I updated to centOS 5.6. I got a complaint this morning about “Undelivered Mail Returned to Sender” being received by senders to domains on the system. After some testing, I noticed that the mail does go through, but the sender still gets an error back.

Here’s some info from maillog:
Apr 18 16:28:06 sys postfix/local[18072]: D07AD37CC42E: to=user-domain.org@sys.domain.org, orig_to=user@post.domain.org, relay=local, delay=0.57, delays=0.3/0/0/0.27, dsn=5.3.0, status=bounced (Command died with status 231: “/usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME”)
Apr 18 16:28:06 sys postfix/cleanup[18071]: 57D8337CC430: message-id=20110418152806.47D8327CC293@sys.domain.org
Apr 18 16:28:06 sys postfix/bounce[18079]: D07AD37CC42E: sender non-delivery notification: 57D8337CC430
Apr 18 16:28:06 sys postfix/qmgr[9281]: 57D8337CC430: from=<>, size=3126, nrcpt=1 (queue active)
Apr 18 16:28:06 sys postfix/qmgr[9281]: D07AD37CC42E: removed
Apr 18 16:28:08 sys postfix/smtp[18080]: 57D8337CC430: to=user2@domain2.com, relay=domain2.com[]:25, delay=2.4, delays=0.05/0.01/0.26/2.1, dsn=2.0.0, status=sent (250 2.0.0 OK 3203230977 r16si10319723weh.14)

It looks like the problem has to do with:
Command died with status 231: “/usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME”
except I’m not sure why procmail-wrapper could be having problems.

Any ideas on where to look or has anyone else experienced this?


Just to be more clear, here’s the returned error to the sender:

user-domain.org@sys.domain.org (expanded from user@mail.domain.org):
Command died with status 231: “/usr/bin/procmail-wrapper -o -a $DOMAIN -d

Final-Recipient: rfc822; user-domain.org@sys.domain.org
Original-Recipient: rfc822;user@domain.org
Action: failed
Status: 5.3.0
Diagnostic-Code: x-unix; unknown mail system error 231

Hrm, I’ve never heard of a “error 231” before. That’s unusual :slight_smile:

Do you see any errors in the procmail log, /var/log/procmail.log?

Also, does that problem happen for all users, or just some? You may want to make sure the users in question aren’t over their disk quota.


Thanks for replying!

No, it’s not a quota error because the users/domains are under quota and one of the domains is unlimited.
Yes, it seems to be happening for all users.

I checked procmail.log and it has:
procmail: Program failure (-25) of “/etc/webmin/virtual-server/lookup-domain.pl”
From user2@domain2.com Mon Apr 18 15:37:38 2011
Subject: test

Any ideas what that could be a result of?

Okay, two things could cause that.

First – what are the permissions of “/usr/bin/procmail-wrapper”? They should be “6755”. You can manually set that by running this command:

chmod 6755 /usr/bin/procmail-wrapper

Also, what does your /etc/procmailrc file look like?

There should be a “DROPPRIVS=yes” line in it – but that line should be at the end of the file, not at the beginning.


Here’s the output I got:

  • ls -l /usr/bin/procmail-wrapper
    -rwsr-sr-x 1 root root 4994 May 10 2007 /usr/bin/procmail-wrapper

  • cat /etc/procmailrc
    VIRTUALMIN=|/etc/webmin/virtual-server/lookup-domain.pl $LOGNAME

  • ?/usr/bin/test “$EXITCODE” = “73”
  • ?/usr/bin/test “$VIRTUALMIN” != “”

Also, make sure that in /etc/postfix/main.cf , the mailbox_command line reads :

mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME

And, what about the permissions of /usr/bin/procmail, what do those look like?


Looks good.

mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME

ls -l /usr/bin/procmail
-rwxr-xr-x 1 root mail 88340 Jan 2 2009 /usr/bin/procmail

Try setting “/usr/bin/procmail” to be 6755 as well:

chmod 6755 /usr/bin/procmail

Same problem unfortunately.

Is there a way to lookup what error code 231 could be for procmail-wrapper?

I’m unfortunately not sure what procmail error code 231 is. A grep through it’s source code doesn’t show that number. It’s possible that the error is coming from one of the other tools procmail communicates with (such as the lookup daemon).

One thing you could try is restarting the lookup-domain daemon using this:

/etc/init.d/lookup-domain restart

Well, I couldn’t believe I missed this earlier, but it seems that lookup-domain daemon wasn’t running. Restart fixed that and seems that the errors are no longer being sent back!

Thanks a bunch for all your help!