[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: pop3 protocol error



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Friday 11 January 2002 11:03 am, Rick Pasotto wrote:
> Some of my email get delivered to my isp's pop3 server and I retrieve it
> with fetchmail. A couple of days ago I got a piece of spam that produces
> a protocol error. Fetchmail retrieves the headers for this one email,
> gets the error, and quits -- leaving the bad email on the server to
> repeat the process the next time it checks for mail.
>
> Is there a program or manual way I can just delete that one message and
> then let fetchmail do its thing?

If you have python on your machine, then you can run this script
to delete as many (or few) messages directly off the pop server.

import getpass, poplib, string
M = poplib.POP3('mail.yourisp.com')
M.user('yourusername')
M.pass_(getpass.getpass())
numMessages = len(M.list()[1])
print numMessages
x = M.list(0)
for i in range(1, numMessages):
    print '=============================================='
    print '=============================================='
    x = M.top(i, 0)
    print i
    for y in x[1]:
        z = string.split(y, ' ')
        if z[0] in ('Date:', 'From:', 'To:', 'Subject:'):
            print z
    a = raw_input('Delete this message?')
    if a in ('Y', 'y'):
        M.dele(i)
    if a in ('Q', 'q'):
        break
M.quit()
- -- 
+------------------------------------------------------------+
| Ron Johnson, Jr.        Home: ron.l.johnson@cox.net        |
| Jefferson, LA  USA      http://ronandheather.dhs.org       |
|                                                            |
! "Millions of Chinese speak Chinese, and it's not           |
!  hereditary..."                                            |
!    Dr. Dean Adell(sp?)                                     !
+------------------------------------------------------------+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8Px4FjTz5dS9Us5wRAm00AJ97+Lm2mK78TrKgKvAnhlS5rQexPACfa9wm
1MVHDaK81a/OUzBh+ODoIQo=
=BDBR
-----END PGP SIGNATURE-----



Reply to: