this is difficult at best to figure out just using the config.php file.
Here’s what I do… using thunderbird (an email client), I setup the email box, and thunderbird tries all of the settings, and usually picks the settings that works. then I look at what thunderbird figured out, and adjust the config.php settings to match the thunderbird settings. it’s a little easier than what you’re doing