SUMMARY Kmail/Kontact uses the http proxy from the system settings for IMAP (and probably POP/SMTP). STEPS TO REPRODUCE 1. Configure a proxy in the system settings 2. Try to receive mails OBSERVED RESULT Kmail shows the state "offline" EXPECTED RESULT Kmail should receive new mails from the server. SOFTWARE/OS VERSIONS Linux/KDE Plasma: OpenSuSE Tumbleweed / Plasma 5 KDE Plasma Version: 5.15.5 KDE Frameworks Version: 5.57.0 Qt Version: 5.0.13.1 ADDITIONAL INFORMATION I think the proxy should not be used because a http/https/ftp proxy (Squid in my case) can not handle IMAP/POP/SMTP. And I set only http, https and ftp proxy, no socks and no other protocol. Besides I added the IMAP server in the no-proxy settings and it is ignored. It seems that Kmail does not use the environment but the Plasma settings.
Sending or receiving mail through a proxy is an unusual case, so a couple of years ago the default for POP3 and SMTP was changed to explicitly use no proxy, with an option in the advanced account settings to enable the proxy if it really is required. However, doing the same for IMAP appears to have been overlooked. See https://phabricator.kde.org/T7430 and linked reviews.
I have the same issue. But, in my case, kmail is using http_proxy environment variable, even if I mark the no proxy option in system settings. As a matter of fact, proxy options in system settings seems not to be relevant for kmail (imap and smtp). I reported this in https://bugs.kde.org/show_bug.cgi?id=373870.
https://phabricator.kde.org/D21463 https://phabricator.kde.org/D21464
Fixed in master branch by commits https://cgit.kde.org/kimap.git/commit/?id=544bae2f88f3b41150d678fbacbb397575c7a14d https://cgit.kde.org/kdepim-runtime.git/commit/?id=57716edd29b786bb9f00dafe4c95166884ef67f7
*** Bug 410643 has been marked as a duplicate of this bug. ***