public static function createConfig(PostmanTransport $transport) { // create Logger $logger = new PostmanLogger('PostmanOAuth2ConfigurationFactory'); // retrieve the hostname and port form the transport $hostname = $transport->getHostname(); $port = $transport->getPort(); // the sender email is needed for the OAuth2 Bearer token $senderEmail = PostmanOptions::getInstance()->getEnvelopeSender(); assert(!empty($senderEmail)); // the vendor is required for Yahoo's OAuth2 implementation $vendor = self::createVendorString($hostname); // create the OAuth2 SMTP Authentication string $initClientRequestEncoded = self::createAuthenticationString($senderEmail, PostmanOAuthToken::getInstance()->getAccessToken(), $vendor); // create the Configuration structure for Zend_Mail $config = self::createConfiguration($logger, $hostname, $port, $transport->getSecurityType(), $transport->getAuthenticationType(), $initClientRequestEncoded); // return the Configuration structure return $config; }