I'm running 3.01
qpopper.
so I'm trying to incorporate this but my c is POOR indeed... was 811 the
last line in the file?
the 3.01 version has about 1600 lines in it.
-chad
-----Original Message-----
From: Karl Vogel [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 14, 2001 8:26 PM
To: [EMAIL PROTECTED]
Subject: Re: Qpopper and Qmail logging
>> On Mon, 14 May 2001 14:41:18 -0700,
>> "Chad Owens" <[EMAIL PROTECTED]> said:
C> I have been tasked with the need to log USERNAMES that are downloading
C> pop. The reason is that we use both imap and pop here and want to phase
C> out pop.
C> So how can I create a log of all the people using POP (via qpopper) to
C> access their mail (delivered with Qmail). (solaris).
I don't know what version of qpopper you're using, but I added some code
in v2.53 to do this. Userids will show up in syslog. The right place
is in pop_dropcopy.c:
...
810 /* Now we run as the user. */
811 (void) setgid((GID_T)pwp->pw_gid);
812 (void) setgroups(1,(GID_T *)&pwp->pw_gid);
/* Set the supplementary groups list */
813 (void) setuid((UID_T)pwp->pw_uid);
814
815 /* Added by KEV: log all usernames. */
816 pop_log (p, POP_PRIORITY, "uname=%s, uid=%d, gid=%d",
817 pwp->pw_name, getuid (), getgid ());
...
You might also want to check for passwords that must be changed, in
pop_pass.c:
188 /* Check if password is valid */
189 if (pwd->sp_max > 0 && today > pwd->sp_lstchg+pwd->sp_max)
{
190 sleep(SLEEP_SECONDS);
191 return (pop_msg(p,POP_FAILURE,"\"%s\": account
expired.",p->user));
192 }
193
194 /* Added: check if password must be changed */
195 if (pwd->sp_lstchg == 0) {
196 sleep(SLEEP_SECONDS);
197 return (pop_msg(p,POP_FAILURE,"\"%s\": change your password.",
198 p->user));
199 }
200
201 pw->pw_passwd = (char *)strdup(pwd->sp_pwdp);
202 endspent();
--
Karl Vogel <[EMAIL PROTECTED]>
ASC/YCOA, Wright-Patterson AFB, OH 45433, USA
Drinking provides a beautiful excuse to pursue the one activity that
truly gives me pleasure: hooking up with fat, hairy girls. --Ross Levy