<?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 Re: sendemail via SMTP relay server in Reporting</title>
    <link>https://community.splunk.com/t5/Reporting/sendemail-via-SMTP-relay-server/m-p/418682#M6912</link>
    <description>&lt;P&gt;Could be a permission issue.. Are you running the sendemail command within the search app context ?&lt;BR /&gt;
Also use the sendresults=true option:  &lt;CODE&gt;... | sendemail to="elvis@splunk.com" sendresults=true&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 31 Jul 2019 12:30:30 GMT</pubDate>
    <dc:creator>DavidHourani</dc:creator>
    <dc:date>2019-07-31T12:30:30Z</dc:date>
    <item>
      <title>sendemail via SMTP relay server</title>
      <link>https://community.splunk.com/t5/Reporting/sendemail-via-SMTP-relay-server/m-p/418681#M6911</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm trying to send emails via a SMTP relay server (alias "smart host" or "smarthost" [2]). No authentication is needed and no encryption is supported. I added the following &lt;STRONG&gt;[sendemail]&lt;/STRONG&gt; command to my &lt;STRONG&gt;/opt/splunk/etc/apps/search/local/commands.conf&lt;/STRONG&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[sendemail]
filename = sendemail.py
streaming = false
run_in_preview = false
passauth = false
required_fields =
changes_colorder = false
supports_rawargs = true
undo_scheduler_escaping = true
is_risky = true
supports_multivalues = true
use_ssl = false
use_tls = false
from = &amp;lt;email address&amp;gt;
server = &amp;lt;relay server host name&amp;gt;:&amp;lt;port&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When I try the search as Splunk administrator from within the search app context  &lt;CODE&gt;* | head 1 | sendemail to="&amp;lt;my email&amp;gt;" sendresults=true&lt;/CODE&gt;, then in the &lt;STRONG&gt;/opt/splunk/var/log/splunk/python.log&lt;/STRONG&gt; occurs the error  &lt;CODE&gt;ERROR     sendemail:1341 - 'namespace'&lt;/CODE&gt;. The result gets shown in the Browser (one event).&lt;/P&gt;

&lt;P&gt;Another application (not splunk) successfully sends emails via this relay server (from another host).&lt;/P&gt;

&lt;P&gt;I don't find other configuration parameters in the documentation[1], that may help. Any suggestions what I have missed?&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Frank&lt;/P&gt;

&lt;P&gt;[1] &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.0/SearchReference/Sendemail"&gt;https://docs.splunk.com/Documentation/Splunk/7.3.0/SearchReference/Sendemail&lt;/A&gt;&lt;BR /&gt;
[2] &lt;A href="https://en.wikipedia.org/wiki/Smart_host"&gt;https://en.wikipedia.org/wiki/Smart_host&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2019 07:49:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/sendemail-via-SMTP-relay-server/m-p/418681#M6911</guid>
      <dc:creator>frank_buettner</dc:creator>
      <dc:date>2019-07-31T07:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: sendemail via SMTP relay server</title>
      <link>https://community.splunk.com/t5/Reporting/sendemail-via-SMTP-relay-server/m-p/418682#M6912</link>
      <description>&lt;P&gt;Could be a permission issue.. Are you running the sendemail command within the search app context ?&lt;BR /&gt;
Also use the sendresults=true option:  &lt;CODE&gt;... | sendemail to="elvis@splunk.com" sendresults=true&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2019 12:30:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/sendemail-via-SMTP-relay-server/m-p/418682#M6912</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-07-31T12:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: sendemail via SMTP relay server</title>
      <link>https://community.splunk.com/t5/Reporting/sendemail-via-SMTP-relay-server/m-p/418683#M6913</link>
      <description>&lt;P&gt;sry for the late response:&lt;BR /&gt;
- in Splunk I'm logged in as Administrator&lt;BR /&gt;
- &lt;CODE&gt;sendresults=true&lt;/CODE&gt; doesn't make a difference&lt;BR /&gt;
- in the Browser, the result of the query is shown (one event)&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2019 05:40:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/sendemail-via-SMTP-relay-server/m-p/418683#M6913</guid>
      <dc:creator>frank_buettner</dc:creator>
      <dc:date>2019-08-12T05:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: sendemail via SMTP relay server</title>
      <link>https://community.splunk.com/t5/Reporting/sendemail-via-SMTP-relay-server/m-p/418684#M6914</link>
      <description>&lt;P&gt;Yes, I'm using the sendemail command within the search app context.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2019 05:43:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/sendemail-via-SMTP-relay-server/m-p/418684#M6914</guid>
      <dc:creator>frank_buettner</dc:creator>
      <dc:date>2019-08-12T05:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: sendemail via SMTP relay server</title>
      <link>https://community.splunk.com/t5/Reporting/sendemail-via-SMTP-relay-server/m-p/418685#M6915</link>
      <description>&lt;P&gt;@DavidHourani Do you have more suggestions? Is it possible at all to send mails via a SMTP relay server[1]? "Smart Host" would be a synonym for "relay server".&lt;/P&gt;

&lt;P&gt;[1]&lt;BR /&gt;
&lt;A href="https://en.wikipedia.org/wiki/Smart_host"&gt;https://en.wikipedia.org/wiki/Smart_host&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2019 06:45:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/sendemail-via-SMTP-relay-server/m-p/418685#M6915</guid>
      <dc:creator>frank_buettner</dc:creator>
      <dc:date>2019-08-22T06:45:06Z</dc:date>
    </item>
    <item>
      <title>Re: sendemail via SMTP relay server</title>
      <link>https://community.splunk.com/t5/Reporting/sendemail-via-SMTP-relay-server/m-p/418686#M6916</link>
      <description>&lt;P&gt;imo it should work just like an SMTP server... all it does is forward the emails.. did you try connecting directly to your SMTP server, at least that way you can ensure that your configs are right. If that's validated then there could be an extra configuration to add for this "sendemail" to work.&lt;/P&gt;

&lt;P&gt;You can also play around with the sendemail.py script (make sure to keep a backup first). If you're then able to send an email from the CLI with the script then Splunk should be able to do so as well..&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2019 08:34:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/sendemail-via-SMTP-relay-server/m-p/418686#M6916</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-08-22T08:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: sendemail via SMTP relay server</title>
      <link>https://community.splunk.com/t5/Reporting/sendemail-via-SMTP-relay-server/m-p/418687#M6917</link>
      <description>&lt;P&gt;We are now using a Microsoft Teams connector for pushing the notifications. So this is our "solution", although we did not manage to send emails via the relay server by using a python script.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 06:56:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/sendemail-via-SMTP-relay-server/m-p/418687#M6917</guid>
      <dc:creator>frank_buettner</dc:creator>
      <dc:date>2019-10-09T06:56:11Z</dc:date>
    </item>
  </channel>
</rss>

