Jeff T. Carneal <jeff@apex.apex.net> asks:
>
>I'm trying to setup a perl script ala qmail-command which will only allow
>certain addresses to send to a particular address. For example,
>jeff-blah@apex.net will bounce everybody that sends to it except for me
>(jeff@apex.net).
>
>Now, I understand that qmail-alias provides environment variables to a
>command in .qmail (such as |my-script.pl). The one I'm interested in
>(obviously) is the SENDER environment variable. However, I can't seem to
>get my script to find it. What exactly do I have to do to get to that
>variable?
>
This sounds like more of a Perl question than a qmail one, but the
answer is fairly simple. In Perl, environment variables are found
in the %ENV hash (associative array). So a statement like:
$sender_address = $ENV{'SENDER'};
should retrieve it for you.
-Greg
--
Greg Andrews West Coast Online
Unix System Administrator 5800 Redwood Drive
gerg@wco.com Rohnert Park CA 94928
(yes, 'greg' backwards) 1-800-WCO-INTERNET
>
>I'm trying to setup a perl script ala qmail-command which will only allow
>certain addresses to send to a particular address. For example,
>jeff-blah@apex.net will bounce everybody that sends to it except for me
>(jeff@apex.net).
>
>Now, I understand that qmail-alias provides environment variables to a
>command in .qmail (such as |my-script.pl). The one I'm interested in
>(obviously) is the SENDER environment variable. However, I can't seem to
>get my script to find it. What exactly do I have to do to get to that
>variable?
>
This sounds like more of a Perl question than a qmail one, but the
answer is fairly simple. In Perl, environment variables are found
in the %ENV hash (associative array). So a statement like:
$sender_address = $ENV{'SENDER'};
should retrieve it for you.
-Greg
--
Greg Andrews West Coast Online
Unix System Administrator 5800 Redwood Drive
gerg@wco.com Rohnert Park CA 94928
(yes, 'greg' backwards) 1-800-WCO-INTERNET