Re: FreeBsd e-mail question
On Fri, Oct 05, 2007 at 02:33:23AM +1000, Ian Smith wrote: > > Looks like that's exactly right. Copying the maintainer and suggesting > the no-brain patch, pardon the broken tabs from pasting, against the > head / stable versions (checked) .. I should sendPR I guess .. time! > > Cheers, Ian > > --- /usr/sbin/rmuserSat Mar 3 16:48:29 2007 > +++ /home/smithi/rmuser Fri Oct 5 00:30:51 2007 > @@ -86,10 +86,10 @@ > echo -n " mailspool" > rm ${MAILSPOOL}/$login > fi > - if [ -f ${MAILSPOOL}/${login}.pop ]; then > - verbose && echo -n " ${MAILSPOOL}/${login}.pop" || > + if [ -f ${MAILSPOOL}/.${login}.pop ]; then > + verbose && echo -n " ${MAILSPOOL}/.${login}.pop" || > echo -n " pop3" > - rm ${MAILSPOOL}/${login}.pop > + rm ${MAILSPOOL}/.${login}.pop > fi > verbose && echo '.' > } > Thanks! I'll take care of this immediately. Cheers, Mike. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: FreeBsd e-mail question
On Thu, 4 Oct 2007, Erik Trulsson wrote: > On Thu, Oct 04, 2007 at 04:56:35PM +1000, Ian Smith wrote: > > On Wed, 3 Oct 2007 16:30:54 -0400 Lisa Casey <[EMAIL PROTECTED]> 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. Looks like that's exactly right. Copying the maintainer and suggesting the no-brain patch, pardon the broken tabs from pasting, against the head / stable versions (checked) .. I should sendPR I guess .. time! Cheers, Ian --- /usr/sbin/rmuserSat Mar 3 16:48:29 2007 +++ /home/smithi/rmuser Fri Oct 5 00:30:51 2007 @@ -86,10 +86,10 @@ echo -n " mailspool" rm ${MAILSPOOL}/$login fi - if [ -f ${MAILSPOOL}/${login}.pop ]; then - verbose && echo -n " ${MAILSPOOL}/${login}.pop" || + if [ -f ${MAILSPOOL}/.${login}.pop ]; then + verbose && echo -n " ${MAILSPOOL}/.${login}.pop" || echo -n " pop3" - rm ${MAILSPOOL}/${login}.pop + rm ${MAILSPOOL}/.${login}.pop fi verbose && echo '.' } ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: FreeBsd e-mail question
On Thu, Oct 04, 2007 at 04:56:35PM +1000, Ian Smith wrote: > On Wed, 3 Oct 2007 16:30:54 -0400 Lisa Casey <[EMAIL PROTECTED]> 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 [EMAIL PROTECTED] ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: FreeBsd e-mail question
On Wed, 3 Oct 2007 16:30:54 -0400 Lisa Casey <[EMAIL PROTECTED]> 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? Cheers, Ian ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: FreeBsd e-mail question
Hi, 2) Better option is to change the default temp-name in qpopper.config: set temp-name "%s.pop" so that rmuser will detect it automatically. A third option is to write a wrapper shell script that first calls rmuser and then removes the remaining mail drop file, and use this script to remove users instead of calling rmuser directly. Option 2) above sounds like a better solution though. I agree, that sounds like the best solution. Just to be on the safe side, I think I'll make a backup of rmuser first ;-) Thanks for all the suggestions. Lisa Casey ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: FreeBsd e-mail question
At 03:30 PM 10/3/2007, Lisa Casey wrote: Hi, I'm running Sendmail and Qpopper on FreeBsd. (And perhaps I ought to be asking this on the Qpopper list, but hopefully someone here knows an answer). We have all of our mailboxes in mbox format in /var/mail. When a customer pops his mail for the first time it creates a file .username.pop in /var/mail which never goes away, it remains as a zero byte file. It's quite useful as we can tell from the timestamp on it when the customer last popped his mail. 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? Thanks, Lisa Casey Lisa, rmuser only removes the system dependent files that adduser creates. You would need to creat your own shell script to remove the qpopper file and to call rmuser. Remember the basic utilities are meant to manage the core services, not add-on ports. -Derek ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]" -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks transtec Computers for their support. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks transtec Computers for their support. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: FreeBsd e-mail question
On Wed, Oct 03, 2007 at 11:04:58PM +0200, Mel wrote: > On Wednesday 03 October 2007 22:30:54 Lisa Casey wrote: > > > 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? > > rmuser is a shell script. There's 2 ways to solve this problem: > 1) edit the rm_mail function in /usr/sbin/rmuser to use: >${MAILSPOOL}/.${login}.pop > 2) Better option is to change the default temp-name in qpopper.config: >set temp-name "%s.pop" >so that rmuser will detect it automatically. A third option is to write a wrapper shell script that first calls rmuser and then removes the remaining mail drop file, and use this script to remove users instead of calling rmuser directly. Option 2) above sounds like a better solution though. -- Erik Trulsson [EMAIL PROTECTED] ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: FreeBsd e-mail question
On Wed, Oct 03, 2007 at 04:30:54PM -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? Since rmuser is a shell-script, you could easily change it to suit your needs. Look at the function rm_mail (lines 79-95), and change '${login}.pop' to '.${login}.pop' in line 89,90 and line 92. A more elegant approach would be to duplicate lines 89-93 and add the dot before the login in the second instance, changeing " pop3" to " qpopper" as well. If you make this change, do not forget to re-apply it after doing a installworld. :-) Roland -- R.F.Smith http://www.xs4all.nl/~rsmith/ [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725) pgpZJ3KArWwo8.pgp Description: PGP signature
Re: FreeBsd e-mail question
> 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? It really depends on what version of rmuser you have. In /usr/sbin/rmuser, do you have something similar to this code snippet?: if [ -f ${MAILSPOOL}/${login}.pop ]; then verbose && echo -n " ${MAILSPOOL}/${login}.pop" || echo -n " pop3" rm ${MAILSPOOL}/${login}.pop fi ...if so, try putting a . character before each instance of ${login}.pop. Steve ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: FreeBsd e-mail question
On Wednesday 03 October 2007 22:30:54 Lisa Casey wrote: > 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? rmuser is a shell script. There's 2 ways to solve this problem: 1) edit the rm_mail function in /usr/sbin/rmuser to use: ${MAILSPOOL}/.${login}.pop 2) Better option is to change the default temp-name in qpopper.config: set temp-name "%s.pop" so that rmuser will detect it automatically. -- Mel ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
FreeBsd e-mail question
Hi, I'm running Sendmail and Qpopper on FreeBsd. (And perhaps I ought to be asking this on the Qpopper list, but hopefully someone here knows an answer). We have all of our mailboxes in mbox format in /var/mail. When a customer pops his mail for the first time it creates a file .username.pop in /var/mail which never goes away, it remains as a zero byte file. It's quite useful as we can tell from the timestamp on it when the customer last popped his mail. 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? Thanks, Lisa Casey ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"