Solved

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

Posted on 2008-06-11
3
1,888 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

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

Microsoft has released various new features which are capable of handling various tasks. One of these tasks is ‘Migration from pop3 to Exchange Server’. Pop3 data stores various data along mailboxes like contacts, tasks, etc. So, it becomes the need…
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.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

730 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