[TASK] Remove Environment Check checkMailCapabilities 07/21607/3
authorAnja Leichsenring <aleichsenring@ab-softlab.de>
Sun, 23 Jun 2013 12:09:20 +0000 (14:09 +0200)
committerPhilipp Gampe <philipp.gampe@typo3.org>
Sun, 23 Jun 2013 14:33:33 +0000 (16:33 +0200)
The check is removed due to providing sometimes inaccurate error status
based on php.ini settings.
For now the real mail test in Test Setup got some hints in case of
missing test email. Later on the auto configuration tool (that not yet
exists) will take over from here.

Resolves: #49357
Releases: 6.2, 6.1
Change-Id: I290cca3fa4653b3a5310b9f27c2b125d9bfeb460
Reviewed-on: https://review.typo3.org/21607
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
typo3/sysext/install/Classes/SystemEnvironment/Check.php
typo3/sysext/install/Resources/Private/Partials/Action/Tool/TestSetup/Mail.html

index f00d1a3..1dd0f74 100644 (file)
@@ -111,7 +111,6 @@ class Check {
                foreach ($this->requiredPhpExtensions as $extension) {
                        $statusArray[] = $this->checkRequiredPhpExtension($extension);
                }
-               $statusArray[] = $this->checkMailCapabilities();
                $statusArray[] = $this->checkGdLibTrueColorSupport();
                $statusArray[] = $this->checkGdLibGifSupport();
                $statusArray[] = $this->checkGdLibJpgSupport();
@@ -828,89 +827,6 @@ class Check {
        }
 
        /**
-        * Check smtp settings
-        *
-        * @return Status\ErrorStatus|Status\OkStatus|Status\WarningStatus
-        */
-       protected function checkMailCapabilities() {
-               if ($this->isWindowsOs()) {
-                       $smtpIni = ini_get('SMTP');
-                       $brokenSmtp = FALSE;
-                       $smtpIpAddress = '';
-                       if (!$this->isValidIp($smtpIni)) {
-                               if (!$this->isValidIp(@gethostbyname($smtpIni))) {
-                                       $brokenSmtp = TRUE;
-                               } else {
-                                       $smtpIpAddress = @gethostbyname($smtpIni);
-                               }
-                       } else {
-                               $smtpIpAddress = $smtpIni;
-                       }
-
-                       $smtpPortIni =  intval(ini_get('smtp_port'));
-                       $brokenSmtpPort = FALSE;
-                       if (intval($smtpPortIni) < 1 || intval($smtpPortIni) > 65535) {
-                               $brokenSmtpPort = TRUE;
-                       }
-
-                       if ($brokenSmtp || $brokenSmtpPort) {
-                               $status = new Status\ErrorStatus();
-                               $status->setTitle('Mail configuration is not set correctly');
-                               $status->setMessage(
-                                       'PHP mail() function requires SMTP and smtp_port to have' .
-                                       ' correct values on Windows. If installation is completed,' .
-                                       ' the mail system can be tested in the install tool.'
-                               );
-                       } elseif ($smtpIpAddress === '127.0.0.1' || $smtpIpAddress === '::1') {
-                               $status = new Status\WarningStatus();
-                               $status->setTitle('Mail is configured, potential problem exists');
-                               $status->setMessage(
-                                       'smtp=' . $smtpIni . ' - This server! Are you sure it runs SMTP server?' .
-                                       ' If installation is completed, the mail system can be tested in the install tool.'
-                               );
-                       } else {
-                               $status = new Status\OkStatus();
-                               $status->setTitle('Mail is configured');
-                               $status->setMessage(
-                                       'smtp=' . $smtpIni . ', smtp_port=' . ini_get('smtp_port') . '.' .
-                                       ' Values for mail setup look ok. If installation is completed,' .
-                                       ' the mail system can be tested in the install tool. '
-                               );
-                       }
-               } elseif (!ini_get('sendmail_path')) {
-                       $status = new Status\WarningStatus();
-                       $status->setTitle('PHP sendmail_path not defined');
-                       $status->setMessage(
-                               'This may be critical to TYPO3\'s use of the mail() function.' .
-                               ' Your setup is rather uncommon. If installation is completed, the' .
-                               ' mail system can be tested in the install tool.'
-                       );
-               } else {
-                       list($mailBinary) = explode(' ', ini_get('sendmail_path'));
-                       if (!@is_executable($mailBinary)) {
-                               $status = new Status\ErrorStatus();
-                               $status->setTitle('Mail program not found or not executable');
-                               $status->setMessage(
-                                       'sendmail_path = ' . ini_get('sendmail_path') .
-                                       ' This may be critical to TYPO3\'s use of the mail() function. Please' .
-                                       ' be sure that the mail() function in your php-installation works.  If' .
-                                       ' installation is completed, the mail system can be tested in the install tool.'
-                               );
-                       } else {
-                               $status = new Status\OkStatus();
-                               $status->setTitle('PHP sendmail path given');
-                               $status->setMessage(
-                                       'sendmail_path = ' . ini_get('sendmail_path') . '.' .
-                                       ' This setting is crucial for TYPO3\'s use of the mail() function. The' .
-                                       ' current value looks fine. The mail system can be tested in the' .
-                                       ' install tool if the installation is completed.'
-                               );
-                       }
-               }
-               return $status;
-       }
-
-       /**
         * Check imagecreatetruecolor to verify gdlib works as expected
         *
         * @return Status\ErrorStatus|Status\OkStatus
index 08bb9e3..80c9361 100644 (file)
@@ -1,10 +1,25 @@
 <h4>Mail setup</h4>
 
 <p>
-       You can check the basic mail functionality by entering your email address here and press the button.
+       You can check the basic mail functionality by entering your email address here and pressing the button.
        You should then receive a testmail from "typo3installtool@example.org".
 </p>
 
+<p>
+       In case no mail is received, your setup might be broken. Check the following:
+       <ul>
+               <li>
+                       If $TYPO3_CONF_VARS['MAIL']['transport'] is set to mail or sendmail, TYPO3 tries to use PHPs internal
+                       mail() function. There might be no such program installed.
+               </li>
+               <li>
+                       If $TYPO3_CONF_VARS['MAIL']['transport'] is set to smtp, check if the data given in
+                       $TYPO3_CONF_VARS['MAIL'][transport_smtp_*] is valid. Wrong data here results in faulty requests to the
+                       mail server. You can find the resulting messages in the mail server log.
+               </li>
+       </ul>
+</p>
+
 <form method="post">
        <f:render partial="Action/Common/HiddenFormFields" arguments="{_all}" />
        <fieldset>
@@ -25,4 +40,4 @@
                </ol>
        </fieldset>
        <f:render partial="Action/Common/SubmitButton" arguments="{name:'testMail', text:'Send test mail'}"/>
-</form>
\ No newline at end of file
+</form>