New 2006 DPL
[infodrom/calendar] / mail-calendar
index c0e96e3..e394b1f 100755 (executable)
 #  
 #   $Id$
 
+#
+#   Important note: this program requires the FreeBSD version of
+#   calendar.  The OpenBSD version uses incompatible commandline
+#   options and doesn't provide features used by this program.
+#
+
 opt_subject="Calendar for"
 opt_dateform="%B %d"
 opt_to=$LOGNAME
@@ -29,7 +35,7 @@ opt_advance=0
 
 usage()
 {
-    echo "mail-calendar [-h|--help] [-l|--lang locale] [-t|--to addr] [-a|--advance]"
+    echo "mail-calendar [-h|--help] [-l|--lang locale] [-t|--to addr] [-a|--advance days]"
 }
 
 # Parse arguments
@@ -87,7 +93,10 @@ then
     (
        echo "Subject: $opt_subject $s_date"
        echo "To: $opt_to"
+       echo "Content-Type: text/plain; charset=iso-8859-1"
+       echo "Content-Disposition: inline"
+       echo "Content-Transfer-Encoding: 8bit"
        echo
-       calendar -l 0 -w 0 -t $c_date
+       cat $tmp
     ) | /usr/sbin/sendmail "$opt_to"
 fi