Ok... I'm stuck.

I'm trying to use vgetty as an answerphone. I have got it answering the calls, playing the out-going message & recording peoples' messages to me fine. vgetty has an option in its config file to execute a command when it has finished recording the message, and will pass that command the message's filename as its argument.

I want vgetty to email me the incoming messages, but some processing needs to be done first; since the file is saved by vgetty in .rmd (Rockwell Modem Device?) format it has to be converted to .pvf (Portable Voice File?) before being converted to .wav. I then want to convert it to .mp3 (to save bandwidth, and because the MP3 seems the most ubiquitous compressed format) before emailing it to myself.

I *can* use `cat foo.wav | uuencode foo.wav | sendmail [EMAIL PROTECTED] to send a binary file to myself and it would seem to be readable using my Mac's email client, but to be tidy and because I don't know on which system I'll be listening to messages in the future I want to add the correct MIME headers.

After some Googling, reading of the fine manual, use of `apropos` &c &c it seems that I have a command called `makemime` installed on my Gentoo system (by CourierIMAP or maildrop) which should do the task.

So I start to write a little shell script as a wrapper.

I've spent a little time making sure each part works ok... piping text-files into sendmail, and renaming the original file after the time&date when the script has finished. But when I get to the actual piping of a file into `makemime` it falls over. Now this is really weird, because I can do it from the commandline fine, but not it seems as part of a shell script.

At the commandline:
   $ cat foo.wav | makemime -c "audio/x-wav" -e "base64" -
   Content-Type: audio/x-wav
   Content-Transfer-Encoding: base64

UklGRqaKAQBXQVZFZm10IBAAAAABAAEAIBwAACAcAAABAAgAZGF0YYGKAQCAf39/f39/ gICAgICA
gICAgIB/f39/f39/f4CAgICAgICAf39/fn5+fn9/gICAgYGBgYGAgH9/f39/ f3+AgICAgICAgH9/
...

I've attached my script. I'm guessing that someone out there will find it laughably easy to explain why this isn't working for me, but I'm absolutely baffled. If I run this script the result of the 2nd-last (uncommented) line indicates that I am trying the very same commands & variables as I've shown above, and if I copy & paste that line back into my terminal, it works fine. But when I run the script I `makemime` always fails with its usage message:
Usage:
makemime -c type [-o file] [-e encoding] [-C charset] [-N name] \
[-a "Header: Contents"] file ...

I'm extremely indebted for any clarification,

Stroller.





Attachment: voiceemail.sh
Description: Binary data

--
[EMAIL PROTECTED] mailing list

Reply via email to