<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic can't  send an alert email with &amp;quot;ERROR:root:'NoneType' object has no attribute 'find' while sending mail to...&amp;quot;? in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/can-t-send-an-alert-email-with-quot-ERROR-root-NoneType-object/m-p/226330#M4146</link>
    <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/1093i04D93472AFF126C6/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;BR /&gt;
The alert triggers and Splunk tries to send the alert email, but something is wrong.&lt;BR /&gt;
In the internal log, I find this one error:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;03-02-2016 19:22:04.376 +0800 ERROR ScriptRunner - stderr from '/data/splunk/bin/python /data/splunk/etc/apps/search/bin/sendemail.py "results_link=http://linuxscan:8000/app/asset_discovery/@go?sid=scheduler__admin_YXNzZXRfZGlzY292ZXJ5__RMD51f09c7f374d6ba97_at_1456917720_400" "ssname=危险端口开启告警" "graceful=True" "trigger_time=1456917721" results_file="/data/splunk/var/run/splunk/dispatch/scheduler__admin_YXNzZXRfZGlzY292ZXJ5__RMD51f09c7f374d6ba97_at_1456917720_400/results.csv.gz"': ERROR:root:'NoneType' object has no attribute 'find' while sending mail to: test@test.com
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Server information:&lt;BR /&gt;
6.3.0&lt;BR /&gt;
Splunk internal version&lt;BR /&gt;
aa7d4b1ccb80&lt;/P&gt;

&lt;P&gt;Installed app:&lt;BR /&gt;
Asset Discovery&lt;BR /&gt;
version&lt;BR /&gt;
6.0&lt;BR /&gt;
internal version&lt;BR /&gt;
10&lt;/P&gt;</description>
    <pubDate>Wed, 02 Mar 2016 11:39:05 GMT</pubDate>
    <dc:creator>perlish</dc:creator>
    <dc:date>2016-03-02T11:39:05Z</dc:date>
    <item>
      <title>can't  send an alert email with "ERROR:root:'NoneType' object has no attribute 'find' while sending mail to..."?</title>
      <link>https://community.splunk.com/t5/Alerting/can-t-send-an-alert-email-with-quot-ERROR-root-NoneType-object/m-p/226330#M4146</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/1093i04D93472AFF126C6/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;BR /&gt;
The alert triggers and Splunk tries to send the alert email, but something is wrong.&lt;BR /&gt;
In the internal log, I find this one error:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;03-02-2016 19:22:04.376 +0800 ERROR ScriptRunner - stderr from '/data/splunk/bin/python /data/splunk/etc/apps/search/bin/sendemail.py "results_link=http://linuxscan:8000/app/asset_discovery/@go?sid=scheduler__admin_YXNzZXRfZGlzY292ZXJ5__RMD51f09c7f374d6ba97_at_1456917720_400" "ssname=危险端口开启告警" "graceful=True" "trigger_time=1456917721" results_file="/data/splunk/var/run/splunk/dispatch/scheduler__admin_YXNzZXRfZGlzY292ZXJ5__RMD51f09c7f374d6ba97_at_1456917720_400/results.csv.gz"': ERROR:root:'NoneType' object has no attribute 'find' while sending mail to: test@test.com
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Server information:&lt;BR /&gt;
6.3.0&lt;BR /&gt;
Splunk internal version&lt;BR /&gt;
aa7d4b1ccb80&lt;/P&gt;

&lt;P&gt;Installed app:&lt;BR /&gt;
Asset Discovery&lt;BR /&gt;
version&lt;BR /&gt;
6.0&lt;BR /&gt;
internal version&lt;BR /&gt;
10&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2016 11:39:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/can-t-send-an-alert-email-with-quot-ERROR-root-NoneType-object/m-p/226330#M4146</guid>
      <dc:creator>perlish</dc:creator>
      <dc:date>2016-03-02T11:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: can't  send an alert email with "ERROR:root:'NoneType' object has no attribute 'find' while sending mail to..."?</title>
      <link>https://community.splunk.com/t5/Alerting/can-t-send-an-alert-email-with-quot-ERROR-root-NoneType-object/m-p/226331#M4147</link>
      <description>&lt;P&gt;Hi perlish, it will be difficult to pinpoint the issue with just the above info. What do you see in the python.log?&lt;BR /&gt;
