From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from th.inri.net ([216.126.196.42]) by ur; Fri Dec 23 21:20:21 EST 2016 Received: (qmail 75840 invoked from network); 24 Dec 2016 02:20:19 -0000 Received: from mirv.inri.net (HELO pav1) (167.88.120.88) by th.inri.net with SMTP; 24 Dec 2016 02:20:19 -0000 Date: Fri, 23 Dec 2016 21:20:10 -0500 From: sl@stanleylieber.com To: 9front@9front.org Subject: ml: script for searching and reading 9front-related mailing lists Message-ID: <17bf302552bac8d2a4f60fe504ed76d6@pav1.example.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: proxy markup information hosting #!/bin/rc # 2015-12-29T18:43:41-0500 # # SYNOPSIS # ml listname [ regex | message ] # # DESCRIPTION # Print commands to search or read 9front.org mailing list archives. # # EXAMPLES # First, make sure the mailing list archive is mounted: # % 9fs 9front # % ls /n/lists # /n/lists/9front # [snip] # # Load the entire 9front archive: # % ml 9front # # Search the 9front mailing list for messages containing regex: # % ml 9front hjdicks # ml 9front 1423821594.00 # > User-Agent: Mozilla/5.0 (compatible; hjdicks) # # Open msg 1423821594.00 from the 9front mailing list: # % ml 9front 1423821594.00 # # BUGS # THIS SCRIPT MAY BE BROKEN AT ANY GIVEN TIME! Download the latest version # from http://9front.org/extra/rc/ml before reporting bugs. # # This script reads messages with mother(1). Download it from # http://9front.org/extra/rc/mother. To use with nedmail(1), comment # out references to mother and uncomment references to nedmail. # # Opening an entire mailbox (mdir format) requires nupas/fs. Individual # messages can be opened with default upas/fs. # # Large mailboxes may take a VERY long time to open, or may fail to open # at all. # # SEE ALSO # Plumber rule for individual mdir messages (not 9front.org specific): # # mdir individual mail message file -> new mail window for message # type is text # data matches '[a-zA-Z¡-￿0-9/\-]+/[0-9]+.[0-9][0-9]' # plumb to showmail # plumb start rc -c '@{rfork n; ramfs; bind -ac /tmp `{basename -d '$0'}; upas/fs -f '$0'; window -m -r 4 120 750 600 mother -p 1}' # #plumb start rc -c '@{rfork n; ramfs; bind -ac /tmp `{basename -d '$0'}; upas/fs -f '$0'; window -m -r 4 120 750 600 upas/nedmail -s /mail/fs/mbox/1}' # rfork en fn usage{ echo usage: $0 '[ listname ] [ regex | message ]' >[1=2] exit usage } if(! ~ $#* 1 2) usage mlpath=/n/lists/$1 # Export env var $mlpath to mother(1) so the file path # to an individual message can be easily snarfed. if(~ $#* 1){ bind -ac /mail/box/$user /n/lists && upas/fs -f $mlpath && window -m -r 4 120 750 600 rc -c 'label ml '^$1^'; mother' #window -m -r 4 120 750 600 rc -c 'label ml '^$1^'; upas/nedmail -r' } if not if(~ $#* 2){ if(~ $2 *.[0-9][0-9]){ ramfs && bind -ac /tmp $mlpath && upas/fs -f $mlpath/$2 && window -m -r 4 120 750 600 rc -c 'label ml '^$1^' '^$2^'; mother -p 1' #window -m -r 4 120 750 600 rc -c 'label ml '^$1^' '^$2^'; upas/nedmail -s /mail/fs/mbox/1' } if not{ echo flags i >/n/lists/$1^ctl && echo $2 >/n/lists/$1^ctl &&