Calling procmail from .forward, but it don"t see $HOME

Calling procmail from .forward, but it don"t see $HOME

am 23.03.2006 22:00:06 von spellman.jeff

If I call the procmail script like this it works.
"|IFS=' ' && exec /usr/bin/procmail -f- infprocmail.rc || exit 75
#ibatch"
When I call the script like this it don't work seems as if it don't see
variables.
"|IFS=' ' && exec /usr/bin/procmail -f- $HOME/infprocmail.rc || exit 75
#ibatch"

I using sendmail 8.13.6 and procmail 3.22.
Thanks
Jeff

Re: Calling procmail from .forward, but it don"t see $HOME

am 24.03.2006 03:52:19 von AK

spellman.jeff@gmail.com wrote:

> If I call the procmail script like this it works.
> "|IFS=' ' && exec /usr/bin/procmail -f- infprocmail.rc || exit 75
> #ibatch"
> When I call the script like this it don't work seems as if it don't see
> variables.
> "|IFS=' ' && exec /usr/bin/procmail -f- $HOME/infprocmail.rc || exit 75
> #ibatch"
>
> I using sendmail 8.13.6 and procmail 3.22.
> Thanks
> Jeff
>

If memory serves me right, $HOME might not be defined such that the
/infprocmail.rc file can not be found. Normally procmail looks for a
..procmailrc file in the local users home directory. There is no need to
use a configuration in the .forward file as you have shown.

from the .procmailrc file you can define the environment variables such
as HOME, SHELL, etc. I think $LOGNAME or $LOGIN is defined.
man procmail, procmailex procmailrc, etc.

AK

Re: Calling procmail from .forward, but it don"t see $HOME

am 24.03.2006 14:59:25 von spellman.jeff

Yes I understand that, but this is the configuration we have for about
600 users. I changed the mta from postfix to sendmail and
incountered this problem.
Thanks

Re: Calling procmail from .forward, but it don"t see $HOME

am 24.03.2006 14:59:27 von spellman.jeff

Yes I understand that, but this is the configuration we have for about
600 users. I changed the mta from postfix to sendmail and
incountered this problem.
Thanks

Re: Calling procmail from .forward, but it don"t see $HOME

am 24.03.2006 16:12:36 von Frank Slootweg

spellman.jeff@gmail.com wrote:
> Yes I understand that, but this is the configuration we have for about
> 600 users. I changed the mta from postfix to sendmail and
> incountered this problem.
> Thanks

As AK said, $HOME is normally set by login(1), so it's understandable
that it's not set (because postfix/sendmail don't log in). Probably
Postfix has some special casing to lookup the home directory (i.e. via
some passwd(4)-related call) when it sees "$HOME". I.e. in that case
"$HOME" is not an *environment* variable, but a *Postfix* variable.

Have you tried replacing "$HOME" by "~" (tilde)? I.e. I don't know
which shell executes procmail, but if it's a somewhat decent one, it
probably understands "~" to mean the user's home directory.

And next time, quote to what and whom you are responding and don't
start a new thread for the same subject. Google Groups has some setting
to quote.

Re: Calling procmail from .forward, but it don"t see $HOME

am 25.03.2006 18:50:29 von AK

spellman.jeff@gmail.com wrote:

> Yes I understand that, but this is the configuration we have for about
> 600 users. I changed the mta from postfix to sendmail and
> incountered this problem.
> Thanks
>

I understand that, this is why I suggest you use the builtin mechanism
in qmail and have the configuration in each users home dir as
..procmailrc. In this case, there is no need for an rc/configuration
file on the command line in the .forward file.

Not sure why anyone would migrate away from postfix and to sendmail of
all things.

AK