E-mail voicemails using alternative client

Hi,

I have successfully set up Asterisk 1.4.1 with voicemail, and the system is running well.

Right now I have the following in voicemail.conf:

mailcmd=/usr/local/bin/sendEmail -f recipient@xyz.com -u “Subject Line Here”

E-mails are sent when voicemails are received, but the attachment is sent as an inline base64 encode as follows:

–voicemail_5100023051907740648
Content-Type: audio/x-WAV; name="msg0005.WAV"
Content-Transfer-Encoding: base64
Content-Description: Voicemail sound attachment.
Content-Disposition: attachment; filename=“msg0005.WAV”

UklGRgYVAABXQVZFZm10IBQAAAAxAAEAQB8AAFkGAABBAAAAAgBAAWZhY3QEAAAAgGYAAGRh
dGHSFAAAZVpbIoaCwdbJlNOnU4OPNomcxspBiUQ+9Ly1Yqa79eR6mjMiRt4kslrbtod1IVSB

Extracting and decoding this is a pain.

Is there any way to extract the full path of the recorded message for use in the mailcmd line above (with the -a ‘attachment’ option)? Either that, or pass the full path to an external script?

Thanks,
Peter