[ale] crontab forward remove e-mail

moisey.g.oysgelt at mail.sprint.com moisey.g.oysgelt at mail.sprint.com
Wed Sep 25 12:58:56 EDT 2002


Thank you for responses
this is the solution

#!/usr/bin/ksh
# read Mail from mailbox and forward it to ..
# adopted for Linux 
# Created by moisey Oysgelt 11/21/01 8:21AM

TMPFILE=~/monitors/logs/tmp_mail.log

while [[ 1 -eq 1 ]] ; do
 echo p |  mail > $TMPFILE 2>&1
  if [[ $? -ne 0 ]] ; then
    exit;
  fi
  if [[ -s $TMPFILE ]] ; then
    mail moisey.g.oysgelt at mail.sprint.com  -s `hostname` < $TMPFILE
  fi

done



-----Original Message-----
From: moisey.g.oysgelt [mailto:moisey.g.oysgelt at mail.sprint.com]
To: ale at ale.org
Sent: Tuesday, September 24, 2002 9:17 AM
To: ale
Subject: [ale] crontab forward remove e-mail


Hello experts!!
I created ,for monitoring purposes , a process   forward e-mail created 
by crontjob to my windows account, and delete the same mail from UNIX 
box.

I wrote and tested  a KORN script  :

#!/usr/bin/ksh
keeplooping=1;

while [[ $keeplooping -eq 1 ]] ; do
  echo m moisey at sprint.com| /usr/bin/mail >/dev/null
  if [[ $> -ne 0 ]] ; then
    break;
  fi
done
 
This script successfully runs in OS Solaris , but I could not make it 
run under Linux Suse, I have installed korn shell in the Linux box.


My question is  :  Do you have a similar script for Linux  or Is there 
better way to do the same task in the Linux environment ? 



Moisey Oysgelt 
      Proposal, Engineering & Pricing Software 
      Sprint->NIS->OSPI->ADM->PEPS 
      Business Phone: 404.649.5374 
      Business Fax:  404.649.5437 
      3100 Cumberland Circle 
      Atlanta GA 30339 
      Mailstop: GAATLN0515


      Moisey.G.Oysgelt at mail.sprint.com 



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.391 / Virus Database: 222 - Release Date: 09/19/02
 


---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems 
should be 
sent to listmaster at ale dot org.


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.391 / Virus Database: 222 - Release Date: 09/19/02

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.391 / Virus Database: 222 - Release Date: 09/19/02
 


---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list