K-9 Mail v6.301 doesn't removes deleted messages from gmail mailboxes

When in inbox folder open the message and click on the trash bin icon this e-mail will be removed from inbox but will be still visible on the gmail server in the “All Mail” folder. To remove it from the server completely the same procedure needs to be performed for the same message from the “All Mail” IMAP folder in K-9 Mail application. It means that the same message needs to be removed twice from both folders what is inconvenient.

This problem is not relevant if using other e-mail application like Thunderbird on PC for example.

K-9 Mail settings:

Fetching mail => When I delete a message - Delete from server
Erase deleted messages on server - Immediately

Gmail account settings:

Forwarding and POP/IMAP:

When I mark a message in IMAP as deleted - Auto-Expunge off - Wait for the client to update the server
When a message is marked as deleted and expunged from the last visible IMAP folder - Move the message to the Trash

It seems like it is working fine now. I found that my folders (including Trash folder) were not predefined with folders on the IMAP server.