home *** CD-ROM | disk | FTP | other *** search
/ ftp.freefriends.org / ftp.freefriends.org.tar / ftp.freefriends.org / arnold / Source / mush.rstevens.tar.gz / mush.tar / advanced.mushrc < prev    next >
Text File  |  1990-10-21  |  5KB  |  135 lines

  1. # advanced.mushrc
  2. # by Bart Schaefer
  3. # with special thanks to Phil Lapsley <phil@east.Berkeley.EDU>, who
  4. # provided the original files on which this example is based.  Most of
  5. # Phil's stuff is still here -- just reorganized and updated to use
  6. # mush 6.4 features that were unavailable when Phil did the originals.
  7. #
  8. # This file is intended to demonstrate helpful ways to use the
  9. # .mushrc, not advanced mush commands.
  10.  
  11. # The variable $thisfolder is always set EXCEPT when the .mushrc file
  12. # is read the first time.  A test for non-existance of $thisfolder
  13. # allows the same .mushrc file to be sourced repeatedly without
  14. # redundant execution of the initialization commands.
  15. #
  16. if ! $?thisfolder
  17.     # Ignore the usual stuff
  18.     ignore    received via message-id status priority
  19.     # Hide folders in ~/.mail and save read mail in spool
  20.     set        folder=~/.mail hold
  21.     # Remember a few commands, set up editors, act like a shell
  22.     set        history=20 editor=ex visual=vi unix
  23.     # Prompt has folder name, message number, history number
  24.     set        prompt="%f %m (!) & "
  25.     # Header summaries show name, date, and subject
  26.     set        hdr_format="%25n %-15d  %27s"
  27.     # Initialize the cmds below (see later comments)
  28.     set        first_time=1
  29.  
  30.     # These two commands are used for automated "bursting" of the spool
  31.     # mailbox.  This means that the messages are reorganized into new
  32.     # folders to be read in a prearranged order.  See comments below.
  33.     #
  34.     # n brings up the next folder, not the next message
  35.     cmd        n    'source ~/.mushrc'
  36.     # N gets the next folder without "bursting"
  37.     cmd        N    'set first_time=0; source ~/.mushrc'
  38.  
  39.     # Delete messages by pattern-matching.  Examples:
  40.     #  del f mailer-daemon        Delete mail from mailer-daemon
  41.     #  del t mush-users            Delete mail to mush-users
  42.     cmd        del    'pick -i -\!* | delete'
  43.     # Forwarding
  44.     cmd        for    'mail -f'
  45.     # Quick folder change
  46.     cmd        F    'folder'
  47.  
  48.     # Some useful aliases
  49.     alias    dheller    'The Mush God <argv@sun.com>'
  50.     alias    barts    'Archangel Mushael <schaefer@cse.ogi.edu>'
  51.  
  52.     # On init, don't source beyond this point
  53.     exit
  54. endif    # End of init section -- read on startup only
  55.  
  56. # This part of the file handles "bursting".  A burst is done when the
  57. # n cmd is used the first time.  This is most useful if you habitually
  58. # have lots of mail when you first log in each morning; unwanted mail
  59. # can be deleted, and other mail organized for you.
  60. #
  61. # The folders in this example bursting scheme are:
  62. #    mush-users    anything to or cc'ed to mush-users
  63. #    stats        daily stats
  64. #    root        root mail other than daily stats
  65. # Mail not falling into one of these categories is left in the system
  66. # mailbox to be dealt with first.
  67. #
  68. if $first_time
  69.     # Kill off some uucp garbage
  70.     pick -i -s "file c.* delete" | delete
  71.     pick -i -s "file .* can.t access" | delete
  72.     pick -i -s "remote access to path/file denied" | delete
  73.     # Nuke the boring usenet stuff
  74.     pick -i -f usenet | pick -i -s "uucp map for" | delete
  75.     pick -i -t usenet | pick -i -s "returned mail" | delete
  76.     pick -i -t usenet | pick -i -s "automatic test echo" | delete
  77.     pick -i -t "owner-post" | pick -i -s "unknown mailer" | delete
  78.     pick -i -s "usenet disk space report" | delete
  79.     pick -i -s "very old news articles" | delete
  80.     pick -i -s "uucp map for" | delete
  81.     # Wipe out some uninteresting daily stats
  82.     pick -i -s "the maid was here." | delete
  83.     pick -i -s "daily accounting" | delete
  84.     pick -i -t netsurvey | delete
  85.     # Get rid of these things for good.  This isn't essential, but
  86.     # avoids complexity in the later "pick" commands.
  87.     update
  88.     # Save anything "to" or "cc" to mush-users in that folder.
  89.     pick -i -t mush-users | save +mush-users
  90.     pick -i -h cc mush-users | save +mush-users
  91.     # Also save interesting daily stat mail and generic root mail
  92.     pick -i -f root | pick -i -s stats | save +stats
  93.     pick -i -f root | pick -i -s report | save +stats
  94.     pick -i -f uucp | pick -i -s report | save +stats
  95.     pick -i -f root | pick -i -s summary | save +stats
  96.     pick -i -f root | pick -i -s munge | save +stats
  97.     pick -i -t root | save +root
  98.     # Again, make the changes permanent.  Saved mail gets deleted.
  99.     # This won't work if you have $keepsave set.
  100.     update
  101.  
  102.     # Make sure we don't burst again needlessly.
  103.     set first_time=0
  104.  
  105.     # Stop sourcing here.  Otherwise, we'd change folders without
  106.     # handling the mail left in the system mailbox.
  107.     exit
  108. endif
  109.  
  110. # Finally, handle stepping through the folders one by one.  This has been
  111. # set up for sendmail, where the system mailbox is /usr/spool/mail/$USER,
  112. # but could easily be modified for other mailers.
  113. #
  114. # $thisfolder:t returns the tail only of the folder name.
  115.  
  116. if $thisfolder:t == $USER
  117.     folder +stats
  118.     exit
  119. endif
  120.  
  121. if $thisfolder:t == stats
  122.     folder +mush-users
  123.     exit
  124. endif
  125.  
  126. if $thisfolder:t == mush-users
  127.     folder +root
  128.     exit
  129. endif
  130.  
  131. # Default back to the system mailbox
  132. folder %
  133.  
  134. # End of advanced.mushrc
  135.