POP and pop.py and/or poplib

Akhar akhar at videotron.ca
Wed Mar 8 17:45:01 EST 2000


I am trying to write a front in html for my POP server so I can do stuff
like on Hotmail, so I tried using pop.py but when I try to use the top
command it stalls and sits there forever! also I am not able to print a
correct email they are missing some line or are not properly formatted
the same thin goes for poplib.py but it doesn't have the top function. Also
all the example on the internet do not work ! (though I didn't try the ones
that included deletion :))
here some of my code:

Akhar
#!/usr/local/bin/python
import cgi
import string
#import pop
from pop import POP
#from poplib import POP
pop =  POP('localhost')
pop.user('p','pe')
#pop.identify('p','pe')
n,b = pop.status()
n = len(pop)
p = pop.retrieve
print "Vous avez, "
qte =  len(pop)
print qte
print "message(s)! Dont(1) "
for id in range(1, len(pop)+1) :
        print
        print id
        for line in pop.top(id, lines=1) :
                print line
        print
for id in range(1, len(pop)+1) :
        print id
        for line in pop.retrieve(id) :
                print line
                print pop[id]
numMessages = len(pop)+1
print "messages:        (2)"
print numMessages
#print pop.status()
pop.close()





More information about the Python-list mailing list