[ SOLVED ] Email Reports stopped working



  • Hey Y'all,

    I've had email reports working for quite a while now, sending to a postfix box on my LAN. Recently, I had to rebuild that box (not sure if related, but timely...) and I am not getting my daily reports any more.

    Strange thing is testing SMTP ( from System / Advanced / Notifications ) works fine, but going to my email report ( Status / Email Reports / Edit Reports ) and clicking "Send Now" silently fails. I've reverse-listed /var/log after doing so and can't find which log it's updating, if any.

    Any direction would be greatly appreciated!

    Forgot to add my version:
    2.4.4-RELEASE-p3 (amd64)
    built on Thu May 16 06:01:19 EDT 2019
    FreeBSD 11.2-RELEASE-p10



  • Update, I rebooted the router as a long shot and it sent me a nice email notifying me of the reboot but still won't send the report from that "Send Now" link.



  • And there is literally nothing in the System log?



  • @KOM said in Email Reports stopped working:

    And there is literally nothing in the System log?

    I just installed "Mailreports".

    It was 11h02, so I set up a daily report, to be send at 11h05.
    I also hit the "Send now" button.

    I received both mails, the test mail and the timed mail.

    I didn't found anything in the pfSense logs - but my postfix log was verbose, as usual.

    The first mail comes in :

    Aug  1 11:03:18 ns311465 postfix/smtpd[6715]: E853463E0F37: client=tunnel245809-pt.tunnel.tserv10.par1.ipv6.he.net[2001:470:1f12:5c0::2], sasl_method=LOGIN, sasl_username=gertjan@kroeb.me
    Aug  1 11:03:19 ns311465 postfix/cleanup[6718]: E853463E0F37: message-id=<5cf79b65af84c03cb134bc86d80850f5@pfsense.brit-hotel-fumel.net>
    Aug  1 11:03:19 ns311465 postfix/qmgr[25884]: E853463E0F37: from=<pfsense@brit-hotel-fumel.net>, size=15094, nrcpt=1 (queue active)
    Aug  1 11:03:19 ns311465 postfix/smtpd[6715]: disconnect from tunnel245809-pt.tunnel.tserv10.par1.ipv6.he.net[2001:470:1f12:5c0::2]
    Aug  1 11:03:21 ns311465 return-from-amavis/smtpd[6724]: A501A63E0FB0: client=localhost.localdomain[127.0.0.1]
    Aug  1 11:03:21 ns311465 postfix/cleanup[6718]: A501A63E0FB0: message-id=<5cf79b65af84c03cb134bc86d80850f5@pfsense.brit-hotel-fumel.net>
    Aug  1 11:03:21 ns311465 postfix/qmgr[25884]: A501A63E0FB0: from=<pfsense@brit-hotel-fumel.net>, size=15868, nrcpt=1 (queue active)
    Aug  1 11:03:21 ns311465 postfix/smtp[6719]: E853463E0F37: to=<gertjan@kroeb.me>, relay=127.0.0.1[127.0.0.1]:10026, delay=2.9, delays=0.65/0.02/0/2.3, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as A501A63E0FB0)
    Aug  1 11:03:21 ns311465 postfix/qmgr[25884]: E853463E0F37: removed
    

    So, @h1pp13p373 - time to check your postfix setup - or the route to it.



  • Thanks for the responses Y'all!

    I ran 'clog -f system.log' when trying to manually run the report and I dont' see anything at all in system.log, but running the smtp test does show up Here's a tail during the login and both tests:

    Aug 1 11:14:59 <pfsense> php-fpm[1649]: /system_advanced_admin.php: Successful login for user 'xxx' from: <LAN IP> (Local Database)
    Aug 1 11:15:16 <pfsense> php-fpm[342]: /system_advanced_notifications.php: Message sent to <my LAN email> OK

    The report is scheduled to run at 9am daily and it also failed from the scheduled run. Seems to me like an issue with the report itself, but I made a test report with just ' /usr/local/sbin/pftop' (which does run from cli) and it also fails with a manual run or a scheduled run.



  • Finally figured this one out. I ended up installing the cron package, which revealed that mailreports is running '/usr/local/bin/mail_reports_generate.php 0'. Running that on cli produced 'Mailer Error: SMTP connect() failed.'

    Jacking around with an email script from cli, I had to change 'auth' to false, leading me to search for SSL checking in pfsense as I run postfix on port 25 (LAN only). I removed the check from 'Validate SSL/TLS' under System > Advanced > Notifications and VOILA! Now the mailreports 'send now' button works.

    So it seems mailreports will fail silently if that validation is attempted and it's sending to an open mail server (port 25), but other applications such as system (for reboot notices), arpwatch, and SMTP tests all work fine. Go figure.



  • @h1pp13p373 said in [ SOLVED ] Email Reports stopped working:

    i t's sending to an open mail server (port 25)

    That's a quick-and-dirty mail server ^^

    port 25 is reserved for incoming mails from other mail servers - never-ever mail clients. That's and old trick that should be abolished. Use port 587 or even better : 465 which means : authenticity before sending mail.
    Furthermore, SSL/TLS should work just fine if good certs are set up into postfix.
    These certs should be trusted - not self generated or something like that. That's not an issue these days as Letenscrypt certs are not only good for web servers, but also mail servers (incoming smtp) and imap/pop etc.

    Typically, this test https://www.checktls.com/ should be all green.


Log in to reply