&lt;CODE&gt;$SPLUNK_HOME/var/log/splunk/python.log&lt;/CODE&gt;&lt;BR /&gt;
Is any email going out of your splunk server (for other alerts)?&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2016 15:34:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/can-t-send-an-alert-email-with-quot-ERROR-root-NoneType-object/m-p/226331#M4147</guid>
      <dc:creator>Yasaswy</dc:creator>
      <dc:date>2016-03-02T15:34:19Z</dc:date>
    </item>
    <item>
      <title>Re: can't  send an alert email with "ERROR:root:'NoneType' object has no attribute 'find' while sending mail to..."?</title>
      <link>https://community.splunk.com/t5/Alerting/can-t-send-an-alert-email-with-quot-ERROR-root-NoneType-object/m-p/226332#M4148</link>
      <description>&lt;P&gt;Hi, Yasaswy   .thanks for you answer my question ~.&lt;/P&gt;

&lt;P&gt;any email going out of your splunk server (for other alerts)?&lt;BR /&gt;
   not anyone email success to send .    and  i'm  sure  the sender account&amp;amp;password is right &lt;/P&gt;

&lt;P&gt;python.log  with two error line :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2016-03-03 10:39:04,434 +0800 ERROR sendemail:114 - Sending email. subject="Splunk Alert: 危险端口开启告警 high port scan", results_link="http://linuxscan:8000/app/asset_discovery/@go?sid=scheduler__admin_YXNzZXRfZGlzY292ZXJ5__RMD51f09c7f374d6ba97_at_1456972740_1332", recipients="[u'test@test.com']", server="smtp.exmail.test.com:465"
2016-03-03 10:39:04,434 +0800 ERROR sendemail:377 - 'NoneType' object has no attribute 'find' while sending mail to: test@test.com
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 Mar 2016 02:52:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/can-t-send-an-alert-email-with-quot-ERROR-root-NoneType-object/m-p/226332#M4148</guid>
      <dc:creator>perlish</dc:creator>
      <dc:date>2016-03-03T02:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: can't  send an alert email with "ERROR:root:'NoneType' object has no attribute 'find' while sending mail to..."?</title>
      <link>https://community.splunk.com/t5/Alerting/can-t-send-an-alert-email-with-quot-ERROR-root-NoneType-object/m-p/226333#M4149</link>
      <description>&lt;P&gt;when trigger sendemail  all log  (include "info" log)&lt;BR /&gt;&lt;BR /&gt;
&lt;A href="https://answers.splunk.comstorage/temp/107219-pythonlog.zip"&gt;link text&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2016 02:53:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/can-t-send-an-alert-email-with-quot-ERROR-root-NoneType-object/m-p/226333#M4149</guid>
      <dc:creator>perlish</dc:creator>
      <dc:date>2016-03-03T02:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: can't  send an alert email with "ERROR:root:'NoneType' object has no attribute 'find' while sending mail to..."?</title>
      <link>https://community.splunk.com/t5/Alerting/can-t-send-an-alert-email-with-quot-ERROR-root-NoneType-object/m-p/226334#M4150</link>
      <description>&lt;P&gt;I believe there is a minor bug here. In the Email settings page "Send mail as" field is optional, however on sendemail.py file, this field is required. It is being used without any null/none check on line 96.&lt;/P&gt;

&lt;P&gt;When i enter a valid sender address i get no error, if i dont enter i get "'NoneType' object has no attribute 'find' while sending mail to: ...." error.&lt;/P&gt;

&lt;P&gt;sendemail.py code;&lt;BR /&gt;
 # make sure the sender is a valid email address&lt;BR /&gt;
        if sender.find("@") == -1:&lt;BR /&gt;
            sender = sender + '@' + socket.gethostname()&lt;BR /&gt;
            if sender.endswith("@"):&lt;BR /&gt;
              sender = sender + 'localhost'*&lt;/P&gt;

&lt;P&gt;I face this issue in;&lt;BR /&gt;
Splunk Version Splunk Light Version 6.4.1&lt;BR /&gt;
Splunk Build debde650d26e&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2016 06:15:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/can-t-send-an-alert-email-with-quot-ERROR-root-NoneType-object/m-p/226334#M4150</guid>
      <dc:creator>canuzun</dc:creator>
      <dc:date>2016-06-16T06:15:00Z</dc:date>
    </item>
  </channel>
</rss>

