Solved

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

Posted on 2008-06-11
3
1,870 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Junk folder 23 184
Delete Public Folder DB after migration 4 39
How does email route to destination? 8 45
How can I see the OWA logs from Exchange 2010? 1 17
When it comes to security, there are always trade-offs between security and convenience/ease of administration. This article examines some of the main pros and cons of using key authentication vs password authentication for hosting an SFTP server.
This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In this video we show how to create a Contact 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 Recipients >> Contact ta…

840 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