How to check mail from Amazon WorkMail in Python

Finally, Amazon added IMAP support to WorkMail, so now it’s pretty easy to get mail from it.
Next is pretty simple piece of code how to get mail in Python3 from Amazon WorkMail:

Here is pretty good imaplib tutorial.