Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    E-mail notifications granularity

    Scheduled Pinned Locked Moved General pfSense Questions
    11 Posts 5 Posters 2.9k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • rcfaR Offline
      rcfa
      last edited by

      Is there a way to control what things are being sent by e-mail notification?
      I'd like to get things like VPN being down, or package or OS updates being available, but don't want my inbox cluttered by the output of every single cron run…

      Ideas? Did I miss something somewhere?

      1 Reply Last reply Reply Quote 0
      • rcfaR Offline
        rcfa
        last edited by

        I'm pretty much getting swamped by cron reports, so I had to disable e-mail notifications again.

        What, besides cron, is sending out SMTP/e-mail notifications?
        Anyway to get cron to shut up?

        Unfortunately, at this point, this whole thing is so verbose as to be useless.

        1 Reply Last reply Reply Quote 0
        • D Offline
          doktornotor Banned
          last edited by

          Getting exactly zero cron emails. If you are getting swamped, you usually have a broken cron entry.

          1 Reply Last reply Reply Quote 0
          • M Offline
            muswellhillbilly
            last edited by

            Redirect your cron jobs into a black hole. eg: "x * * * * /path/to/my/script > /dev/null 2>&1". That will prevent your cron jobs from issuing emails.

            If anything else is sending out emails other than cron, you'll have to provide more information before anyone can help much with that.

            1 Reply Last reply Reply Quote 0
            • rcfaR Offline
              rcfa
              last edited by

              I think maybe the bigger issue I have is this: I don't seem to find documented what I should even expect to result in an e-mail notification.
              e.g. will the availability of a package update result in an e-mail?
              will a suspected DDoS attack trigger an email notification?

              Obviously, I can modify my cron entries to dump to /dev/null but my expectation would have been that only non-routine events would trigger a notification, and a cron script running on schedule hardly qualifies as non-routine.

              In essence what I would ideally picture is a settings page sort of like the one for XMLRPC sync, where one can tick checkmarks indicating what sort of things one wants to be notified of by means of e-mail notifications.

              1 Reply Last reply Reply Quote 0
              • rcfaR Offline
                rcfa
                last edited by

                Also, I forgot to say that, there seems to be a bug: even after I checked the "Disable SMTP Notifications" box on the System:Advanced:Notifications page, I still get the cron e-mail reports.

                I seems that as soon as valid configuration data is present, the reports are being sent, regardless of the "Disable SMTP Notification" setting.

                1 Reply Last reply Reply Quote 0
                • P Offline
                  phil.davis
                  last edited by

                  @rcfa:

                  Also, I forgot to say that, there seems to be a bug: even after I checked the "Disable SMTP Notifications" box on the System:Advanced:Notifications page, I still get the cron e-mail reports.

                  I seems that as soon as valid configuration data is present, the reports are being sent, regardless of the "Disable SMTP Notification" setting.

                  The only place I can see in the code where it sends a notification while notifications are disabled, is the "Test SMTP" button - which is supposed to ignore the disabled state.
                  Can you give examples of the "cron" notifications you are getting?
                  Maybe it is a particular package that is calling  notify_via_smtp() with the $force=true ?

                  As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
                  If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

                  1 Reply Last reply Reply Quote 0
                  • rcfaR Offline
                    rcfa
                    last edited by

                    @doktornotor:

                    Getting exactly zero cron emails. If you are getting swamped, you usually have a broken cron entry.

                    well, one's a script to periodically delete a specific file should it be present, one that vhosts had a bad habit of creating (index.php). That cron entry I made myself, well before I set up SMTP notifications, so no /dev/null redirection

                    But another which is not my doing: an expiretable script from sshlockout…
                    ...so chances are that package updates will reverse any changes i make to the script

                    1 Reply Last reply Reply Quote 0
                    • D Offline
                      dgcom
                      last edited by

                      The issue with cron emails is a know one.
                      I wrote about it before - this is cron's default functionality to send email if any job produces stderr output.
                      The reason why not too many people are complaining is because default pfSense install does NOT have sendmail executable, so no emails are going out.
                      But the moment you install package like arpwatch - it will add sendmail link to special php script used by pfSense - cron will start spamming you (if there are jobs with output).
                      The best solution for this I found is to add this line to crontab file:

                      MAILTO=""
                      

                      Or you can redirect output of most annoying jobs to /dev/null if you are interested in output of some of them… up to you.

                      DG

                      1 Reply Last reply Reply Quote 0
                      • rcfaR Offline
                        rcfa
                        last edited by

                        @phil.davis:

                        @rcfa:

                        Also, I forgot to say that, there seems to be a bug: even after I checked the "Disable SMTP Notifications" box on the System:Advanced:Notifications page, I still get the cron e-mail reports.

                        I seems that as soon as valid configuration data is present, the reports are being sent, regardless of the "Disable SMTP Notification" setting.

                        The only place I can see in the code where it sends a notification while notifications are disabled, is the "Test SMTP" button - which is supposed to ignore the disabled state.
                        Can you give examples of the "cron" notifications you are getting?
                        Maybe it is a particular package that is calling  notify_via_smtp() with the $force=true ?

                        Just had a simple cron entry like /bin/rm somefile, so no package involved, other than the cron entry editor package, with which I created that cron entry.
                        The other script is exipring sshlockout tables, but I didn't make that script.

                        1 Reply Last reply Reply Quote 0
                        • rcfaR Offline
                          rcfa
                          last edited by

                          @dgcom:

                          The issue with cron emails is a know one.
                          I wrote about it before - this is cron's default functionality to send email if any job produces stderr output.
                          The reason why not too many people are complaining is because default pfSense install does NOT have sendmail executable, so no emails are going out.
                          But the moment you install package like arpwatch - it will add sendmail link to special php script used by pfSense - cron will start spamming you (if there are jobs with output).
                          The best solution for this I found is to add this line to crontab file:

                          MAILTO=""
                          

                          Or you can redirect output of most annoying jobs to /dev/null if you are interested in output of some of them… up to you.

                          I'll try that, hope editing cron with the cron editor package won't bounce it out of the file…

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post
                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.