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

    Test email has no hostname?

    Scheduled Pinned Locked Moved General pfSense Questions
    6 Posts 3 Posters 969 Views 4 Watching
    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.
    • I Offline
      incith
      last edited by

      When I send a test smtp message the exact string that gets emailed to me is:

      This is a test message from . It is safe to ignore this message.
      

      I've tried re-setting the hostname etc but it doesn't appear to have helped.

      GertjanG 1 Reply Last reply Reply Quote 0
      • GertjanG Offline
        Gertjan @incith
        last edited by

        @incith

        Locate :

        function saveAdvancedNotifications($post, $json = false) {
        	global $config, $smtp_authentication_mechanisms, $pushover_sounds, $g;
        

        in the file /usr/local/pfSense/include/www/system_advanced_notifications.inc

        and add, as shown, a $g and save.

        No "help me" PM's please. Use the forum, the community will thank you.
        Edit : and where are the logs ??

        johnpozJ I 2 Replies Last reply Reply Quote 1
        • johnpozJ Offline
          johnpoz LAYER 8 Global Moderator @Gertjan
          last edited by johnpoz

          @gertjan is there a redmine for this?

          I found this https://redmine.pfsense.org/issues/10718

          edit: So your fix works and now get his

          This is a test message from Netgate pfSense Plus. It is safe to ignore this message.
          

          But should prob use just the hostname that was setup on pfsense..

          An intelligent man is sometimes forced to be drunk to spend time with his fools
          If you get confused: Listen to the Music Play
          Please don't Chat/PM me for help, unless mod related
          SG-4860 24.11 | Lab VMs 2.8, 24.11

          GertjanG 1 Reply Last reply Reply Quote 0
          • GertjanG Offline
            Gertjan @johnpoz
            last edited by

            @johnpoz said in Test email has no hostname?:

            But should prob use just the hostname that was setup on pfsense..

            The message uses the global variable

            $g['product_label']
            

            Because $g[...] is used, it should be made available to the function where it's used. A rather classic issue, I've seen it more often.
            I'm not proposing or choosing 'pfSense' here : it's a global available string.

            In /etc/inc/globals.inc :

            global $g;
            $g = array(
            ......
            	"product_label" => "pfSense",
            .......
            

            I agree, using the host name here would be more appropriate. Especially if you have several pfSense instances running.

            No "help me" PM's please. Use the forum, the community will thank you.
            Edit : and where are the logs ??

            johnpozJ 1 Reply Last reply Reply Quote 0
            • johnpozJ Offline
              johnpoz LAYER 8 Global Moderator @Gertjan
              last edited by

              You want to put in the redmine? ;)

              They should really at min fix the missing variable you pointed out. And maybe suggest using a different one ;)

              An intelligent man is sometimes forced to be drunk to spend time with his fools
              If you get confused: Listen to the Music Play
              Please don't Chat/PM me for help, unless mod related
              SG-4860 24.11 | Lab VMs 2.8, 24.11

              1 Reply Last reply Reply Quote 0
              • I Offline
                incith @Gertjan
                last edited by

                @gertjan said in Test email has no hostname?:

                @incith

                Locate :

                function saveAdvancedNotifications($post, $json = false) {
                	global $config, $smtp_authentication_mechanisms, $pushover_sounds, $g;
                

                in the file /usr/local/pfSense/include/www/system_advanced_notifications.inc

                and add, as shown, a $g and save.

                Just wanted to say thanks for this!

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