"Mitch \(WebCob\)" <[EMAIL PROTECTED]> writes:
> Jason on TMDA list mentioned these threads:
>
> See http://thread.gmane.org/gmane.mail.imap.courier.general/13703
> http://thread.gmane.org/gmane.mail.maildrop/1831
>
> they quote this code which deletes empty env vars...:
> and some external programs rely on the existance of those env's even if
> empty!
It's more than just _some_ programs. For one example out of many, any
program built with the standard C libraries in Unix is apt to be
affected by this behavior, as the getenv() function returns different
values for a missing environment variable and one that is set to "".
Many programs behave differently depending on this return value.
> The following snippet of code in the SetVar function in
> maildrop/varlist.C illustrates this behavior:
>
> if (value.Length() == 0) // Delete variable
> {
> Variable **v;
>
> for (v= &varlist[n]; *v; v= &(*v)->next)
> if ( (*v)->name == var )
> {
> Variable *vv= (*v);
>
> (*v)= vv->next;
> delete vv;
> break;
> }
> return;
> }
Could someone (Sam?) explain why that 'delete' statement exists? Is
there part of maildrop or courier that depends on this odd behavior?
> They suggest:
>
> xfilter "env VARIABLE=$VARIABLE /usr/local/bin/your-command"
>
> WHICH SEEMS TO WORK?
>
> BUT, Sam told me a little while ago that env didn't pipe std in (I was
> delivering a cc to it to capture some stuff) so I thought that meant it
> wouldn't work here...
>
> Confused...
Try this on your machine:
% echo foo | /usr/bin/env A=B /bin/cat
foo
As you can see, "foo" was output, which means that at least my "env"
does indeed allow stdin to get piped through (on FreeBSD 4.0).
--
Courier User
[EMAIL PROTECTED]
-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users