0

I cannot find an appropriate guide for "How to use imaplib".

For example, when I want to move a message to the trash, I find the statement:

[Gmail]/Trash

Why not just "Trash"? What is the '[Gmail]' extension and how to use it?

Another example. For fetching information, I can do:

(BODY.PEEK[HEADER.FIELDS (SUBJECT)])

For getting the subject.

Or:

(RFC822)

For the whole message.

And another confusing thing is this 'labels' things. For example:

X-GM-MSGID

I don't understand what it stands for.

There are more labels etc. that I do not understand.

Can someone explain how to use the imaplib library to me?

jwpfox
  • 5,124
  • 11
  • 45
  • 42
  • every IMAP server can use different rules so maybe it is not easy to describe them all. – furas Oct 29 '16 at 22:42
  • @furas good enough for me. tell me how to get the detailes about the imap server of google, and ill be good from there ;) Thanks for the message BTW – lkj lkjlkj Oct 29 '16 at 22:45
  • BTW: RFC822 is document which describe mail construction: https://www.w3.org/Protocols/rfc822/ – furas Oct 29 '16 at 22:46
  • [Google Developers: IMAP extensions](https://developers.google.com/gmail/imap_extensions) - you can find `X-GM-MSGID` and there is link to [RFC3501](https://tools.ietf.org/search/rfc3501) – furas Oct 29 '16 at 22:51
  • To know how to use imaplib with google I need to read the all RFC3501? There isnt any short version? this is a waste of time I think – lkj lkjlkj Oct 29 '16 at 22:56
  • this document is long and boring so nobody write tutorial :) You have to find out which elements you need at this moment and read only this part. – furas Oct 29 '16 at 23:06
  • imaplib is a thin wrapper around IMAP. To understand imaplib, you must understand imap. To understand IMAP, you need to read RFC 3501. It is long, but it is reasonably easy to read. – Max Nov 01 '16 at 15:47

0 Answers0