no further mailreports after upgrading
-
Dear Community,
I've got a problem concerning mailreport.
After Upgrading from 2.1.5 to 2.4.3_1 over 2.2.6 and 2.3.4 mailreport doesn't work anymore.
With 2.1.5 my ~10 pfSense-VMs sendet me daily mails containing traffic and log reports.
cron, mailreport and RRD are installed and have been repetedly reinstalled.
On the mailreport config the before available pictue attachements are missing and when I activate "send system logs" nothing happens after pressing "test".
Mails are sent, when using the test option on the System/Advanced/Notifications page. What do I miss in my configuration?Regards - Ingo
-
The way the mailreports package function changed from 2.3.x on. It can't include graphs anymore.
It's possible that the reports are failing because parts of them can't be generated anymore. Edit the reports, remove any references to graphs, and try again.
Or make a new report that does only logs/commands and see if it works.
-
Hi.
Thanks for the answer.
I deleted all old reports and created a new one but no success.
As I already said: using the test option on the System/Advanced/Notifications page I receive the test mail which means to me that the mail configuration must be okay.
When pressing "Send now" on the config-page of a mail report nothing happens.
Cron also doesn't send mail reports. When invoking the command "/usr/local/bin/mail_reports_generate.php 0" manually this returns:
Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
The mail server log shows a connect and a disconnect without anyting else.
This is the same on every of the 10 pfSenses in our environment.
I'm not able to go down as far as it is described in the php error message.
After switching on more debug info in the mal report script by these lines (copied and changed the copy):ini_set('Display_errors', 'On');
error_reporting(E_ALL | E_STRICT);I got a little more output:
/root: /usr/local/bin/mymail_reports_generate.php 0
Notice: Undefined variable: ARCH in /etc/inc/config.inc on line 37
Notice: Undefined index: booting in /etc/inc/globals.inc on line 185
Notice: Undefined index: booting in /etc/inc/globals.inc on line 185
Notice: Undefined index: booting in /etc/inc/globals.inc on line 185
Notice: Undefined index: booting in /etc/inc/globals.inc on line 185
Notice: Undefined index: id in /usr/local/bin/mymail_reports_generate.php on line 31
Notice: Undefined index: disablesyslogclog in /etc/inc/mail_reports.inc on line 136
Notice: Undefined variable: attach in /usr/local/bin/mymail_reports_generate.php on line 91
Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Notice: Undefined variable: g in /etc/inc/config.lib.inc on line 937This doesn't say anything to me.
What is your advice?Ciao - Ingo
-
@ingoef said in no further mailreports after upgrading:
Mailer Error: SMTP connect() failed
Are you sure that doesn't say anything to you ? The https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting gives some hints.
It basically boils down to a a "can't reach your mail (smtp) server" : address ok ? port ok ? Protocol ok ? (TLS, SSL or non)Btw : the "Notices" are non-harmful.
-
@GertJan. thanks for your unqualified reply.
If you can read you notice twice in my report, that test mails from the box reach their receiver. Only mailreports don't.
Repetition especially for you:
using the test option on the System/Advanced/Notifications page I receive the test mail which means to me that the mail configuration must be okay.
Why would mails from there go through and do not from mailreport which should use the system configuration.
It must be a bug in the php environment.
Btw.: notices -harmful or not- why are they still produced in the productional environment of a so called stable pfSense when switching on more debug output?
And one more, why things which worked for years must loose their function in newer versions? -
@ingoef said in no further mailreports after upgrading:
It must be a bug in the php environment.
Just test drove this package.
I added a command likels -al /root
and a log file : the DHCP server log
I didn"t want to wait all day, so I launched what I found in the cron (use the package with the same name to see it) :
/usr/local/bin/mail_reports_generate.php 0 &
I received the mail right away.
I'm pretty sure you and I have the same PHP settings, versions, etc.
I had a look at the mail package : it winds up calling a send_mail function, the same that is used when testing the mail (sending capability). I don't say it's fine, but it looks fine to me. And it works ^^
Info : pfSense useless a phpmailer library. It has some nice debug capabilities, but you have to access them by hand.
php notices : well .... no, problem, you may worry. Sorry if I don't. You can 'redmine' them all of course.
@ingoef said in no further mailreports after upgrading:
not from mailreport which should use the system configuration.
I agree, mail_reports uses the same settings - the ones on this page System => Advanced => Notifications
-
thank you for the answer which repeated all my steps.
You are lucky, your setting obviously works, mine did not.
I tried all config variations on System => Advanced => Notifications and found out:
My pre-upgrade config worked fine with the mail server port 587 either with the mail test and the mail_report. After the pfsense upgrade mail_report fails with these settings.
Beause of authentication we have to use SSL/TLS. The only working option now is the setting which points to mail port 465 using SSL/TLS.
If the mail client would work properly, it should do on port 25 with TLS on and on port 587 (which uses TLS by default)
This means to me the mail client system is buggy at least because it is acting different on the page System => Advanced => Notifications => Test-SMTP-Settings and the offered scripts like mail_report. -
The SSL checkbox controls using SSL/TLS directly, not STARTTLS. It will attempt STARTTLS on its own.
Using the SSL checkbox with 25 or 587 is incorrect in nearly all cases. As is attempting to use port 465 without it.
Your "works" cases are all correct combinations.
The new mail client code is different than the previous version you were running. It does not have an explicit switch to turn on STARTTLS, it does so automatically.
-
so the only question is: why is there no function at all on port 587 in case of using it from a php script (my fault trying it?) while it's working by pressing the test button..