#!/bin/sh

FILE=$1
WHO=$2
ID=$3
USER=$4

BOUND="$$-`date +%s`-vboxmail"

/usr/sbin/sendmail -oi -t <<EOT
To: $USER
Subject: New voice message (${WHO})
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="$BOUND"
Content-Disposition: inline


--$BOUND
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

New voice message (${WHO}) received:

File: $FILE
Who:  $WHO
Id:   $ID
Date: `date`

Regards, raccess4vbox3.

--$BOUND
Content-Type: text/plain; charset=unknown-8bit
Content-Disposition: attachment; filename="`basename $FILE`"
Content-Transfer-Encoding: quoted-printable

`mimencode -q $FILE`
--${BOUND}--

EOT
