4 * This file is part of the TYPO3 CMS project.
6 * It is free software; you can redistribute it and/or modify it under
7 * the terms of the GNU General Public License, either version 2
8 * of the License, or any later version.
10 * For the full copyright and license information, please read the
11 * LICENSE.txt file that was distributed with this source code.
13 * The TYPO3 project - inspiring people to share!
16 namespace TYPO3\CMS\Install\Configuration\Mail
;
18 use TYPO3\CMS\Install\Configuration
;
19 use TYPO3\CMS\Install\Configuration\AbstractPreset
;
22 * SMTP settings handling preset
23 * @internal only to be used within EXT:install
25 class SmtpPreset
extends AbstractPreset
28 * @var string Name of preset
30 protected $name = 'Smtp';
33 * @var int Priority of preset
35 protected $priority = 40;
38 * @var array Configuration values handled by this preset
40 protected $configurationValues = [
41 'MAIL/transport' => 'smtp',
42 'MAIL/transport_sendmail_command' => '',
43 'MAIL/transport_smtp_server' => 'localhost:25',
44 'MAIL/transport_smtp_encrypt' => '',
45 'MAIL/transport_smtp_username' => '',
46 'MAIL/transport_smtp_password' => '',
50 * Get configuration values to activate prefix
52 * @return array Configuration values needed to activate prefix
54 public function getConfigurationValues()
56 $configurationValues = $this->configurationValues
;
57 $keys = array_keys($configurationValues);
58 foreach ($keys as $key) {
59 if (!empty($this->postValues
['Smtp'][$key])) {
60 $configurationValues[$key] = $this->postValues
['Smtp'][$key];
63 if ($this->postValues
['Mail']['enable'] === 'Smtp') {
64 $configurationValues['MAIL/transport'] = 'smtp';
66 return $configurationValues;
70 * Check if sendmail path if set
72 * @return bool TRUE if sendmail path if set
74 public function isAvailable()