Uday Reddy <usr.vm.ro...@gmail.com> writes: > blueman writes: > >> Well, I wasn't able to find any hooks, but I solved my problem for now >> by putting 'before' advice on the function smtpmail-via-smtp. That is >> where the final changes are made to the email (including adding on mime >> & content headers and stripping off the on RFC standard headers) before >> it is actually sent. > > Hi JJK, I couldn't see why this can't be done in vm-mail-send-hook or its > senior, mail-send-hook.
The problem is that those hooks come too early in the process before all the headers and mimification is done. > Structurally, tagging this on to smtpmail isn't quite right because it has > nothing to do with smtpmail as such. It wouldn't fire if you use some other > mail sending mechanism. I agree but I couldn't find any earlier hooks and this was the only "clean" (though non-natural) place I could add my code via 'advice' without hacking into the actual vm routines themselves. Basically, I wanted the ability to modify the outgoing email when the header & body is complete and it is just about to be sent off to the mail transfer agent whether smtpmail or anything else. Unfortunately, I couldn't find a hook that gave access to the entire final email header and body. If I am missing something, please enlighten me.