[Tutor] imaplib copy

Neil Schemenauer nas@python.ca
Tue Jun 3 18:53:09 2003


Michael Montagne wrote:
> for num in data[0].split():
>     typ, data = M.fetch(num, '(RFC822)')
> #    M.append('/home/montagne/Mail/spam',None,None,data[0][1])
>     M.copy(num,'/home/montagne/Mail/spam')
>     print 'Message %s\n' % (data[0][1])
> M.logout()

Based on a quick look at the imaplib code, I would guess that copy()
tries to copy the message to a server side mail box.  You probably need
to open() the mbox file and use read() and write() to copy the message.

  Neil