last time a user has consulted his/her mailbox
Bartosz Jozwiak
bartek at cq-link.sr
Fri May 23 07:31:49 EDT 2003
It is possible to check when the user login last time.
But u have to use PAM auth with mysql database.
Regards,
Bartosz
----- Original Message -----
From: "Paul M Fleming" <pfleming at siumed.edu>
To: <dreamwvr at dreamwvr.com>
Cc: <info-cyrus at lists.andrew.cmu.edu>
Sent: Wednesday, May 21, 2003 11:40 AM
Subject: Re: last time a user has consulted his/her mailbox
> look at the fud client.. (not sure if CMU is still supporting it)
> Mailboxes must have acl 0 set for the anonymous user for it to work..
>
> imap.here.net> lam user.pfleming
> anonymous 0
> pfleming lrswipcda
>
> and the client in perl
>
> #!/usr/bin/perl -w
>
> # perl port of contrib/fud-client.c that comes with the Cyrus IMAP
> # distribution (http://asg.web.cmu.edu/)
> # Written by Jason Englander <jason at englanders.cc>
> # July 3, 2002
>
> use Socket;
> use Sys::Hostname;
> use strict;
>
> my ($hisiaddr, $hispaddr, $iaddr, $paddr, $port, $proto, $resp);
>
> my $server = $ARGV[0];
> my $user = $ARGV[1];
> my $mailbox = $ARGV[2];
>
> die "\nUsage: $0 server user mailbox\n\n" if ! $server || ! $user || !
> $mailbox;
>
> $iaddr = gethostbyname(hostname());
> $proto = getprotobyname('udp');
> $port = getservbyname('fud', 'udp');
> $paddr = sockaddr_in(0, $iaddr);
>
> socket(SOCKET, PF_INET, SOCK_DGRAM, $proto) || die "socket: $!";
> bind(SOCKET, $paddr) || die "bind: $!";
>
> $| = 1;
> $hisiaddr = inet_aton($server) || die "unknown host";
> $hispaddr = sockaddr_in($port, $hisiaddr);
> defined(send(SOCKET, "$user|$mailbox", 0, $hispaddr)) || die "send
> $server: $!";
>
> recv(SOCKET, $resp, 512, 0) || die "recv: $!";
> close(SOCKET);
> my $resp_str = unpack('A*',$resp);
> if ("$resp_str" eq "UNKNOWN") { printf "Server did not recognize mailbox
> %s\n", $mailbox; }
> elsif ("$resp_str" eq "PERMDENY") { printf "Permission denied attempting
> get mailbox info for %s", $mailb
> ox; }
> else {
> my ($uname,$mbox,$numrecent,$lread,$lappend) = split('\|',$resp_str);
> printf "user: %s\nmbox: %s\nNumber of Recent %d\n", $uname, $mbox,
> $numrecent;
> $lread = localtime($lread);
> printf "Last read: %s\n", $lread;
> $lappend = localtime($lappend);
> printf "Last arrived: %s\n", $lappend;
> }
>
>
>
>
> "dreamwvr at dreamwvr.com" wrote:
> >
> > On Wed, May 21, 2003 at 08:28:00AM +0200, Laurent LAVAUD wrote:
> > > Hello,
> > >
> > > Is there a way to know when a user has read his/her mailbox for the
last time ?
> > >
> > man stat
> > You can write a small program in PERL or C that traverses users
> > mailbox to check the status. YMMV
> >
> > HIH
> > Best Regards,
> > dreamwvr at dreamwvr.com
> >
> > --
> > /* Security is a work in progress - dreamwvr */
> > # 48 69 65 72 6F 70 68 61 6E 74 32
> > # Note: To begin Journey type man afterboot,man help,man hier[.]
> > # 66 6F 72 20 48 69 72 65 0000 0001
> > // "Who's Afraid of Schrodinger's Cat?" /var/(.)?mail/me \? ;-]
>
More information about the Info-cyrus
mailing list