I do believe that having a switch called "messaging off" with the help "Should the messaging system between site users be enabled?" should do what it says.
It seems obvious to me that the people who implemented this feature and ignored that setting in 1.6 actually created a bug. If teachers are sending messages then students have to receive them, which means they need to use the messaging interface (popups). People are sending messages to each other even though the admin said all messaging should be off. That's a bug.
I do hear what you are saying, and I understand you want to send messages of some kind to students. (I really hope you aren't using this to send messages to ALL students because you should be using a forum for that).
So, how about we do it like this:
Three controls:
CFG->messaging - on/off at site level
moodle/site:sendmessage - added to the authenticated user and teacher roles by default, for normal message sending (dependent on above setting)
moodle/course:bulkmessage - added to the teacher roles by default, controls the bulk messaging display (independent of above settings)
Even if the site messaging is off, it would STILL allow bulkmessage to work, however this would now inform you in the interface that you are sending EMAILS to the students directly instead of using the messaging system (because Moodle messaging has been disabled).
If site messaging is on, then bulkmessage could allow you to choose to send your message via Moodle messaging OR direct email.
Note that in all cases email should respect the "do not send email" setting in the profile.
How does that sound?
We could do that in 1.8 and 1.9.
We notice a similar situation whereby teachers trying to bulk message participants receive the following error:
'Sorry, but you do not currently have permissions to do that (Read all messages on site)'
However, when you check the role definitions teachers are allowed to bulk message via the following capability:
Send a message to many people
moodle/course:bulkmessaging
Switch the following to allow from not set for teachers seems to provide solution, but is it the intention to allow teachers to have this access (risks seem pretty low in most contexts):
Read all messages on site
moodle/site:readallmessages