<?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: doubt regarding mail message in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/doubt-regarding-mail-message/m-p/3995331#M296433</link>
    <description>Okie .. :)&lt;BR /&gt;</description>
    <pubDate>Mon, 07 May 2007 16:39:20 GMT</pubDate>
    <dc:creator>Amadeus_1</dc:creator>
    <dc:date>2007-05-07T16:39:20Z</dc:date>
    <item>
      <title>doubt regarding mail message</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/doubt-regarding-mail-message/m-p/3995323#M296425</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I am new to UNIX and actually I am not sure if I should be asking this question on this forum. But I ve been using this forum for HPOV and it is a super forum.&lt;BR /&gt;&lt;BR /&gt;Well the doubt I ve got is ... &lt;BR /&gt;&lt;BR /&gt;I need to write a script to monitor if an user gets a new mail.&lt;BR /&gt;&lt;BR /&gt;When ever an User gets a new mail, I need to generate an alert in HPOV. This part I can do, but am not sure on how to check for new mails.&lt;BR /&gt;&lt;BR /&gt;I checked for the command mail -e, but this option tells me if I have a mail in the mailbox or not. &lt;BR /&gt;I am looking for only new mails.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 07 May 2007 14:32:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/doubt-regarding-mail-message/m-p/3995323#M296425</guid>
      <dc:creator>Amadeus_1</dc:creator>
      <dc:date>2007-05-07T14:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: doubt regarding mail message</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/doubt-regarding-mail-message/m-p/3995324#M296426</link>
      <description>Look inside the user's incoming mail file under /var/mail/&lt;USERNAME&gt;.&lt;/USERNAME&gt;</description>
      <pubDate>Mon, 07 May 2007 14:44:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/doubt-regarding-mail-message/m-p/3995324#M296426</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2007-05-07T14:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: doubt regarding mail message</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/doubt-regarding-mail-message/m-p/3995325#M296427</link>
      <description>Thanks Sandman,&lt;BR /&gt;&lt;BR /&gt;But I need to run a script every fifteen minutes that would require to do this.&lt;BR /&gt;&lt;BR /&gt;n if I check for the file under /var/mail/&lt;USER&gt; i would need to check for the time stamp. &lt;BR /&gt;&lt;BR /&gt;I thought there would be an easier way to do this.&lt;BR /&gt;&lt;BR /&gt;&lt;/USER&gt;</description>
      <pubDate>Mon, 07 May 2007 14:50:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/doubt-regarding-mail-message/m-p/3995325#M296427</guid>
      <dc:creator>Amadeus_1</dc:creator>
      <dc:date>2007-05-07T14:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: doubt regarding mail message</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/doubt-regarding-mail-message/m-p/3995326#M296428</link>
      <description>I would actually do this in Perl because all the pieces you need are there.&lt;BR /&gt;&lt;BR /&gt;Initially, create a file which lists&lt;BR /&gt;/var/mail/username&lt;TAB&gt;lastmodificationtime&lt;BR /&gt;for each users mailfile.&lt;BR /&gt;&lt;BR /&gt;Something like thisi, myfile1.pl:&lt;BR /&gt;---------------------------------------&lt;BR /&gt;#!/usr/bin/perl -w&lt;BR /&gt;&lt;BR /&gt;my $i = 0;&lt;BR /&gt;while ($i &amp;lt;= $#ARGV)&lt;BR /&gt;  {&lt;BR /&gt;    print $ARGV[$i],"\t",(stat($ARGV[$i])) [9],"\n";&lt;BR /&gt;    ++$i;&lt;BR /&gt;  }&lt;BR /&gt;-------------------------------------&lt;BR /&gt;Invoke it like this:&lt;BR /&gt;perl myfile1.pl /var/mail/* &amp;gt; myreferencefile&lt;BR /&gt;&lt;BR /&gt;Now your script will look for any files with newer modification times or files that are not in your reference files. After doing whatever operation you wish, you update the reference file with the new timestamps and any detected new files.&lt;BR /&gt;&lt;BR /&gt;I'm not saying you must use Perl but it will be easy in Perl and a bit tricky in the shell because of the timestamp comparisons.&lt;/TAB&gt;</description>
      <pubDate>Mon, 07 May 2007 15:07:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/doubt-regarding-mail-message/m-p/3995326#M296428</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-05-07T15:07:09Z</dc:date>
    </item>
    <item>
      <title>Re: doubt regarding mail message</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/doubt-regarding-mail-message/m-p/3995327#M296429</link>
      <description>thanks Clay,&lt;BR /&gt;&lt;BR /&gt;But I was wondering,&lt;BR /&gt;&lt;BR /&gt;When we logon, there appears a message that says "you have a new mail" which runs because of the profile.&lt;BR /&gt;There is a command that says &lt;BR /&gt;&lt;BR /&gt;/bin/mail -E&lt;BR /&gt;                case $? in&lt;BR /&gt;                0)&lt;BR /&gt;                        echo "You have new mail."&lt;BR /&gt;                        ;;&lt;BR /&gt;                2)&lt;BR /&gt;                        echo "You have mail."&lt;BR /&gt;                        ;;&lt;BR /&gt;                esac&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;but I am unsure if this will satisfy my case,&lt;BR /&gt;because instead of echo "You have new mail", i can write the command to generate that alert.&lt;BR /&gt;&lt;BR /&gt;Is this the same that I am looking at ??</description>
      <pubDate>Mon, 07 May 2007 15:37:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/doubt-regarding-mail-message/m-p/3995327#M296429</guid>
      <dc:creator>Amadeus_1</dc:creator>
      <dc:date>2007-05-07T15:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: doubt regarding mail message</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/doubt-regarding-mail-message/m-p/3995328#M296430</link>
      <description>You can run &lt;BR /&gt;mail -e &lt;BR /&gt;STAT=${?}&lt;BR /&gt;if [[ ${STAT} -eq 0 ]]&lt;BR /&gt;  then&lt;BR /&gt;    echo "New mail"&lt;BR /&gt;  fi&lt;BR /&gt;&lt;BR /&gt;but this is specific to a user but I interpreted your question to mean detect when any user gets new mail. Since it's related to OV, I would much rather write one routine that handles all of my OV users and requires only 1 cron entry --- but that's just me.</description>
      <pubDate>Mon, 07 May 2007 16:02:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/doubt-regarding-mail-message/m-p/3995328#M296430</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-05-07T16:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: doubt regarding mail message</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/doubt-regarding-mail-message/m-p/3995329#M296431</link>
      <description>Hi Clay,&lt;BR /&gt;&lt;BR /&gt;I checked this option but echo $? returns a value of 0 even when the mail has been read.&lt;BR /&gt;&lt;BR /&gt;I want to check only for new mails.&lt;BR /&gt;&lt;BR /&gt;$? does not return a value of 2 at all.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 07 May 2007 16:21:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/doubt-regarding-mail-message/m-p/3995329#M296431</guid>
      <dc:creator>Amadeus_1</dc:creator>
      <dc:date>2007-05-07T16:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: doubt regarding mail message</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/doubt-regarding-mail-message/m-p/3995330#M296432</link>
      <description>Well, my version of mail does mot have a -E option, mail -e does work as advertised and indicates that mail is present but not new mail. I've already shown you the way to do it, so get busy.</description>
      <pubDate>Mon, 07 May 2007 16:36:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/doubt-regarding-mail-message/m-p/3995330#M296432</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-05-07T16:36:22Z</dc:date>
    </item>
    <item>
      <title>Re: doubt regarding mail message</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/doubt-regarding-mail-message/m-p/3995331#M296433</link>
      <description>Okie .. :)&lt;BR /&gt;</description>
      <pubDate>Mon, 07 May 2007 16:39:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/doubt-regarding-mail-message/m-p/3995331#M296433</guid>
      <dc:creator>Amadeus_1</dc:creator>
      <dc:date>2007-05-07T16:39:20Z</dc:date>
    </item>
  </channel>
</rss>

