diff options
author | yehuda <yehuda@myinbox.in> | 2019-05-16 12:15:39 +0300 |
---|---|---|
committer | yehuda <yehuda@myinbox.in> | 2019-05-16 12:15:39 +0300 |
commit | 6b0c4d5d97cac613ad8218fc9f0779eec63c28e3 (patch) | |
tree | 3ac2513ad5cb08650b03f55d837cf6b1d578dd21 /Postman/Postman-Mail/PostmanModuleTransport.php | |
parent | c88e7ad0b42cefd8fb7b509c8c2e355f567d9434 (diff) | |
parent | 09ad01149ef5981407149bc3c9502058482fb419 (diff) | |
download | Post-SMTP-6b0c4d5d97cac613ad8218fc9f0779eec63c28e3.zip |
Merge remote-tracking branch 'origin/dev'
Diffstat (limited to 'Postman/Postman-Mail/PostmanModuleTransport.php')
-rw-r--r-- | Postman/Postman-Mail/PostmanModuleTransport.php | 52 |
1 files changed, 29 insertions, 23 deletions
diff --git a/Postman/Postman-Mail/PostmanModuleTransport.php b/Postman/Postman-Mail/PostmanModuleTransport.php index 21c1624..37d692d 100644 --- a/Postman/Postman-Mail/PostmanModuleTransport.php +++ b/Postman/Postman-Mail/PostmanModuleTransport.php @@ -43,6 +43,7 @@ interface PostmanModuleTransport extends PostmanTransport { public function isReadyToSendMail(); public function getFromEmailAddress(); public function getFromName(); + public function getHostname(); public function getProtocol(); public function isEmailValidationSupported(); public function getPort(); @@ -68,7 +69,7 @@ abstract class PostmanAbstractModuleTransport implements PostmanModuleTransport /** * These internal variables are exposed for the subclasses to use * - * @var unknown + * @var mixed */ protected $logger; protected $options; @@ -124,7 +125,7 @@ abstract class PostmanAbstractModuleTransport implements PostmanModuleTransport /** * - * @param unknown $data + * @param mixed $data */ public function prepareOptionsForExport($data) { // no-op @@ -139,7 +140,7 @@ abstract class PostmanAbstractModuleTransport implements PostmanModuleTransport /** * - * @param unknown $queryHostname + * @param mixed $queryHostname */ protected function createScribe($hostname) { $scribe = new PostmanNonOAuthScribe ( $hostname ); @@ -281,8 +282,8 @@ abstract class PostmanAbstractModuleTransport implements PostmanModuleTransport /** * - * @param unknown $hostname - * @param unknown $response + * @param mixed $hostname + * @param mixed $response */ public function populateConfiguration($hostname) { $configuration = array (); @@ -290,8 +291,8 @@ abstract class PostmanAbstractModuleTransport implements PostmanModuleTransport } /** * - * @param unknown $winningRecommendation - * @param unknown $response + * @param mixed $winningRecommendation + * @param mixed $response */ public function populateConfigurationFromRecommendation($winningRecommendation) { $configuration = array (); @@ -421,7 +422,7 @@ abstract class PostmanAbstractZendModuleTransport extends PostmanAbstractModuleT /** * - * @param unknown $data + * @param mixed $data */ public function prepareOptionsForExport($data) { $data = parent::prepareOptionsForExport ( $data ); @@ -455,7 +456,7 @@ abstract class PostmanAbstractZendModuleTransport extends PostmanAbstractModuleT /** * - * @param unknown $queryHostname + * @param mixed $queryHostname */ protected function createScribe($hostname) { $scribe = null; @@ -502,13 +503,18 @@ abstract class PostmanAbstractZendModuleTransport extends PostmanAbstractModuleT $deliveryDetails ['transport_name'] = $this->getTransportDescription ( $this->getSecurityType () ); $deliveryDetails ['host'] = $this->getHostname () . ':' . $this->getPort (); $deliveryDetails ['auth_desc'] = $this->getAuthenticationDescription ( $this->getAuthenticationType () ); + + if ( $deliveryDetails ['host'] == 'localhost:25' ) { + $deliveryDetails ['transport_name'] = __( 'Sendmail (server defualt - not SMTP)', 'post-smtp'); + } + /* translators: where (1) is the transport type, (2) is the host, and (3) is the Authentication Type (e.g. Postman will send mail via smtp.gmail.com:465 using OAuth 2.0 authentication.) */ - return sprintf ( __ ( 'Postman will send mail via %1$s to %2$s using %3$s authentication.', Postman::TEXT_DOMAIN ), '<b>' . $deliveryDetails ['transport_name'] . '</b>', '<b>' . $deliveryDetails ['host'] . '</b>', '<b>' . $deliveryDetails ['auth_desc'] . '</b>' ); + return sprintf ( __ ( 'Postman will send mail via %1$s to %2$s using %3$s authentication.', 'post-smtp' ), '<b>' . $deliveryDetails ['transport_name'] . '</b>', '<b>' . $deliveryDetails ['host'] . '</b>', '<b>' . $deliveryDetails ['auth_desc'] . '</b>' ); } /** * - * @param unknown $encType + * @param mixed $encType * @return string */ protected function getTransportDescription($encType) { @@ -525,13 +531,13 @@ abstract class PostmanAbstractZendModuleTransport extends PostmanAbstractModuleT /** * - * @param unknown $authType + * @param mixed $authType */ protected function getAuthenticationDescription($authType) { if (PostmanOptions::AUTHENTICATION_TYPE_OAUTH2 == $authType) { return 'OAuth 2.0'; } else if (PostmanOptions::AUTHENTICATION_TYPE_NONE == $authType) { - return _x ( 'no', 'as in "There is no Spoon"', Postman::TEXT_DOMAIN ); + return _x ( 'no', 'as in "There is no Spoon"', 'post-smtp' ); } else { switch ($authType) { case PostmanOptions::AUTHENTICATION_TYPE_CRAMMD5 : @@ -550,7 +556,7 @@ abstract class PostmanAbstractZendModuleTransport extends PostmanAbstractModuleT $authDescription = $authType; break; } - return sprintf ( '%s (%s)', __ ( 'Password', Postman::TEXT_DOMAIN ), $authDescription ); + return sprintf ( '%s (%s)', __ ( 'Password', 'post-smtp' ), $authDescription ); } } @@ -575,13 +581,13 @@ abstract class PostmanAbstractZendModuleTransport extends PostmanAbstractModuleT parent::validateTransportConfiguration (); $messages = parent::validateTransportConfiguration (); if (! $this->isSenderConfigured ()) { - array_push ( $messages, __ ( 'Message From Address can not be empty', Postman::TEXT_DOMAIN ) . '.' ); + array_push ( $messages, __ ( 'Message From Address can not be empty', 'post-smtp' ) . '.' ); $this->setNotConfiguredAndReady (); } if ($this->getAuthenticationType () == PostmanOptions::AUTHENTICATION_TYPE_OAUTH2) { if (! $this->isOAuth2ClientIdAndClientSecretConfigured ()) { /* translators: %1$s is the Client ID label, and %2$s is the Client Secret label (e.g. Warning: OAuth 2.0 authentication requires an OAuth 2.0-capable Outgoing Mail Server, Sender Email Address, Client ID, and Client Secret.) */ - array_push ( $messages, sprintf ( __ ( 'OAuth 2.0 authentication requires a %1$s and %2$s.', Postman::TEXT_DOMAIN ), $this->getScribe ()->getClientIdLabel (), $this->getScribe ()->getClientSecretLabel () ) ); + array_push ( $messages, sprintf ( __ ( 'OAuth 2.0 authentication requires a %1$s and %2$s.', 'post-smtp' ), $this->getScribe ()->getClientIdLabel (), $this->getScribe ()->getClientSecretLabel () ) ); $this->setNotConfiguredAndReady (); } } @@ -621,8 +627,8 @@ abstract class PostmanAbstractZendModuleTransport extends PostmanAbstractModuleT /** * - * @param unknown $hostname - * @param unknown $response + * @param mixed $hostname + * @param mixed $response */ public function populateConfiguration($hostname) { $response = parent::populateConfiguration ( $hostname ); @@ -650,8 +656,8 @@ abstract class PostmanAbstractZendModuleTransport extends PostmanAbstractModuleT /** * Populate the Ajax response for the Setup Wizard / Manual Configuration * - * @param unknown $hostname - * @param unknown $response + * @param mixed $hostname + * @param mixed $response */ public function populateConfigurationFromRecommendation($winningRecommendation) { $response = parent::populateConfigurationFromRecommendation ( $winningRecommendation ); @@ -703,21 +709,21 @@ abstract class PostmanAbstractZendModuleTransport extends PostmanAbstractModuleT if ($socket->auth_crammd5 || $socket->auth_login || $socket->authPlain) { array_push ( $overrideAuthItems, array ( 'selected' => $passwordMode, - 'name' => __ ( 'Password (requires username and password)', Postman::TEXT_DOMAIN ), + 'name' => __ ( 'Password (requires username and password)', 'post-smtp' ), 'value' => 'password' ) ); } if ($socket->auth_xoauth || $winningRecommendation ['auth'] == 'oauth2') { array_push ( $overrideAuthItems, array ( 'selected' => $oauth2Mode, - 'name' => __ ( 'OAuth 2.0 (requires Client ID and Client Secret)', Postman::TEXT_DOMAIN ), + 'name' => __ ( 'OAuth 2.0 (requires Client ID and Client Secret)', 'post-smtp' ), 'value' => 'oauth2' ) ); } if ($socket->auth_none) { array_push ( $overrideAuthItems, array ( 'selected' => $noAuthMode, - 'name' => __ ( 'None', Postman::TEXT_DOMAIN ), + 'name' => __ ( 'None', 'post-smtp' ), 'value' => 'none' ) ); } |