Systemmails via google's SMTP not working and smtp_crypt saved wrong
Actually I was not able to send system mails via Google until I changed the _smtp_login() behaviour to send HELO before STARTTLS as described in the RFC 821.
The first command in a session must be the HELO command. The HELO command may be used later in a session as well.
-- ./interface/lib/classes/ispcmail.inc.php:547-557
// ENCRYPTED?
if($this->smtp_crypt == 'tls') {
fputs($this->_smtp_conn, 'STARTTLS' . $this->_crlf);
response = fgets(
this->_smtp_conn, 515);
stream_socket_enable_crypto($this->_smtp_conn, true, STREAM_CRYPTO_METHOD_TLS_CLIENT);
}
//Say Hello to SMTP
if($this->smtp_helo == '') $this->detectHelo();
fputs($this->_smtp_conn, 'HELO ' . $this->smtp_helo . $this->_crlf);
$response = fgets($this->_smtp_conn, 515);
++ ./interface/lib/classes/ispcmail.inc.php:547-557
//Say Hello to SMTP
if($this->smtp_helo == '') $this->detectHelo();
fputs($this->_smtp_conn, 'HELO ' . $this->smtp_helo . $this->_crlf);
response = fgets(
this->_smtp_conn, 515);
// ENCRYPTED?
if($this->smtp_crypt == 'tls') {
fputs($this->_smtp_conn, 'STARTTLS' . $this->_crlf);
response = fgets(
this->_smtp_conn, 515);
stream_socket_enable_crypto($this->_smtp_conn, true, STREAM_CRYPTO_METHOD_TLS_CLIENT);
}
Additionally the smtp_crypt was not working (smtp_crypt was always "y" instead of "tls" or "ssl")
-- ./interface/web/admin/form/system_config.tform.php:288-293 'smtp_crypt' => array ( 'datatype' => 'VARCHAR', 'formtype' => 'CHECKBOX', 'default' => 'n', 'value' => array(0 => 'n',1 => 'y') ), ++ ./interface/web/admin/form/system_config.tform.php:288-293 'smtp_crypt' => array ( 'datatype' => 'VARCHAR', 'formtype' => 'SELECT', 'default' => 'none', 'value' => array('none' => 'none', 'tls' => 'tls', 'ssl' => 'ssl') ),
-- ./interface/web/admin/templates/system_config_mail_edit.htm:64-69
{tmpl_var name='smtp_crypt_txt'}
++ ./interface/web/admin/templates/system_config_mail_edit.htm:64-69