![]()
#!/bin/sh
#linkify: make links in an e-mail clickable
show -noshowproc $* | rmhdr | urlify > /tmp/$$.html
lynx /tmp/$$.html
rm /tmp/$$.html
Very handy if you hate HTML e-mail, but nevertheless from time to time get e-mails full of urls — it's nice to be able to just follow the link in that case. Note the use of pre-existing scripts chained together in a pipe: it's The Unix Way.
#!/bin/sed -f
#urlify: convert urls in a text file to browser-parseable html
1i\
<pre>
s/\(http:\/\/[^ ]*\)/<a href="\1">\1<\/a>/g
$a\
</pre>
#!/bin/sed -f
1,/^$/d
#!/bin/sed -f
/^From: /,/^$/d
#!/bin/sh
#todays-mail: lists mail received today, as stored in user's procmail log
procmaillog=$HOME/.procmail/log
# first is portable, second is faster but specific to GNU date
#today=`date +'%a %b %d'|sed 's/0\([1-9]\)/ \1/'`
progname=`basename $0`
case $progname in
today*) today=`date +'%a %b %_d'` ;;
yesterday*) today=`date +'%a %b %_d' —date '1 day ago'` ;;
esac
#grep "$today" $procmaillog
tail -2000 $procmaillog | grep "$today"
#!/bin/sh
#mailq-c: count number of entries in mailq
mailq |
sed -e '1{
s/[^0-9]*\([0-9][0-9]*\)[^0-9]*/\1/
q
}'
#!/bin/sh
#isspam: ... so deal with it
case $* in
"") show -noshowproc +inbox cur | bfilter isspam && refile +spam ;;
esac
for i in $*
do
show -noshowproc $i | bfilter isspam && refile +spam
done
folder +spam last
folder +inbox
[back to Scripts index] [back to Linux, Unix, etc] [Main Site] [Weblog]
Contents licensed under the GPL