I'm using a local OAUTH proxy on my box to handle the OAUTH connection to M365 (I'm not brave enough to try migrating to the integrated library) which only supports plaintext auth since the proxy itself handles the STARTTLS auth. I noticed that, with the new mail parser, it was still attempting to connect with TLS and erroring out even though None is selected in the settings page.
Doing some digging into the new library, it looks like for it to truly enforce no encryption it has to pass the 'notls' flag instead of 'null'. I updated it on my end to do that and it seems to be working.
Not sure if this is gonna end up breaking something else in my setup (seems ok so far) but I figured I'd put it out there for the devs to look at. I threw in the section I was working in and what my changes were.
/** ------------------------------------------------------------------ * Webklex IMAP setup (supports Standard / Google OAuth / Microsoft OAuth) * ------------------------------------------------------------------ */
use Webklex\PHPIMAP\ClientManager;
$validate_cert = true;
// Defaults from settings (standard IMAP)
$host = $config_imap_host;
$port = (int)$config_imap_port;
// Old
// $encr = !empty($config_imap_encryption) ? $config_imap_encryption : null; // 'ssl'|'tls'|null
// New
$encr = !empty($config_imap_encryption) ? $config_imap_encryption : 'notls'; // 'ssl'|'tls'|'notls'
$user = $config_imap_username;
$pass = $config_imap_password;
$auth = null; // 'oauth' for OAuth providers