Re: delete all email on a cyrus account

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Craig White
Date:  
To: plug-discuss
Subject: Re: delete all email on a cyrus account
Sorry dude - disaster on the home front - fire dept water riser decided
to spring a leak in a wall in my loft and in short order, sent a cascade
that left me in several inches of water and seeped all the way down to
share with my neighbors below me - have been mopping, mopping and
mopping since about 4:00 and needed to take a break.

# rpm -q cyrus-imapd
cyrus-imapd-2.2.12-1

to let you know what version I am working with...

cyradm...
localhost.localdomain> help
authenticate, login, auth         authenticate to server
chdir, cd                         change current directory
createmailbox, create, cm         create mailbox
deleteaclmailbox, deleteacl, dam  remove ACLs from mailbox
deletemailbox, delete, dm         delete mailbox
disconnect, disc                  disconnect from current server
exit, quit                        exit cyradm
help, ?                           show commands
info                              display mailbox/server metadata
listacl, lam, listaclmailbox      list ACLs on mailbox
listmailbox, lm                   list mailboxes
listquota, lq                     list quotas on specified root
listquotaroot, lqr, lqm           show quota roots and quotas for
mailbox
mboxcfg, mboxconfig               configure mailbox
reconstruct                       reconstruct mailbox (if supported)
renamemailbox, rename, renm       rename (and optionally relocate)
mailbox
server, servername, connect       show current server or connect to
server
setaclmailbox, sam, setacl        set ACLs on mailbox
setinfo                           set server metadata
setquota, sq                      set quota on mailbox or resource
version, ver                      display version info of current server
xfermailbox, xfer                 transfer (relocate) a mailbox to a
different server


I don't have a rm option...don't know which cyrus options you would
have...

dm is delete mailbox

but 'dm craig' wouldn't normally work
why?
1 - cyrus would have to get the rights to delete the mailbox
2 - on my system, reference is user.craig and craig doesn't exist...

thus

1 - to give cyrus permission to delete...

sam user.craig cyrus lwrsiwpcda # probably the c is all 
                                # that is necessary


2 - to delete...

dm user.craig

that's all there is to deleting a mailbox

but to delete messages...

cd /var/spool/imap/c/user/craig
rm -fr 1* 2* 3* 4* 5* 6* 7* 8* 9*
and then to reconstruct mailbox (because indexes will be out of whack)
su - cyrus -c '/usr/lib/cyrus-imapd/reconstruct -fr user.craig'

man cyradm
man reconstruct

Craig

On Thu, 2005-04-07 at 15:55 -0700, Jim B wrote:
> ok I changed the permissions with sam user cyrus lrswipcda but what I
> did prior to this is I deleted the users folder under
> /var/spool/imap/c/user/craig
>
> So now I can not delete the mailbox:
>
> localhost> rm user
> /bin/rm: cannot remove `user': No such file or directory
> child process exited abnormally
> localhost> cm user
> command failed: Mailbox already exists
>
>
> Jim
>
>
> On Apr 7, 2005 1:38 PM, Craig White <> wrote:
> > On Thu, 2005-04-07 at 12:05 -0700, Jim B wrote:
> > > > To delete the account...
> > > > su - cyrus - c '/usr/lib/cyrus-imapd/cyradm localhost'
> > > > sam user.$USER_NAME cyrus lwrspcda
> > > > dm user.$USER_NAME
> > > > # substitute for cyrus, admin name in /etc/imapd.conf if you use a
> > > > different account for cyrus admin
> > > > # substitute different path for cyradm if yours is on a different path
> > > > # substitute user account for $USER_NAME
> > >
> > > I am trying to delete the user account but I get permission denied and
> > > then whe I just try to chang the permissions for the account I get the
> > > below output.
> > >
> > >
> > >
> > > localhost> sam user actual.user.name cyrus lwrspcda
> > > wrong number arguments
> > > localhost> sam user acuat.user.name cyrus w
> > > wrong number arguments
> > > localhost>
> > >
> > ----
> > seems ok to me
> >
> > are you connected?
> >
> > lm #list mailboxes - could be a long list...
> >
> > localhost.localdomain> sam user.craig cyrus lwrsipcda
> > localhost.localdomain> lam user.craig
> > craig lrswipcda
> > cyrus lrswipcda
> >
> > Craig
> >
> > ---------------------------------------------------
> > PLUG-discuss mailing list -
> > To subscribe, unsubscribe, or to change you mail settings:
> > http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
> >
> ---------------------------------------------------
> PLUG-discuss mailing list -
> To subscribe, unsubscribe, or to change you mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss


---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss