Index: apps/app_voicemail.c =================================================================== --- apps/app_voicemail.c (revision 75402) +++ apps/app_voicemail.c (working copy) @@ -3914,8 +3914,17 @@ attach_user_voicemail = ast_test_flag(vmu, VM_ATTACH); if (!ast_strlen_zero(vmu->serveremail)) myserveremail = vmu->serveremail; + + if (attach_user_voicemail) { + RETRIEVE(todir, msgnum); + } + /*XXX possible imap issue, should category be NULL XXX*/ sendmail(myserveremail, vmu, msgnum, vmu->context, vmu->mailbox, cidnum, cidname, fn, fmt, duration, attach_user_voicemail, chan, category); + + if (attach_user_voicemail) { + DISPOSE(todir, msgnum); + } } if (!ast_strlen_zero(vmu->pager)) {