> I would like to be able to log all subscriptions and un-subscriptions on my
> list. right now it is a  basic ezmlm-idx list on a freebsd 4.1 box. I tried
> to look thru the .qmail files to see if I could add my email address to one
> of them but I could not find the one that handles the unsub/sub commands.
> 
> any help with this would be appreciated.

ezmlm-idx already logs all subscriptions and unsubscriptions in the Log files.

Below is a short perl program that will list all of the activity in the past
week.
--
Mike Nolan


#!/usr/bin/perl

$[=1;  # array base
$\="\n";
$,="";

$today=time;
#print $today;

open (FILES, "ls -lt /var/qmail/alias/*/Log /var/qmail/alias/*/*/Log|");

#$_=<FILES>;
#chop;
#print $_;

while (<FILES>) {
chop;
#print $_;
@Fld = split(' ', $_, 9999);
$file = $Fld[9];
open (MSG, "tail $Fld[9]|");
while (<MSG>) {
   chop;
   #print $_;
   @Fld = split(' ', $_, 9999);
   ($sec,$min,$hour,$mday, $mon, $year, $wday, $yday, $isdt) 
      = localtime($Fld[1]);
   $x=$_;
   if ($Fld[1] > $today -609000) {
      if (length($file) > 5) {
         print substr($file,18);
         undef $file;
      }
      print "     ", $mon+1,"/",$mday, "/", $year+1900, " ", $hour, ":", 
      substr($min+100,2), " ", 
      $Fld[2], " ", $Fld[3];
   }

} #end of Log file

} #end of list of log file names
exit;

Reply via email to