Plan 9 from Bell Labs’s /usr/web/sources/contrib/nemo/rc/bin/Mails

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#!/bin/rc
# Do not edit this file. Edit /sys/src/cmd/mail2fs/Mails instead
# or cp Mails /sys/src/cmd/mail2fs/Mails

# use mails to can an omero interface via ox.

opt=()
if (~ $1 -l){
	if (~ $#2 0)
		mbox=/mail/box/$user/mails
	if not
		mbox=$2
	cd $mbox || exit 'no mbox'
	if (test -e $mbox/*/[0-9]*/text)@{
		for (x in $mbox/*/[0-9]*/text){
			grep From $x /dev/null | sed 1q | sed 's/:From: /=/' 
		}
	} | sort
	exit ''
}

if (~ $1 -a){
	opt=-a
	shift
}
if (~ $1 -s){
	opt=-s
	shift
}
if (~ $1 -A){
	opt=-A
	shift
}

switch($#*){
case 0
	mbox=mails
case 1
	mbox=$1
case *
	echo usage $0 [-alsA] [mbox] >[1=2]
	exit usage
}

mails $opt $mbox | plumb -i -d edit -p /mnt/plumb/send -a 'action=showdata filename=/mail/box/'$user/$mbox
exit ''

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.