Version 1.1.6 and SMTP issue

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
tychoo
Posts: 1
Joined: Thu May 11, 2017 5:57 pm

Version 1.1.6 and SMTP issue

Post by tychoo »

Just setup 1.1.6 on a fresh Ubuntu install and am having issues getting SMTP to work:

Message on web server when sending a test mail:
Sending Message...

SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ ... leshooting


cacti.log:
2017-05-11 16:18:23 - ERROR PHP WARNING: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in file: /usr/share/cacti/include/phpmailer/class.smtp.php on line: 369
2017-05-11 16:18:23 - CMDPHP PHP ERROR WARNING Backtrace: (/settings.php: 100 email_test)(/lib/functions.php: 3809 send_mail)(/lib/functions.php: 3390 mailer)(/lib/functions.php: 3685 send)(/include/phpmailer/class.phpmailer.php: 1213 postSend)(/include/phpmailer/class.phpmailer.php: 1335 smtpSend)(/include/phpmailer/class.phpmailer.php: 1540 smtpConnect)(/include/phpmailer/class.phpmailer.php: 1677 startTLS)(/include/phpmailer/class.smtp.php: 369 stream_socket_enable_crypto)(CactiErrorHandler)(/lib/functions.php: 4308 cacti_debug_backtrace)

php Version:
PHP 7.0.15-0ubuntu0.16.04.4 (cli) ( NTS )
User avatar
Osiris
Cacti Guru User
Posts: 1424
Joined: Mon Jan 05, 2015 10:10 am

Re: Version 1.1.6 and SMTP issue

Post by Osiris »

This is a better subject for the phpmailer github or simply search Google. But after you find the solution, update your ticket here and mark it solved for others to find.
Before history, there was a paradise, now dust.
munkey
Posts: 2
Joined: Tue Feb 20, 2018 12:53 pm

Re: Version 1.1.6 and SMTP issue

Post by munkey »

I know this is an old thread but I've literally spent hours trying to find the answer to this exact question.

The solution I used was to add the lines below to the /lib/functions.php file just under the line where $mail is first declared, see below.

Code: Select all

$mail = new PHPMailer;
$mail->SMTPOptions = array(
        'ssl' => array(
        'verify_peer' => false,
        'verify_peer_name' => false,
        'allow_self_signed' => true
    )
);  
Afterwards I was able to send email without further issue.
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Version 1.1.6 and SMTP issue

Post by netniV »

Can you post this as an issue at https://github.com/cacti/cacti/issues ? Also post your fix.

However, it may already be resolved in 1.1.35 and the imminent 1.1.36 release.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests