From owner-freebsd-questions@FreeBSD.ORG Thu Oct 4 08:16:12 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F9DC16A419 for ; Thu, 4 Oct 2007 08:16:12 +0000 (UTC) (envelope-from erikt@midgard.homeip.net) Received: from ch-smtp01.sth.basefarm.net (ch-smtp01.sth.basefarm.net [80.76.149.212]) by mx1.freebsd.org (Postfix) with ESMTP id A7AD613C45A for ; Thu, 4 Oct 2007 08:16:11 +0000 (UTC) (envelope-from erikt@midgard.homeip.net) Received: from c83-253-31-60.bredband.comhem.se ([83.253.31.60]:62705 helo=falcon.midgard.homeip.net) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.66) (envelope-from ) id 1IdLsQ-0004D3-5O for freebsd-questions@freebsd.org; Thu, 04 Oct 2007 10:16:10 +0200 Received: (qmail 46785 invoked from network); 4 Oct 2007 10:16:07 +0200 Received: from owl.midgard.homeip.net (10.1.5.7) by falcon.midgard.homeip.net with ESMTP; 4 Oct 2007 10:16:07 +0200 Received: (qmail 65538 invoked by uid 1001); 4 Oct 2007 10:16:07 +0200 Date: Thu, 4 Oct 2007 10:16:07 +0200 From: Erik Trulsson To: Ian Smith Message-ID: <20071004081607.GA65363@owl.midgard.homeip.net> Mail-Followup-To: Ian Smith , Lisa Casey , freebsd-questions@freebsd.org References: <20071004002231.CF6ED16A4A0@hub.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.16 (2007-06-09) X-Originating-IP: 83.253.31.60 X-Scan-Result: No virus found in message 1IdLsQ-0004D3-5O. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1IdLsQ-0004D3-5O a105c2e59af51a6cdb078db48ed0f354 Cc: freebsd-questions@freebsd.org, Lisa Casey Subject: Re: FreeBsd e-mail question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Oct 2007 08:16:12 -0000 On Thu, Oct 04, 2007 at 04:56:35PM +1000, Ian Smith wrote: > On Wed, 3 Oct 2007 16:30:54 -0400 Lisa Casey wrote: > > > The problem comes in when a customer cancels his account. We remove users by > > rmuser username. That command removes the user from the password file, > > removes his home directory and removes the mailspool. What it doesn't do is > > to remove the .username.pop file associated with that mailbox. This isn't a > > problem unless we add another account with the same username. The new > > account cannot pop his mail because he gets the following error messge: > > > > -ERR [SYS/PERM] Temporary drop /var/mail/.jjvc.pop not owned by jjvc. > > > > If I take a look at /var/mail/.jjvc.pop it isn't owned by anyone, the > > ownership of the file is the group number of the original jjvc. > > > > -rw-rw---- 1 1473 mail 0 Sep 11 19:15 > > .jjvc.pop > > > > Is there anyway to have rmuser remover the mail drop file associated with > > that account also, or am I just going to have to remove these manually? > > I've read this whole thread, and what's strange is that this used to > work. I just checked our old FreeBSD 2.2.6 system where rmuser always > cleaned up /var/mail/.{$user}.pop properly. Its /usr/sbin/rmuser had: > > # Remove some pop daemon's leftover file > $file = "$mail_dir/.${login_name}.pop"; > if (-e $file || -l $file) { > print STDERR "Removing pop daemon's temporary mail file ${file}:"; > unlink $file || > print STDERR "\n${whoami}: Warning: unlink on $file failed ($!) - continuing\n"; > print STDERR " done.\n"; > } > > So I wonder whether it's a bug - or maybe a later popper update? - that > has the present version of rmuser looking for ${MAILSPOOL}/${login}.pop > instead? As far as I can tell the change was introduced back in 2002 when rmuser was changed from a Perl program into a shell script - presumably as part of the process of removing Perl from the base system. FreeBSD versions 2.2 - 4.11 used the Perl version of rmuser, while all 5.x and 6.x releases have used the shell script version. I have no idea if the difference - if the file rmuser looks for has a leading '.' in the filename or not - was deliberate or simply a mistake, but I suspect the latter: it is the kind of thing that is very easy to miss when rewriting a program in another language. -- Erik Trulsson ertr1013@student.uu.se