How to program round this poplib error?
cl at isbd.net
cl at isbd.net
Thu Mar 10 09:07:15 EST 2016
Mark Lawrence <breamoreboy at yahoo.co.uk> wrote:
> On 10/03/2016 12:04, cl at isbd.net wrote:
> > I have a (fairly simple) Python program that scans through a
> > 'catchall' E-Mail address for things that *might* be for me. It sends
> > anything that could be for me to my main E-Mail and discards the rest.
> >
> > However I *occasionally* get an error from it as follows:-
> >
> > Traceback (most recent call last):
> > File "/home/chris/.mutt/bin/getCatchall.py", line 65, in <module>
> > pop3.dele(i+1)
> > File "/usr/lib/python2.7/poplib.py", line 240, in dele
> > return self._shortcmd('DELE %s' % which)
> > File "/usr/lib/python2.7/poplib.py", line 160, in _shortcmd
> > return self._getresp()
> > File "/usr/lib/python2.7/poplib.py", line 132, in _getresp
> > resp, o = self._getline()
> > File "/usr/lib/python2.7/poplib.py", line 377, in _getline
> > raise error_proto('line too long')
> > poplib.error_proto: line too long
> >
> >
> > Does anyone have any idea how I can program around this somehow? As
> > it is at the moment I have to go to the webmail system at my ISP and
> > manually delete the message which is a bit of a nuisance.
> >
>
> How about a try/except in your code that catches poplib.error_proto?
>
... and? I'm still stuck because I can't identify the E-Mail in any
way to enable me to go and find it and delete it. So the program
keeps trapping on the same E-Mail and never gets to process anything
after that.
--
Chris Green
·
More information about the Python-list
mailing list