Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #75990 > unrolled thread

why i can't copy mail with imaplib?

Started byluofeiyu <elearn2014@gmail.com>
First post2014-08-10 06:44 -0700
Last post2014-08-11 09:32 +1000
Articles 4 — 3 participants

Back to article view | Back to comp.lang.python


Contents

  why i can't copy mail with imaplib? luofeiyu <elearn2014@gmail.com> - 2014-08-10 06:44 -0700
    Re: why i can't copy mail with imaplib? John Gordon <gordon@panix.com> - 2014-08-10 23:07 +0000
      Re: why i can't copy mail with imaplib? luofeiyu <elearn2014@gmail.com> - 2014-08-10 16:27 -0700
      Re: why i can't copy mail with imaplib? Ben Finney <ben+python@benfinney.id.au> - 2014-08-11 09:32 +1000

#75990 — why i can't copy mail with imaplib?

Fromluofeiyu <elearn2014@gmail.com>
Date2014-08-10 06:44 -0700
Subjectwhy i can't copy mail with imaplib?
Message-ID<mailman.12821.1407690877.18130.python-list@python.org>
Help on method copy in module imaplib:

copy(message_set, new_mailbox) method of imaplib.IMAP4_SSL instance
     Copy 'message_set' messages onto end of 'new_mailbox'.

     (typ, [data]) = <instance>.copy(message_set, new_mailbox)


self is an instance in my code."[Gmail]/&kc2JgQ-]" is the important mailbox.


self.con.select("inbox")
self.con.copy(b"1","[Gmail]/&kc2JgQ-]")

why i can not copy the first email into my  important mailbox?

[toc] | [next] | [standalone]


#76008

FromJohn Gordon <gordon@panix.com>
Date2014-08-10 23:07 +0000
Message-ID<ls8tvu$h5d$1@reader1.panix.com>
In reply to#75990
In <mailman.12821.1407690877.18130.python-list@python.org> luofeiyu <elearn2014@gmail.com> writes:

> self.con.select("inbox")
> self.con.copy(b"1","[Gmail]/&kc2JgQ-]")

> why i can not copy the first email into my  important mailbox?

What happens when you run the above code?  Do you get an error?

-- 
John Gordon         Imagine what it must be like for a real medical doctor to
gordon@panix.com    watch 'House', or a real serial killer to watch 'Dexter'.

[toc] | [prev] | [next] | [standalone]


#76009

Fromluofeiyu <elearn2014@gmail.com>
Date2014-08-10 16:27 -0700
Message-ID<mailman.12830.1407713290.18130.python-list@python.org>
In reply to#76008
 >>> x.con.list()
('OK', [b'(\\HasNoChildren) "/" "INBOX"', b'(\\Noselect \\HasChildren) 
"/" "[Gma
il]"', b'(\\HasNoChildren \\Junk) "/" "[Gmail]/&V4NXPpCuTvY-"', 
b'(\\HasNoChildr
en \\Trash) "/" "[Gmail]/&XfJSIJZkkK5O9g-"', b'(\\HasNoChildren 
\\Flagged) "/" "
[Gmail]/&XfJSoGYfaAc-"', b'(\\HasNoChildren \\Sent) "/" 
"[Gmail]/&XfJT0ZCuTvY-"'
, b'(\\HasNoChildren \\All) "/" "[Gmail]/&YkBnCZCuTvY-"', 
b'(\\HasNoChildren \\D
rafts) "/" "[Gmail]/&g0l6Pw-"', b'(\\HasNoChildren \\Important) "/" 
"[Gmail]/&kc
2JgQ-"'])
 >>> x.con.select("inbox")
('OK', [b'40'])
 >>> x.con.copy(b"1","[Gmail]/&kc2JgQ-]")
('NO', [b'[TRYCREATE] No folder [Gmail]/\xe9\x87\x8d\xe8\xa6\x81] 
(Failure)'])
 >>> x.con.copy(b"1","[Gmail]/Important")
('NO', [b'[TRYCREATE] No folder [Gmail]/Important (Failure)'])
On 8/10/2014 4:07 PM, John Gordon wrote:
> In <mailman.12821.1407690877.18130.python-list@python.org> luofeiyu <elearn2014@gmail.com> writes:
>
>> self.con.select("inbox")
>> self.con.copy(b"1","[Gmail]/&kc2JgQ-]")
>> why i can not copy the first email into my  important mailbox?
> What happens when you run the above code?  Do you get an error?
>

[toc] | [prev] | [next] | [standalone]


#76010

FromBen Finney <ben+python@benfinney.id.au>
Date2014-08-11 09:32 +1000
Message-ID<mailman.12831.1407713591.18130.python-list@python.org>
In reply to#76008
luofeiyu <elearn2014@gmail.com> writes:

> >>> x.con.copy(b"1","[Gmail]/Important")
> ('NO', [b'[TRYCREATE] No folder [Gmail]/Important (Failure)'])

Your questions have mostly been unrelated to Python, and this is another
example. You should search elsewhere for assistance with IMAP and GMail.

-- 
 \        “The restriction of knowledge to an elite group destroys the |
  `\                   spirit of society and leads to its intellectual |
_o__)                                impoverishment.” —Albert Einstein |
Ben Finney

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web