-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Doug Hardie wrote:
> 
> On Nov 16, 2006, at 15:47, Stephen Warren wrote:
> 
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Doug Hardie wrote:
>>> Setting the HOME env variable before calling tmda-filter does work.  I
>>> didn't see HOME used in the code, but it must be there somewhere.
>>
>> It's used internally by Python itself.
>>
>>> That is the easiest way to get NIS users to work.  I decided to
>>> create my own wrapper for tmda-filter as procmail and others introduce
>>> yet another layer of overhead with reading the entire message and
>>> processing it just to set the env variables.
>>
>> I'm still confused why HOME isn't being automatically set correctly.
>>
>> Do you believe that you need to write a wrapper to set HOME because:
>>
>> 1) You tested invoking tmda-rfilter from sendmail and it didn't work,
> 
> Sendmail is only setting one env variable (name forgotten but its value
> is "sendmail").  It does not set HOME.

OK. That makes sense.

The Python module will use HOME directly if it's set. If it is not set,
the standard C library routines will be used to obtain HOME information
from /etc/passwd (or whatever /etc/nsswitch.conf is set to).

As such, for HOME explicitly, there is no need to have any form of
wrapper at all; Python will just work with sendmail.

I would guess then that most MTAs simply clear, or never set, the HOME
variable and hence Python always "falls back" to C library routines.

> The wrapper is only about 25 lines of c code.  Very straight forward
> once you know HOME has to be set.  That should be included in the
> documentation rather than presuming its set magically by something else.

There's no need to document anything - when TMDA is run from the
intended environment (sendmail, postfix, qmail, exim, ...) it will just
work.

In your tests, you were running tmda-rfilter from an unsupported
environment, with actively incorrect information (i.e. HOME was set to
root's home). As such, it's not surprising that things didn't work as
expected.

The other variables that TMDA relies on are all well documented, with
two different examples of how to set them up for sendmail (via procmail
and maildrop.)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFXeqNhk3bo0lNTrURAnZ7AJ0fPgiDcFe/KxEMTyN9SmXLTAHQiQCgwUkO
FJ1ubq0adCaOXX/U9YJuT3M=
=utP+
-----END PGP SIGNATURE-----
_____________________________________________
tmda-users mailing list ([email protected])
http://tmda.net/lists/listinfo/tmda-users

Reply via email to