When using email notification on pfSense 2.3 with STARTTLS i got the following error:
Error: could not start TLS connection encryption protocol
This is due to PHP 5.6 which forces the certificate validation as a default. Here is the fix, hope that the upstream developers fix this in a future version:
open file /etc/inc/smtp.inc and find the following lines:
if($this->debug)
$this->OutputDebug('Starting TLS cryptograpic protocol');
############## ADD THIS BEGIN ########################
stream_context_set_option($this->connection, [
"ssl" => [
"verify_peer" => false,
"verify_peer_name" => false,
"allow_self_signed" => true
]
]);
############## ADD THIS END ##########################
if(!($success = @stream_socket_enable_crypto($this->connection,1,STREAM_CRYPTO_METHOD_TLS_CLIENT)))
$this->error = 'could not start TLS connection encryption protocol';
else
{
if($this->debug)
$this->OutputDebug('TLS started');
$success = $this->StartSMTP($localhost);
}