From: Wietse Venema on
Adrian P. van Bloois:
> * El Sat, Feb 20, 2010 at 02:17:05PM +0100, escribiste:
> > Adrian P. van Bloois a ?crit :
> > > * El Fri, Feb 19, 2010 at 06:56:38PM +0100, escribiste:
> > >> Hi,
> > >> I just installed postfix 2.7.0.
> > >> WIthout changes to the existing configuration of 2.6.5 I get this error
> > >> using procmail as my mailbox_command:
> > >> Feb 19 18:34:29 adrianvb postfix/local[14290]: BD85F7006D: to=<adrian(a)adrianvb.xs4all.nl>, orig_to=<root>, relay=local, delay=0.03, delays=0.02/0/0/0.01, dsn=5.3.0, status=bounced (Command died with status 126: "/usr/bin/procmail". Command output: /usr/bin/procmail: /usr/bin/procmail: cannot execute binary file )
> > >> Anyone any ideas???
> > > I have th thing working now with local delivery agent, so
> > > mailbox_command is empty.
> > > When I feed an e-mail to procmail it just works, when I change the
> > > mailbox_command back to /usr/bin/procmail I get the same problem.
> > > There's something rotten in the state of UNIX.
> > >
> >
> > do you have selinux/apparmor/... ?
> Nope!!!
> WHen I execute procmail from the commandline it works perfectly. As soon
> as I put it in my .forward or in the main.cf it fails.

If you execute program from the command line, your shell process
invokes the program.

If invoked from Postfix, Postfix will prepend $local_command_shell
to the command. That should be either empty, or something that
Postfix can append the command to as a single argument.

Wietse

From: Wietse Venema on
> > > >> WIthout changes to the existing configuration of 2.6.5 I get this error
> > > >> using procmail as my mailbox_command:
> > > >> Feb 19 18:34:29 adrianvb postfix/local[14290]: BD85F7006D: to=<adrian(a)adrianvb.xs4all.nl>, orig_to=<root>, relay=local, delay=0.03, delays=0.02/0/0/0.01, dsn=5.3.0, status=bounced (Command died with status 126: "/usr/bin/procmail". Command output: /usr/bin/procmail: /usr/bin/procmail: cannot execute binary file )
> > > >> Anyone any ideas???

I can reproduce this error message with:

$ /bin/bash /usr/bin/procmail

This suggests that you have:

/etc/postfix/main.cf:
local_command_shell = /bin/bash

The proper syntax is for command execution with bash is:

/etc/postfix/main.cf:
local_command_shell = /bin/bash -c

(as the manpage example suggests with its smrsh example).

Wietse

From: "Adrian P. van Bloois" on
* El Sat, Feb 20, 2010 at 10:04:59AM -0500, escribiste:
> > > > >> WIthout changes to the existing configuration of 2.6.5 I get this error
> > > > >> using procmail as my mailbox_command:
> > > > >> Feb 19 18:34:29 adrianvb postfix/local[14290]: BD85F7006D: to=<adrian(a)adrianvb.xs4all.nl>, orig_to=<root>, relay=local, delay=0.03, delays=0.02/0/0/0.01, dsn=5.3.0, status=bounced (Command died with status 126: "/usr/bin/procmail". Command output: /usr/bin/procmail: /usr/bin/procmail: cannot execute binary file )
> > > > >> Anyone any ideas???
>
> I can reproduce this error message with:
>
> $ /bin/bash /usr/bin/procmail
>
> This suggests that you have:
>
> /etc/postfix/main.cf:
> local_command_shell = /bin/bash
>
> The proper syntax is for command execution with bash is:
>
> /etc/postfix/main.cf:
> local_command_shell = /bin/bash -c
>
> (as the manpage example suggests with its smrsh example).
AHA, now we're cooking. This actually works perfectly!!!
THis should be suggested for /bin//bash as well in the documentation.

Thanks Wietse, I knew you would give the answer!!!


>
> Wietse

--
Adrian P. van Bloois
Postbus 2575 email: adrian(a)accu.uu.nl
3500 GN Utrecht voice: +31-(0)-30-68-94649
The Netherlands fax: +31-30-68-94649

The whole point of cooking is to get as much flavour out of the
ingredients as possible.
-- Delia Smith