Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The example in the README.rst shows a different behaviour from what happens on my system #71

Open
shaoran opened this issue Nov 2, 2021 · 1 comment

Comments

@shaoran
Copy link

shaoran commented Nov 2, 2021

The example in the README.rs file does this:

res, data = await imap_client.select()
print('there is %s messages INBOX' % data[0])

which would be the same behaviour of imaplib. But when I execute this code I get b'FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft \\Forwarded $Junk $la' instead of the number of emails. I get a list that looks like this:

[b'FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft \\Forwarded $Junk $la'
 b'bel4 $label5 $label2 $label3 $label1 Junk $Forwarded $MDNSent NonJunk)',
 b'OK [PERMANENTFLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft \\Forwar'
 b'ded $Junk $label4 $label5 $label2 $label3 $label1 Junk $Forwarded $MDNSent N'
 b'onJunk \\*)]',
 b'OK [URLMECH INTERNAL]',
 b'4046 EXISTS',
 b'0 RECENT',
 b'OK [UNSEEN 1507]',
 b'OK [UIDVALIDITY 1226754362]',
 b'OK [UIDNEXT 127124]',
 b'[READ-WRITE] SELECT completed']

If I execute a select() with the python built-in imaplib with the same credentials, then I get expected behaviour. I checked different imap servers and this always happens. Why is that?

@bamthomas
Copy link
Owner

bamthomas commented Dec 30, 2021

hmm data[0] should return b'FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft \\Forwarded $Junk $label4 $label5 $label2 $label3 $label1 Junk $Forwarded $MDNSent NonJunk)' in your example.

In the API for now the data is a list of response lines : it is thinner than imaplib that is extracting data from the whole response lines.

That said, I agree that the log there is %s message with data[0] is misleading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants