From owner-freebsd-questions@FreeBSD.ORG Wed Jun 25 13:39:12 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 370B437B401 for ; Wed, 25 Jun 2003 13:39:12 -0700 (PDT) Received: from mwinf0302.wanadoo.fr (smtp6.wanadoo.fr [193.252.22.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id CEA7943FCB for ; Wed, 25 Jun 2003 13:39:10 -0700 (PDT) (envelope-from david@landgren.net) Received: from landgren.net (APastourelles-107-1-7-23.w217-128.abo.wanadoo.fr [217.128.208.23]) by mwinf0302.wanadoo.fr (SMTP Server) with ESMTP id 47B3EC0002CC for ; Wed, 25 Jun 2003 22:39:09 +0200 (CEST) Message-ID: <3EFA0882.7070304@landgren.net> Date: Wed, 25 Jun 2003 22:39:30 +0200 From: David Landgren Organization: Oh smear this man across the walls/Like strawberries and cream/It's the only way to be User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030612 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-questions@FreeBSD.ORG References: <5.2.0.9.2.20030625160311.00a09b10@pop.voyager.net> In-Reply-To: <5.2.0.9.2.20030625160311.00a09b10@pop.voyager.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: Need a little help with a proof of concept cgi. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jun 2003 20:39:12 -0000 Dragoncrest wrote: > hi all. I've got a little proof of concept idea I want to do and I > was looking to get some advice from some of the CGI experts on this list > to help me with it. What I want to do is simple. I have like 3 users I > want to track and retrieve the following stats on. > > 1. Total number of total messages received since XX date @ xx > time. (since last clearing of counter) > 2. Total number of messages filtered as spam. > 3. Total number of messages filtered as viruses. > > I'm sure that there has to be a way to do a very simple cgi script > that will be able to be called each time an email is received and after > it is sorted so as to increment the individual counters related to each > of the sorting criteria. Then when someone loads the cgi script via a Unclear on the concept. I think you want to separate the tallying of stats from the display. The stats can be kept up to date via procmail recipes, content filtering or logfile tailing. That happens all the time. When someone hits your CGI script, you only have to retrieve the statistics, whether they be from a flat file, a DBM file or a database table, and format the results as you see fit. This way you can also produce a test browser that works from the command line. > web browser off your web server they can see the stats for each user and > clear the counters/mailboxes if necessary. The stats would be my > biggest concern. I'm no huge cgi expert and I also figured that this > might be useful for a lot of other people in some form so I'm sharing > the idea in hopes that those of you with more experience with CGI might > be able to come up with a working cgi script. I don't think it will be > anything huge, but I'm unsure where to start. Thanks for the input > everyone! :) First off, start gathering your stats. That has nothing to do with CGI, and will probably present enough challenges as it is to keep you busy for a while. You might also want to look at packages that do this sort of thing already, like mailgraph. (But otherwise your idea sounds like an excellent learning opportunity). Good luck, DAvid