Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Qmail: users

How to include value of an environment variable in a tcp rule

 

 

Qmail users RSS feed   Index | Next | Previous | View Threaded


sagaralists at yahoo

Oct 13, 2003, 11:23 AM

Post #1 of 2 (1069 views)
Permalink
How to include value of an environment variable in a tcp rule

Hi all

The tcpserver program sets up several environment
variables (eg. $TCPLOCALIP, TCPREMOTEIP, etc.) for TCP
connections.

Is it possible to include the value of an environment
variable in a tcp rule to create a new environment
variable?

Eg.
:allow,NEWVAR="something/Value of
$TCPLOCALIP/something"

If this is possible, please also indicate exact syntax
how to write it.

Thanks

Regards
Sagara


__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com


sgifford at suspectclass

Oct 13, 2003, 10:50 PM

Post #2 of 2 (964 views)
Permalink
Re: How to include value of an environment variable in a tcp rule [In reply to]

Sagara Wijetunga <sagaralists[at]yahoo.com> writes:

> Hi all
>
> The tcpserver program sets up several environment
> variables (eg. $TCPLOCALIP, TCPREMOTEIP, etc.) for TCP
> connections.
>
> Is it possible to include the value of an environment
> variable in a tcp rule to create a new environment
> variable?
>
> Eg.
> :allow,NEWVAR="something/Value of
> $TCPLOCALIP/something"

[...]


Not this way, but you can accomplish this by having tcpserver call a
wrapper script. For example, if you're currently running

tcpserver 0 25 /var/qmail/bin/qmail-smtpd

you could change it to

tcpserver 0 25 /var/qmail/bin/env-wrapper /var/qmail/bin/qmail-smtpd

and have env-wrapper be a short shell script like this:

#!/bin/sh

NEWVAR="something/$TCPLOCALIP/something"
export NEWVAR
exec "$@"

----ScottG.

Qmail users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.