3 # Email a received message in WAV format to some address
6 require './vgetty-lib.pl';
7 &foreign_check("mailboxes") || die "Read User Mail module not installed";
8 &foreign_require("mailboxes", "mailboxes-lib.pl");
10 # Get the WAV format message and construct the email
11 open(OUT, "rmdtopvf $ARGV[0] 2>/dev/null | pvftowav 2>/dev/null |");
12 while(read(OUT, $buf, 1024)) {
16 $now = localtime(time());
17 $host = &get_system_hostname();
18 $body = &text('email_body', $now, $host);
19 $mail = { 'headers' => [ [ 'From', &mailboxes::get_from_address() ],
20 [ 'To', $config{'email_to'} ],
21 [ 'Subject', $text{'email_subject'} ] ],
22 'attach' => [ { 'headers' => [ [ 'Content-Type', 'text/plain' ] ],
24 { 'headers' => [ [ 'Content-Transfer-Encoding',
27 'audio/wav; name="voicemail.wav"' ]],
32 &mailboxes::send_mail($mail);