File tree Expand file tree Collapse file tree 1 file changed +26
-6
lines changed
Expand file tree Collapse file tree 1 file changed +26
-6
lines changed Original file line number Diff line number Diff line change @@ -111,13 +111,33 @@ function __construct($conf) {
111111 else {
112112 $ this ->port = 25 ;
113113 }
114- if (isset ($ conf ['tls ' ]) && $ conf ['tls ' ]) {
115- $ this ->tls = true ;
116- }
117- else {
118- $ this ->tls = false ;
114+ $ this ->tls = false ;
115+ $ this ->starttls = false ;
116+ if (isset ($ conf ['tls ' ])) {
117+ $ tls_val = $ conf ['tls ' ];
118+ if (is_string ($ tls_val )) {
119+ $ normalized = mb_strtolower (trim ($ tls_val ));
120+ if ($ normalized === 'starttls ' ) {
121+ $ this ->starttls = true ;
122+ }
123+ elseif ($ normalized === 'tls ' || $ normalized === 'ssl ' || $ normalized === 'true ' || $ normalized === '1 ' ) {
124+ $ this ->tls = true ;
125+ }
126+ elseif ($ normalized === 'false ' || $ normalized === '0 ' || $ normalized === '' ) {
127+ // leave both false
128+ }
129+ elseif ($ tls_val ) {
130+ $ this ->tls = true ;
131+ }
132+ }
133+ elseif ($ tls_val === true || $ tls_val === 1 ) {
134+ $ this ->tls = true ;
135+ }
136+ elseif ($ tls_val ) {
137+ $ this ->tls = true ;
138+ }
119139 }
120- if (!$ this ->tls ) {
140+ if (!$ this ->tls && ! $ this -> starttls ) {
121141 $ this ->starttls = true ;
122142 }
123143 $ this ->request_auths = array (
You can’t perform that action at this time.
0 commit comments