I contacted MUTT irc channel to solve severe lags while navigating mailboxes of certain email providers with IMAP) (the emails were not stored locally). After extensive testing, changing the default value of mail_check from 5 to 60 solved my problem. I propose this change because several other people might encounter the same problem (especially yahoo users)
Even though the following official help page says that port 465 should be used, this didn't work for me (msmtp just hang indefinitely).
Instead port 587 seems to work fine, even though I couldn't fine some official document by the e-mail provider mentioning it.
https://pomoc.poczta.onet.pl/baza-wiedzy/adresy-serwerow-potrzebne-do-konfiguracji/
If someone else can confirm that indeed, 587 works for them as well, feel free to merge this PR.