?
Solved

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

Posted on 2008-06-11
3
Medium Priority
?
1,938 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 2000 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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Nearly six years ago I was hired by a company to be their senior server engineer. One of my first projects was to implement Exchange Server 2007 on a Windows Server 2008 Single Copy Cluster for high availability. That was the easy part; read on to l…
New-MailboxSearch Powershell Command and step by step approach to Search and Extract Emails form Exchange 2013 Journaling server.
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…
In this video we show how to create an Accepted Domain 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 Mail Flow >> Ac…
Suggested Courses
Course of the Month15 days, 4 hours left to enroll

771 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