4 messages in net.sourceforge.lists.courier-maildrop[maildropl] Re: Setting environment v...
FromSent OnAttachments
Courier UserNov 16, 2003 5:07 pm 
Matthias AndreeNov 17, 2003 6:29 am 
Courier UserNov 17, 2003 7:02 am 
Courier UserJan 15, 2004 4:45 am.patch
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[maildropl] Re: Setting environment variable in maildrop to "" deletes it?Actions...
From:Courier User (cour@asfast.net)
Date:Nov 17, 2003 7:02:48 am
List:net.sourceforge.lists.courier-maildrop

Matthias Andree <ma+cou@dt.e-technik.uni-dortmund.de> writes:

Courier User <cour@asfast.net> writes:

Even though maildrop appears to treat these two cases identically, child processes invoked via xfilter and other means could have problems with this. This happens because environment variables are inherited by child processes, which in the general case cannot be counted on to look at these two instances as being equivalent ... and in quite a few common cases, they do not. ... Thoughts?

Check out the env(1) command.

Untested:

xfilter 'env VARIABLE= /usr/local/bin/your-command'

Yes, this works. And in fact, I'm already doing this as a workaround to the current maildrop behavior.

However, I still think that it is misleading that the following statement causes the environment variable to be deleted intead of being bound to an empty string:

VARIABLE=""

Also, it becomes quite unwieldy to use this 'env' method when there are a number of variables that are set to "" ... each one has to be mentioned multiple times: once in the maildroprc or .mailfilter file if the variable is referenced there; and the second through n-th times after 'env' on the command line of every xfilter command which might use the variables.

It seems to me that it would be a lot clearer, and less in violation of "The Principle of Least Surprise", if maildrop's behavior is changed the way I described in my previous email.