Cacti / cacti

Cacti ™
http://www.cacti.net
GNU General Public License v2.0
1.63k stars 403 forks source link

Cacti 1.1.36 mail sending error #1476

Closed kgujas closed 6 years ago

kgujas commented 6 years ago

Hi, i have cacti 1.1.36 on ubuntu 16.04 , and I still have the problem with mail sending ... with TLS , SSL or no security I always getting this error , SMTP connect() failed.

Anyone else have this issue ? Please help me, what to do first ...

anarkia1976 commented 6 years ago

Have you try to change metod to sendmail? it work? I don't have problem with my cacti server.

netniV commented 6 years ago

What are your settings for sending mail? Are you using SendMail, SMTP, etc?

cigamit commented 6 years ago

We should automatically changes the ports when someone changes the encryption from None to TLS or SSL.

netniV commented 6 years ago

I have thought that in the past. Should put it on the action list even if there's no response for this issue.

andermat8 commented 6 years ago

The only way I can get SMTP to work on my systems is to disable openssl from php.ini. I can select no security and it will still try and to an ssl handshake (seen in Wireshark) no matter what I set it to.

kgujas commented 6 years ago

My config is , php 7.0.25 , mariadb 10.0.34 .... email sending not working with smtp ( with ssl,tls , no security , port 25,465,587 , with or without authentication ) with sendmail i got this error , Sending Message... Could not execute: /usr/sbin/sendmail -t

with the same SMTP setting my old cacti 0.8.8 works OK.

kgujas commented 6 years ago

in my php.ini openssl is like this ;extension=php_openssl.dll

andermat8 commented 6 years ago

@kgujas, it's in there twice, make sure both are commented out. This is a band-aid / workaround that has worked for me anyway. Make sure to do a php -m to verify it is not loaded.

netniV commented 6 years ago

Disabling openssl will prevent plugins like routerconfigs from working. If you are not using those, it shouldn't be a major issue but do be aware of that.

kgujas commented 6 years ago

thanks , i run php -m and openssl is listed , now i'm trying to find where is it in the file twice

kgujas commented 6 years ago

Hi , i don't see anywhere in the php.ini the second line for openssl , what I see have the ; but when I run php -m openssl is listed ... please some help ...
is any problem with cacti 1.1.36 and php 7.0.25 and mariaDB 10.0.34 ?

netniV commented 6 years ago

@kgujas There may be an easier fix than disabling SSL, please check the PR #1481

andermat8 commented 6 years ago

I was going to test this out but under 1.1.37 (dev tree) the Send a Test Email link is broken. I'll try and create a test report instead.

netniV commented 6 years ago

Remind me where the Send A Test Email part is?

andermat8 commented 6 years ago

Configuration/Settings/Mail/Reporting/DNS under the Emailing Options section, actually there would be a link on the heading on the far right to send a test email.

andermat8 commented 6 years ago

Seems to work after updating functions.php with openssl enabled. Thanks!

kgujas commented 6 years ago

Hi , I'm not a big Linux expert , but I need a tool for monitoring my system... My CactiEZ 0.7 works ok . I installed the cacti 1.1.36 with help from tutorial from this site, https://www.itzgeek.com/how-tos/linux/ubuntu-how-tos/setup-cacti-network-monitoring-tool-on-ubuntu-14-04-linux-mint-17.html Maybe something wrong here I don't know ... Can someone give mi a link or tutorial How to install cacti 1.1.36 that works 100% ?

thanks

kgujas commented 6 years ago

everything works OK from this tutorial , except email sending ...

netniV commented 6 years ago

So, that tutorial will get you a linux system running cacti with a mysql or mariadb database. It does not cover, how to install sendmail and/or configure the SMTP settings needed for sending email out. Cacti offers you a couple of options which can be found in Console -> Configuration -> Settings -> Mail/DNS/Reporting (tab)

Your choices are:

Unfortunately, we can't tell you what they should be because that would depend on your network and configurations. If you already have this working on another server, imitate the settings from there.

kgujas commented 6 years ago

I set up config form email for SMTP , with same settings like on old CactiEZ , but I have error for sending mail
image

andermat8 commented 6 years ago

I'd recommend running wireshark and filter on port 25 while sending the email to see what you get. If you are seeing TLS handshake then security is not disabled. Did you update functions.php with the recommended changes?

kgujas commented 6 years ago

is it in LIB folder ? It's strange but I don't see it in that folder ?

andermat8 commented 6 years ago

It is in the cacti\lib folder, not the php\lib folder.

kgujas commented 6 years ago

Thanks you all for help me. Finally my cacti 1.1.36 sending mail OK , success .... I have changed my cacti/lib/functions php with suggested config and it's working now ok.

netniV commented 6 years ago

The functions.php update has now been merged into the develop branch.