> -----Original Message-----
> From: Johan Kuuse - Red Antigua [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, March 12, 2003 10:32 AM
> To: Dallas Engelken
> Subject: Re: [Qmail-scanner-general]Expected Performance Degradation
> 
> 
> Very interesting discussion.
> Anyone has tried compiling qmail-scanner inte C (perlfaq3)?
> Would that help?
> 

I'm not sure what you are referring to here: inte C?

I took qmail-scanner-queue.pl and trimmed everything out, into a little script that I 
could test perl vs. suidperl vs. perperl.  here is my script and my results...

#!/usr/bin/suidperl -w
#!/usr/bin/perl -w 
#!/usr/bin/perperl -w -- -M20 -r5
# START TEST, RUN 3 TIMES USING DIFFERENT INTERPRETERS LISTED ABOVE
# * requires (777 perms for perl to write, or chown on the maildir):  
#   maildirmake /tmp/working
#   chmod -R 0777 /tmp/working

 my $scandir = "/tmp";
 my $file_id = &uniq_id();

 select(STDIN); $|=1;

 mkdir("$scandir/$file_id",0700);
 chdir("$scandir/$file_id/");

 open(F,">$scandir/working/tmp/$file_id") or print "Cannot write tmp";
 while (<STDIN>) {
   chomp($_);
   &debug("STDIN: $_");
   print F $_ . "\n";
 }
 close(F);

 rename("$scandir/working/tmp/$file_id",
        "$scandir/working/new/$file_id");

 close(STDIN);

  select(STDOUT); $|=1;

  open(SOUT,"<&STDOUT");
  while (<SOUT>) {
    &debug("SOUT LINE: $_");
    ($env_returnpath,$env_recips) = split(/\0/,$_,2);
  }

exit;

#############################

sub uniq_id {
  my $time = time();
  &debug($time);
  return "mailgw.$time";
}

##############################

sub debug {

 my $log = shift;

  open (T,">>/tmp/debug.log");
  flock(T,2);
  print T $log . "\n";
  close (T);
}

##############################
# EOF



DEBUG OUTPUT UNDER PERL
------------------------
STDIN: Received: from unknown (HELO nmgi.com) (64.217.128.161)
STDIN:   by 0 with SMTP; 13 Mar 2003 15:42:08 -0000
STDIN: Message-ID: <[EMAIL PROTECTED]>
STDIN: Date: Thu, 13 Mar 2003 09:42:07 -0600
STDIN: From: Dallas Engelken <[EMAIL PROTECTED]>
STDIN: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3a) 
Gecko/20021212
STDIN: X-Accept-Language: en-us, en
STDIN: MIME-Version: 1.0
STDIN: To:  [EMAIL PROTECTED]
STDIN: Subject: hi
STDIN: X-Enigmail-Version: 0.72.0.0
STDIN: X-Enigmail-Supports: pgp-inline, pgp-mime
STDIN: Content-Type: text/plain; charset=us-ascii; format=flowed
STDIN: Content-Transfer-Encoding: 7bit
STDIN: 
STDIN: hi
STDIN: 
SOUT LINE: [EMAIL PROTECTED]@nmgi.com 


DEBUG OUTPUT UNDER SUIDPERL
--------------------------
STDIN: Received: from unknown (HELO nmgi.com) (64.217.128.161)
STDIN:   by 0 with SMTP; 13 Mar 2003 15:43:06 -0000
STDIN: Message-ID: <[EMAIL PROTECTED]>
STDIN: Date: Thu, 13 Mar 2003 09:43:06 -0600
STDIN: From: Dallas Engelken <[EMAIL PROTECTED]>
STDIN: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3a) 
Gecko/20021212
STDIN: X-Accept-Language: en-us, en
STDIN: MIME-Version: 1.0
STDIN: To:  [EMAIL PROTECTED]
STDIN: Subject: hi
STDIN: X-Enigmail-Version: 0.72.0.0
STDIN: X-Enigmail-Supports: pgp-inline, pgp-mime
STDIN: Content-Type: text/plain; charset=us-ascii; format=flowed
STDIN: Content-Transfer-Encoding: 7bit
STDIN: 
STDIN: hi
STDIN: 
SOUT LINE: [EMAIL PROTECTED]@nmgi.com



