Solved

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

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

Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

Question has a verified solution.

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

The new Gmail Phishing Scam going around is surprising even the savviest of users with its sophisticated techniques.
As cyber crime continues to grow in both numbers and sophistication, a troubling trend of optimization has emerged over the last year.
In this video we show how to create a User Mailbox 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 >> Mailb…
To show how to generate a certificate request 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 >> Certificates…

728 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