-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathnew_msg
More file actions
executable file
·74 lines (60 loc) · 1.93 KB
/
new_msg
File metadata and controls
executable file
·74 lines (60 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/sh
#
# new_msg script for use with OpenAM
# Copyright (C) Equivalence Pty Ltd 1999
#
# Permission is given to freely copy, redistribute or change this
# program, provided this notice is retained intact.
#
# The information and code herein is provided "as is"
# without warranty of any kind, either expressed or implied.
# In no event shall EQUIVALENCE be liable for any damages
# whatsoever including direct, indirect, incidental,
# consequential, loss of business profits or special damages,
# even if EQUIVALENCE has been advised of the possibility of such damages.
#
extension="wav"
contenttype="audio/x-wav"
mimencode=/usr/bin/mimencode
sendmail=/usr/lib/sendmail
sox=/usr/bin/sox
fn="$1"
src="$2"
remoteParty="$3"
duration="$4"
codec="$5"
product="$6"
#tempfn=${fn}.tmp
tempfn=/tmp/voice.temp
#email=equival@equival.com.au
email="${USER}@`dnsdomainname`"
sourceemail=h323voice
seperator="========== $$fn =========="
echo Date: `date` > $tempfn
echo To: $email >> $tempfn
echo From: ${sourceemail}@`hostname` >> $tempfn
echo Subject: H323 voice message from \""$remoteParty"\" >> $tempfn
echo Mime-Version: 1.0 >> $tempfn
echo Content-Type: multipart/mixed\; boundary=\"$seperator\" >> $tempfn
echo "">> $tempfn
echo --$seperator >> $tempfn
echo Content-Type: text/plain\ >> $tempfn
echo Content-Transfer-Encoding: 8bit >> $tempfn
echo "">> $tempfn
echo "Filename: $fn" >> $tempfn
echo "Source: $src" >> $tempfn
echo "RemoteParty: $remoteParty" >> $tempfn
echo "Duration: $duration" >> $tempfn
echo "Codecs: $codec" >> $tempfn
echo "Product: $product" >> $tempfn
echo "">> $tempfn
echo --$seperator >> $tempfn
echo Content-Type: $contenttype\; name=\"$pagefn\" >> $tempfn
echo Content-Transfer-Encoding: base64 >> $tempfn
echo Content-Disposition: attachment\; filename=\"$pagefn\" >> $tempfn
echo "">> $tempfn
$mimencode $fn >> $tempfn
#rm -f $fn
echo --$seperator >> $tempfn
$sendmail < $tempfn $email
rm -f $tempfn