This is a script that lets you define a dictionary of user and email mappings. When the user sends or replies to an email, if the email selected for the user does not match what is in the dictionary, the user will be alerted to change the selected mailbox:

name: Alert If Email is Wrong
description: Define a dictionary of users and email addresses and alert the user if they are using the wrong email address.
author: Ben McCormack
version: 1.0.0.0
js:
var sUsers = {};
//define your user and mailbox associations here. The user name must match
//the full name of the user in FogBugz. The mailbox must match an available
//option in the From field when sending an email.
sUsers['Ben McCormack'] = '"Ben McCormack" <cases@benmtest.fogbugz.com>';
sUsers['Barney Rubble'] = '"FogBugz On Demand" <cases@benmtest.fogbugz.com>';
var sDefaultBackgroundCSS = $('div.body.editable div.emailHeader').css('background-color');
//main is called at the bottom
function main() {
if (!replyingToEmail()){
return;
}
if (!emailAddressMatchesUser()){
notifyUserOfMismatch();
}
}
//this function tells us if we're currently replying to an email
function replyingToEmail(){
return $('div.body.editable .emailHeader').length !== 0;
}
//this function tells us if the "From" address matches the current
//user. You can define this however you want.
function emailAddressMatchesUser(){
var sSelectedEmailAddress = $('select#sFrom option[selected="selected"]').text();
var sCurrentUser = GetFullName();
if (sUsers[sCurrentUser]===undefined){
//this user didn't have a mailbox defined, so just return true
return true;
}
return sUsers[sCurrentUser] === sSelectedEmailAddress;
}
//this function defines what happens when the From address doesn't
//match what is expected for this user. You can define this however
//you want.
function notifyUserOfMismatch(){
if ($('div.emailMismatch').length !== 0) {
return;
}
sUser = GetFullName();
$('div.body.editable div.emailHeader').css('background-color','#CC5151');
sMessage = 'ALERT! You should change the From address to: <br>' + htmlEncode(sUsers[sUser]);
$('div.body.editable div.emailHeader').prepend('<div class="emailMismatch">' + sMessage + '</div>');
}
function clearNotification(){
if ($('div.emailMismatch').length !== 0) {
$('div.emailMismatch').remove();
$('div.body.editable div.emailHeader').css('background-color',sDefaultBackgroundCSS)
}
}
function htmlEncode(value){
return $('<div/>').text(value).html();
}
$(document).ready(function(){
main();
});
$(window).on('BugViewChange', function(event) {
main();
});
css:
div.emailMismatch{
font-weight: bold;
font-size: 120%;
}
There are several other variations of this in the answers below.