> -----Original Message-----
> From: J. Kendzorra [mailto:[EMAIL PROTECTED] 
> Sent: Friday, June 27, 2003 3:43 PM
> To: [EMAIL PROTECTED]
> Subject: [Qmail-scanner-general]Environment variables
> 
> 
> Hello list,
> I searched the archive for that, but didn't find anything:
> I'd like to use SpamAssassin with user_prefs for every user, so spamc 
> has to be called with "-u"-switch. In maildrop-scripts you do 
> that with 
> "-f -u [EMAIL PROTECTED]", so I put the following into 
> qmail-scanner-queue.pl: my $spamc_options='-f -u [EMAIL PROTECTED]'; 
> The result is, that [EMAIL PROTECTED] is empty as you can see from 
> spamd: clean message (-1.9/5.0) for @:89 in 4.0 seconds, 2500 bytes.
> 
> I'm no programmer at all, especially not perl, so I'd just 
> like to know 
> how to get these ENV to work with qs. I've seen that some env are 
> deleted at the beginning, maybe I'd need a change there?
> I can't do that job with maildrop because I'd lose some functionality 
> then.
> Thanks,
> Juergen
> 
> 

you might be able to reference them by using 
$ENV{'EXT'} and $ENV{'HOST'} instead... since they are enviroment
variables and not local vars like $EXT and $HOST are.  if you want to
use $EXT and $HOST, you would need to

($EXT,$HOST) = split(/\@/,$recips) if ($recips !~ m/\,/); 

then you could use them.   Okay... here is how i do it
change your spamassassin function to do something like this instead....

  if (($recips =~ m/\,/g) || ($recips eq "") || (!defined $recips)) {
  open(SA,"$spamc_binary $spamc_options <
$scandir/$wmaildir/new/$file_id|")||&tempfail("cannot run $spamc_binary
< $scandir/$wmaildir/new/$file_id - $!");
  }
  else {
  open(SA,"$spamc_binary $spamc_options -u '$recips' <
$scandir/$wmaildir/new/$file_id|")||&tempfail("cannot run $spamc_binary
< $scandir/$wmaildir/new/$file_id - $!");
  }

you can only process per-user configs for a single recipient, so the
$recips variable which contains the "rcpt to:" from the smtp envelope
will give you what you need.  if there where more than 1 rcpt to:
specified, the list will be   [EMAIL PROTECTED],[EMAIL PROTECTED],etc and therefore
you cannot process per-user settings, so global sql prefs will be used.

dallas




-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_______________________________________________
Qmail-scanner-general mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/qmail-scanner-general

Reply via email to