#!/bin/bash # inbx.sh - by dual # # Creates a browsable page # for nmh-handled mail ########################## # Define input and output dirs IN="$HOME/inbox" OUT="$HOME/email" # Clean out email dir rm $OUT/* # Retrieve and incorporate mail fetchmail inc # Convert each message in inbox to HTML for i in $(ls -l $HOME/inbox | awk '{print $9}' | sort -g); do mhonarc -single < $IN/$i > $OUT/$i.html done # Output HTML header cat > $OUT/inbox.html < dual's Inbox

dual's Inbox

EOF # Create links for each HTML message for j in $(ls -l $OUT | awk '{print $9}' | grep -v inbox | sort -g); do echo "Message $j - " >> $OUT/inbox.html grep "" $OUT/$j | sed 's/<title>//' | sed 's/<\/title>//' \ >> $OUT/inbox.html echo "<br>" >> $OUT/inbox.html done # Close out HTML echo "</body>" >> $OUT/inbox.html echo "</html>" >> $OUT/inbox.html # Launch lynx to browse messages lynx $OUT/inbox.html