Koozali.org: home of the SME Server

How to delete admin emails

Offline F22-Raptor

  • **
  • 31
  • +0/-0
How to delete admin emails
« on: March 02, 2009, 11:32:41 PM »
My Admin inbox has a lot of emails (thousands) and for some reason I can get into my webmail (I guess it tries to list all emails for admin or something like that). Webmail crashes and I can't select Empty mailbox.

All other accounts are fine, it's just the Admin one.

How can I delete all the email in the Admin mailbox/inbox from the command line?

Thanks

D.

Offline Craig Cabrey

  • ****
  • 79
  • +0/-0
Re: How to delete admin emails
« Reply #1 on: March 02, 2009, 11:40:24 PM »
Log in as root onto the server (using PuTTY or at the console).

Then you can use the
Code: [Select]
pine command.

For help using pine, try reading the man page for it:
Code: [Select]
man pine

Offline mrjhb3

  • *
  • 1,188
  • +0/-0
    • John Bennett Services
Re: How to delete admin emails
« Reply #2 on: March 03, 2009, 01:41:09 AM »
admin's email is stored in /home/e-smith/Maildir/new if you haven't tried to access it or /cur if you have.

John
......

Offline F22-Raptor

  • **
  • 31
  • +0/-0
Re: How to delete admin emails
« Reply #3 on: March 03, 2009, 01:53:41 AM »
Wow Craig, that was fast, thanks.

Pine did the job. I just deleted my admin emails (almost 250,000, crazy).

I had to enable the aggregate commands though to get ; (select command). Here is how:
- on the Main Menu select S (Setup)
- then C for Config
- down arrow (or space bar but it's easy to miss) to scroll to Advanced Command Preferences
- highlight enable-aggregate-command-set and hit X to set/unset
- E to exit

Here is a little guide if other people need to do the same thing:

I will assume telnet is used but putty or doing this at the console will work as well.
Log on as root and then start pine by typing pine, when prompted just enter the credentials for admin.
Follow the instructions below, if you can't see ; look into settings by following the steps above to enable aggregate commands.

Commands are displayed at the bottom of the telnet window.
Press O to see Other Commands.
Press O again to see more commands.
Press ; (semi-colon) to Select emails in your Inbox.
Press A to Select All emails in your Inbox.
Press A again to Apply an operation to the selected email messages.
Press D to mark all email for deletion. All of your emails should now be flagged with an X and a D on your telnet screen.
When you are ready to permanently delete all messages you've marked for deletion (i.e. all the email in your Inbox), press X to Expunge them.
It make take a few minutes to expunge all your deleted emails, depending on how many you have to delete. The telnet window may be unresponsive while the server performs the operation.
After a few moments, you will see a message that indicates the number of emails deleted.
After deleting all emails from your Inbox, you may close the telnet window.

I hope this helps someone.

D.

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: How to delete admin emails
« Reply #4 on: March 03, 2009, 07:57:21 AM »
Commands are displayed at the bottom of the telnet window. 

ssh/console window.. SME can't be accessed via telnet..

just a clarification ;-)

Ciao
Stefano

Offline F22-Raptor

  • **
  • 31
  • +0/-0
Re: How to delete admin emails
« Reply #5 on: March 03, 2009, 04:19:43 PM »
You are right Stefano.
I did it from the console and in an attempt to make it more generic I used telnet as an example forgetting telnet cannot be used on SME.

My bad.

D.