Solved

Delete mail from pop3 account with 67K messages via command line?

Posted on 2008-06-11
3
1,828 Views
Last Modified: 2011-09-20
My inbox got bombed by a rouge script.  There is 67,000 messages.  Outlook and the like won't delete them from the server until it has downloaded all messages.  Outlook crashes before it can download that many.

I have a shell script (linux) which deletes messages.  When its run, they say "Ok deleted".  I'm guess they are just marked for deletion because they are still there.  

How can I get rid of these altogehter (I even deleted the whole account on my host to no avail).

Here is the script:

#!/bin/sh
# usage: ./clean.pop3 2500 | telnet mail.myserver.com 110
username="myemail@mydomain.com";
password="mypass";
MAX_MESS=$1
[ $# -eq 0 ] && exit 1 || :
sleep 2
echo USER $username
sleep 1
echo PASS $password
sleep 2
for (( j = 1 ; j <= $MAX_MESS; j++ ))
do
echo DELE $j
sleep 1
done
echo QUIT
0
Comment
Question by:burnsj2
3 Comments
 
LVL 17

Expert Comment

by:BudDurland
ID: 21765344
Can you access the account via web mail or IMAP?  Usually with those protocols, you can mass select messages for deletion.  Probably best o do it in small groups of 1000 or so at a time.
0
 
LVL 26

Accepted Solution

by:
Leon Fester earned 500 total points
ID: 21767125
http://www.poptray.org/
http://www.snapfiles.com/get/quickdelete.html

#!/usr/bin/perluse Net::POP3; $pop = Net::POP3->new('my.pop3.server'); $tot = $pop->login('user','login'); printf("$tot messagesn"); for($i = 0; $i<$tot; $i++){  $pop->delete($i); } $pop->quit();
0
 
LVL 1

Author Comment

by:burnsj2
ID: 21772192
The programs at the two links both crashed, the perl script did it.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Automapping, a wonderful feature with Exchange 2010 (SP2 onwards I believe), allows additional/Shared mailboxes that a user has access to be automatically mapped on Outlook client, simplifying the process by adding them while Outlook launches. Ho…
Easy CSR creation in Exchange 2007,2010 and 2013
In this video we show how to create an Address List in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Organization >> Ad…
In this video we show how to create a mailbox database in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Servers >> Data…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now