Add mail_smtp_starttls option
authorTim Düsterhus <duesterhus@woltlab.com>
Sun, 21 Jun 2015 20:51:05 +0000 (22:51 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Tue, 23 Jun 2015 22:28:58 +0000 (00:28 +0200)
com.woltlab.wcf/option.xml
wcfsetup/install/files/lib/system/email/transport/SmtpEmailTransport.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index 787078d03d31c2ec1cda7d3644c3735e23aa8f1e..81634b09941d509e2c9fbccc677b6ef262c8fdf6 100644 (file)
@@ -809,6 +809,14 @@ debug:!mail_use_f_param,!mail_smtp_host,!mail_smtp_port,!mail_smtp_user,!mail_sm
                                <minvalue>0</minvalue>
                                <maxvalue>65535</maxvalue>
                        </option>
+                       <option name="mail_smtp_starttls">
+                               <categoryname>general.mail.send</categoryname>
+                               <optiontype>radioButton</optiontype>
+                               <defaultvalue>may</defaultvalue>
+                               <selectoption><selectoptions><![CDATA[none:wcf.acp.option.mail_smtp_starttls.none
+may:wcf.acp.option.mail_smtp_starttls.may
+encrypt:wcf.acp.option.mail_smtp_starttls.encrypt]]></selectoptions></selectoptions>
+                       </option>
                        <option name="mail_smtp_user">
                                <categoryname>general.mail.send</categoryname>
                                <optiontype>text</optiontype>
index a92427e6dcef6af03d1abb96f3835e738532514d..2567ab01e30edacc231dd84bac55032c554af36e 100644 (file)
@@ -83,13 +83,12 @@ class SmtpEmailTransport implements EmailTransport {
         * @param       string  $password       corresponding password
         * @param       string  $starttls       one of 'none', 'may' and 'encrypt'
         */
-       public function __construct($host = MAIL_SMTP_HOST, $port = MAIL_SMTP_PORT, $username = MAIL_SMTP_USER, $password = MAIL_SMTP_PASSWORD, $starttls = 'may') {
+       public function __construct($host = MAIL_SMTP_HOST, $port = MAIL_SMTP_PORT, $username = MAIL_SMTP_USER, $password = MAIL_SMTP_PASSWORD, $starttls = MAIL_SMTP_STARTTLS) {
                $this->host = $host;
                $this->port = $port;
                $this->username = $username;
                $this->password = $password;
                
-               // TODO: Add option in ACP for STARTTLS
                switch ($starttls) {
                        case 'none':
                        case 'may':
index 01debcf5cb3b25d5f1d1bcbd415740b95210d2c7..092fb7570ae366d88d727089de7832fc9ee2ed41 100644 (file)
                <item name="wcf.acp.option.mail_signature"><![CDATA[Signatur]]></item>
                <item name="wcf.acp.option.mail_signature.description"><![CDATA[Die Signatur wird an jede automatisch generierte E-Mail angehängt.]]></item>
                <item name="wcf.acp.option.mail_smtp_host"><![CDATA[SMTP-Server]]></item>
-               <item name="wcf.acp.option.mail_smtp_password"><![CDATA[SMTP-Kennwort]]></item>
                <item name="wcf.acp.option.mail_smtp_port"><![CDATA[SMTP-Port]]></item>
+               <item name="wcf.acp.option.mail_smtp_starttls"><![CDATA[SMTP-Verschlüsselung]]></item>
+               <item name="wcf.acp.option.mail_smtp_starttls.none"><![CDATA[Deaktivieren]]></item>
+               <item name="wcf.acp.option.mail_smtp_starttls.may"><![CDATA[Wenn unterstützt]]></item>
+               <item name="wcf.acp.option.mail_smtp_starttls.encrypt"><![CDATA[Erzwingen]]></item>
+               <item name="wcf.acp.option.mail_smtp_starttls.description"><![CDATA[Diese Einstellung steuert die Verwendung von „STARTTLS“. Deaktivieren Sie diese Option, wenn Sie E-Mails über SSL (Port 465) versenden!]]></item>
                <item name="wcf.acp.option.mail_smtp_user"><![CDATA[SMTP-Benutzer]]></item>
+               <item name="wcf.acp.option.mail_smtp_password"><![CDATA[SMTP-Kennwort]]></item>
                <item name="wcf.acp.option.mail_use_f_param"><![CDATA[„-f“ Parameter verwenden]]></item>
                <item name="wcf.acp.option.mail_use_f_param.description"><![CDATA[Der „-f“-Parameter sorgt bei der PHP-Versandmethode dafür, dass der korrekte Absender gesetzt wird. Diese Einstellung wird möglicherweise nicht von jedem Server unterstützt. Probieren Sie in diesem Falle die Option zu deaktivieren.]]></item>
                <item name="wcf.acp.option.meta_description"><![CDATA[Meta Description]]></item>
index 60ee124791a70531ce744ada075c6766fb2f2d76..e88f251251cda0ccecbd6ca288891ff9e6e8aba5 100644 (file)
@@ -784,9 +784,14 @@ Examples for medium ID detection:
                <item name="wcf.acp.option.mail_signature"><![CDATA[Signature]]></item>
                <item name="wcf.acp.option.mail_signature.description"><![CDATA[Signature will be appended to every message.]]></item>
                <item name="wcf.acp.option.mail_smtp_host"><![CDATA[SMTP Server]]></item>
-               <item name="wcf.acp.option.mail_smtp_password"><![CDATA[SMTP Password]]></item>
                <item name="wcf.acp.option.mail_smtp_port"><![CDATA[SMTP Port]]></item>
+               <item name="wcf.acp.option.mail_smtp_starttls"><![CDATA[SMTP Encryption]]></item>
+               <item name="wcf.acp.option.mail_smtp_starttls.none"><![CDATA[Disabled]]></item>
+               <item name="wcf.acp.option.mail_smtp_starttls.may"><![CDATA[If supported]]></item>
+               <item name="wcf.acp.option.mail_smtp_starttls.encrypt"><![CDATA[Required]]></item>
+               <item name="wcf.acp.option.mail_smtp_starttls.description"><![CDATA[This option controls the usage of “STARTTLS”. Disable it, if you are using SSL (port 465)!]]></item>
                <item name="wcf.acp.option.mail_smtp_user"><![CDATA[SMTP Username]]></item>
+               <item name="wcf.acp.option.mail_smtp_password"><![CDATA[SMTP Password]]></item>
                <item name="wcf.acp.option.mail_use_f_param"><![CDATA[Use “-f” parameter]]></item>
                <item name="wcf.acp.option.mail_use_f_param.description"><![CDATA[The “-f” parameter sets the proper sender of the email if the PHP send method is used. This parameter may not be supported by every server. Try disabling it, if you have trouble sending emails.]]></item>
                <item name="wcf.acp.option.meta_description"><![CDATA[Meta Description]]></item>