Cacti / plugin_mactrack

Mactrack Plugin for Cacti
GNU General Public License v2.0
12 stars 25 forks source link

MACTRACK 4.5 on CACTI 1.2.23 doesn't send mail (SMTP send mail verified, ok) #178

Closed GrayFox14048 closed 1 year ago

GrayFox14048 commented 1 year ago

With the SMTP mail configured and tested in cacti settings, mactrack doesn't send any mail, or any error in log

GrayFox14048 commented 1 year ago

As described by m2hd in https://forums.cacti.net/viewtopic.php?p=252897, mactrack it's enable to send email again! Follow that guide, works for me

TheWitness commented 1 year ago

Can you do a pull request with your change?

GrayFox14048 commented 1 year ago

done! Anyway I'm new here, I'm not sure that's the right way to do that

jdcoats commented 1 year ago

I use mactrack 4.5 with Cacti1.2.23 and I get macauth notification emails without any modification required.

jdcoats commented 1 year ago

Okay, a little more information on my findings. If using a single email address it works as expected. If using 2 email addresses like user1@mydomain.com;user2@mydomain.com without a space after the semicolon you get the following

2023/01/10 13:41:02 - CMDPHP MAILER ERROR Backtrace: (/plugins/mactrack/poller_mactrack.php[229]:collect_mactrack_data(), /plugins/mactrack/poller_mactrack.php[856]:mactrack_mail(), /plugins/mactrack/lib/mactrack_functions.php[3138]:mailer(), /lib/functions.php[4848]:record_mailer_error(), /lib/functions.php[5049]:cacti_debug_backtrace())
2023/01/10 13:41:02 - CMDPHP MAILER ERROR: Invalid address: (to): user1@mydomain.com;user2@mydomain.com

If using 2 email addresses like user1@mydomain.com; user2@mydomain.com with a space after the semicolon you see success in the log like

2023/01/10 09:40:52 - MAILER INFO: Mail successfully sent via Sendmail from 'Cacti MACTrack <cacti@mydomain.com>', to 'user1@mydomain.com; <user2@mydomain.com>', cc '', and took 0.08 seconds, Subject 'MACAUTH Notification: Mac Address 'D4:81:D7:48:88:4F' Found, For: 'Dan Testing''

In this case only user2 receives an email.

Also the help tooltip reads "Enter a semicolon separated of email addresses" missing the word list. :)

TheWitness commented 1 year ago

I think they are supposed to be comma delimited. Read the help and get back to me.

jdcoats commented 1 year ago

Also the help tooltip reads "Enter a semicolon separated of email addresses" missing the word list. :)

TheWitness commented 1 year ago

Looks like a real bug. Something changed obviously.

TheWitness commented 1 year ago

Should be fixed now.