home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / system / mail / delivery / deliver.tz / deliver / samples / u-vacation < prev   
Encoding:
Text File  |  1989-10-24  |  1.0 KB  |  41 lines

  1. : u-vacation
  2. # A user delivery file for when you're on vacation.
  3. #
  4. # The ALREADY file remembers who you've already mailed vacation messages to.
  5. # The BEBACK string is the date you will return.
  6.  
  7. ALREADY=vacation.list
  8. BEBACK="on July 4, 1776"
  9.  
  10. echo "$1"               # Keep the mail!
  11.  
  12. if grep '^'${SENDER}'$' $ALREADY >/dev/null 2>/dev/null
  13. then
  14.     exit 0              # We already notified this person; reject
  15. fi
  16.  
  17. case $SENDER in
  18. *uucp)  exit 0 ;;       # Not a human; reject
  19. *daemon) exit 0 ;;      # Not a human; reject
  20. *DAEMON) exit 0 ;;      # Not a human; reject
  21. *!*)    ;;
  22. *@*)    ;;
  23. ## *)      exit 0 ;;       # Local user; reject (maybe)
  24. esac
  25.  
  26. # Remember this person
  27. echo $SENDER >>$ALREADY
  28.  
  29. # Send the vacation message
  30. SUBJECT=`header -f subject $HEADER`
  31. mail -s "I'm on vacation" $SENDER <<!EOF!
  32. Your message to me on the subject
  33.     "$SUBJECT"
  34. has been delivered.  However, I am on vacation, so I have not yet
  35. read your message.  I will be back $BEBACK.
  36.  
  37. This is the only such message you will receive.
  38.  
  39. Thank you.
  40. !EOF!
  41.