DEBUG OUTPUT UNDER PERPERL
----------------------------
STDIN: Received: from unknown (HELO nmgi.com) (64.217.128.161)
STDIN:   by 0 with SMTP; 13 Mar 2003 15:40:22 -0000
STDIN: Message-ID: <[EMAIL PROTECTED]>
STDIN: Date: Thu, 13 Mar 2003 09:40:21 -0600
STDIN: From: Dallas Engelken <[EMAIL PROTECTED]>
STDIN: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3a) 
Gecko/20021212
STDIN: X-Accept-Language: en-us, en
STDIN: MIME-Version: 1.0
STDIN: To:  [EMAIL PROTECTED]
STDIN: Subject: hi
STDIN: X-Enigmail-Version: 0.72.0.0
STDIN: X-Enigmail-Supports: pgp-inline, pgp-mime
STDIN: Content-Type: text/plain; charset=us-ascii; format=flowed
STDIN: Content-Transfer-Encoding: 7bit
STDIN: 
STDIN: hi
STDIN:


perl and suidperl both have a line of STDOUT.  perperl does not.  WTF.
dallas






> ----- Original Message -----
> From: "Dallas Engelken" <[EMAIL PROTECTED]>
> To: "Dallas Engelken" <[EMAIL PROTECTED]>; "Rick Romero" 
> <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> Sent: Tuesday, March 11, 2003 4:38 PM
> Subject: RE: [Qmail-scanner-general]Expected Performance Degradation
> 
> 
> > -----Original Message-----
> > From: Dallas Engelken
> > Sent: Tuesday, March 11, 2003 3:27 PM
> > To: Rick Romero; [EMAIL PROTECTED]
> > Subject: RE: [Qmail-scanner-general]Expected Performance Degradation
> >
> >
> > > -----Original Message-----
> > > From: Rick Romero [mailto:[EMAIL PROTECTED]
> > > Sent: Tuesday, March 11, 2003 1:28 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: Re: [Qmail-scanner-general]Expected Performance 
> Degradation
> > >
> > >
> > > On Tue, 2003-03-11 at 13:05, Ryan Finnie wrote:
> > > > On Tue, 11 Mar 2003, D.Monroe wrote:
> > > > > By far, the biggest "hit" (running just Q-S) is likely
> > due to the
> > > > > overhead of the perl interpreter and the perlscan
> > > body/attachment searches.
> > > >
> > > > I've been thinking about that...  there's not much you can
> > > do about the
> > > > overhead for decompiling the messages before being scanned,
> > > but the act of
> > > > actually loading the full perl script each time a message
> > > comes in is a
> > > > significant hit.  What I'd be interested in seeing is a
> > > method similar to
> > > > SA's spamd/spamc system, where the Q-S program is loaded as
> > > a separate
> > > > process, listens for connections (either via TCP of UNIX
> > > sockets), and
> > > > does its thing.
> > >
> > > Has anyone tried this:
> > > http://daemoninc.com/PersistentPerl/
> > >
> >
> > I've been trying to do this, but cant seem to read &STDOUT
> > when i change to to #!/usr/bin/perperl (yes i setuid on
> > perperl to qmailq and changed qmail-scanner to just 0750).
> >
> > since i cant grab STDOUT, i get
> > 2003-03-11 15:24:09:8283: g_e_h: no sender and no recips.
> >
> > i'm not sure where to go from here, but I'm working on it.
> >
> > dallas
> >
> >
> 
> well.. i've spent an hour on this and have come to the the 
> conclusion that
> grab_envelope_hdrs() does not get the 1 line it is expecting 
> from STDOUT.
> Where does this line go when running through perperl?
> 
>   select(STDOUT);
>   $|=1;
>   open(SOUT,"<&STDOUT") || &tempfail("cannot dup fd 0 - $!");
> 
> should give me something like "[EMAIL PROTECTED]@test.com\0\0"
> right... which is just not there anymore.  STDIN is cool, the 
> message dumps
> to a file, renames, reformime and tnef run fine on it, but once that
> grab_envelope_hdrs() call comes...
> 
> help!
> 
> dallas
> 
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by:Crypto Challenge is now open!
> Get cracking and register here for some mind boggling fun and
> the chance of winning an Apple iPod:
> http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
> _______________________________________________
> Qmail-scanner-general mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/qmail-scanner-general
> 
> 


-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open!
Get cracking and register here for some mind boggling fun and
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
_______________________________________________
Qmail-scanner-general mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/qmail-scanner-general

Reply via email to