<?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: piping emails to script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/piping-emails-to-script/m-p/3789673#M264801</link>
    <description>Hi Jerry,&lt;BR /&gt;&lt;BR /&gt;I think you ask for an example of "/usr/bin/somescript".&lt;BR /&gt;&lt;BR /&gt;In the following part of such a script the whole mail message is caught in a file and the subject and the sending user is analyzed.&lt;BR /&gt;Subject must contain the string 'Backup' and a hostname.&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;h4backup=$(tee /tmp/back.req | awk '/^Subject:/ {key=tolower($2); &lt;BR /&gt;if (key=="backup") host=$3;exit}&lt;BR /&gt;END {if(host) print tolower(host)}')&lt;BR /&gt;fromuser=$(awk '/^From: / {$1="";print;exit}' /tmp/back.req)&lt;BR /&gt;&lt;BR /&gt;# Wenn der exit-Status != NULL ist, beschwert sich der sendmail&lt;BR /&gt;if [ -z "$h4backup" ]&lt;BR /&gt;then&lt;BR /&gt;    date +%d%b%y-%X" Format der Backupanfrage ungueltig" &amp;gt;&amp;gt;$logfile&lt;BR /&gt;    print -n "\t\tFrom $fromuser\n\t\t" &amp;gt;&amp;gt;$logfile&lt;BR /&gt;    if grep '^Subject: ' /tmp/back.req&lt;BR /&gt;    then :&lt;BR /&gt;    else print Kein Subject:&lt;BR /&gt;    fi &amp;gt;&amp;gt;$logfile&lt;BR /&gt;    exit 0&lt;BR /&gt;fi&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;mfG Peter&lt;BR /&gt;</description>
    <pubDate>Wed, 17 May 2006 10:16:38 GMT</pubDate>
    <dc:creator>Peter Nikitka</dc:creator>
    <dc:date>2006-05-17T10:16:38Z</dc:date>
    <item>
      <title>piping emails to script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/piping-emails-to-script/m-p/3789672#M264800</link>
      <description>Does anyone have a script to process&lt;BR /&gt;email messages thru aliases file e.g.&lt;BR /&gt;&lt;BR /&gt;userid : "| /usr/bin/somescript"</description>
      <pubDate>Wed, 17 May 2006 09:00:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/piping-emails-to-script/m-p/3789672#M264800</guid>
      <dc:creator>jerry1</dc:creator>
      <dc:date>2006-05-17T09:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: piping emails to script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/piping-emails-to-script/m-p/3789673#M264801</link>
      <description>Hi Jerry,&lt;BR /&gt;&lt;BR /&gt;I think you ask for an example of "/usr/bin/somescript".&lt;BR /&gt;&lt;BR /&gt;In the following part of such a script the whole mail message is caught in a file and the subject and the sending user is analyzed.&lt;BR /&gt;Subject must contain the string 'Backup' and a hostname.&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;h4backup=$(tee /tmp/back.req | awk '/^Subject:/ {key=tolower($2); &lt;BR /&gt;if (key=="backup") host=$3;exit}&lt;BR /&gt;END {if(host) print tolower(host)}')&lt;BR /&gt;fromuser=$(awk '/^From: / {$1="";print;exit}' /tmp/back.req)&lt;BR /&gt;&lt;BR /&gt;# Wenn der exit-Status != NULL ist, beschwert sich der sendmail&lt;BR /&gt;if [ -z "$h4backup" ]&lt;BR /&gt;then&lt;BR /&gt;    date +%d%b%y-%X" Format der Backupanfrage ungueltig" &amp;gt;&amp;gt;$logfile&lt;BR /&gt;    print -n "\t\tFrom $fromuser\n\t\t" &amp;gt;&amp;gt;$logfile&lt;BR /&gt;    if grep '^Subject: ' /tmp/back.req&lt;BR /&gt;    then :&lt;BR /&gt;    else print Kein Subject:&lt;BR /&gt;    fi &amp;gt;&amp;gt;$logfile&lt;BR /&gt;    exit 0&lt;BR /&gt;fi&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;mfG Peter&lt;BR /&gt;</description>
      <pubDate>Wed, 17 May 2006 10:16:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/piping-emails-to-script/m-p/3789673#M264801</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2006-05-17T10:16:38Z</dc:date>
    </item>
  </channel>
</rss>

