Building on the work at http://techpatio.com/2012/guides-how-to/mountain-lion-mail-default-from-field-se nder-bug I made an Applescript that solves (for me) two really annoying bugs that Apple introduced in Mail with Mountain Lion. Specifically, it achieves the following:
1. Reply or reply-to-all mails are sent from your account as found in the to field of the message you are replying to (as opposed to the default Mountain Lion Mail behavior where Mail uses the mailbox in which the replied-to-mail is stored to set the sending account, which is the issue described in this thread)
2. Reply-to-all mails don't contain your email in to or cc fields (as opposed to the default Mountain Lion Mail behavior where Mail often places your address in the cc or to field so you have to remove it manually, which is the issue described e.g. here: https://discussions.apple.com/thread/4162668?answerId=19113964022#19113964022)
It's probably not pretty or optimized in any way but it does the job for me. http://techpatio.com/2012/guides-how-to/mountain-lion-mail-default-from-field-se nder-bug includes instructions how to replace the default Mail key combinations for reply and reply-to-all with executions of this script.
Note that you will need to compile two versions of this script, one as below for the reply-to-all command replacement and another one for the reply command replacement in which you replace the line:
set theReply to reply selectedMessage with reply to all
by the line
set theReply to reply selectedMessage
Otherwise the two scripts are identical.
Here is the script for reply-to-all:
on run
tell application "Mail"
set theSelection to selection
if ((count of theSelection) > 0) then
set selectedMessage to item 1 of theSelection
set addresses to address of every recipient of selectedMessage
set theccRecipients to address of cc recipients of selectedMessage
set thetoRecipients to address of to recipients of selectedMessage
set theSender to sender of selectedMessage
set sentTo to ""
repeat with selectedAccount in accounts
set accountemails to email addresses of selectedAccount
repeat with accountemail in accountemails
if addresses contains accountemail then
set sentTo to full name of selectedAccount & " "
set senttoAddress to accountemail
exit repeat
end if
end repeat
end repeat
set theReply to reply selectedMessage with reply to all
tell theReply to set sender to sentTo
tell theReply to delete cc recipients
tell theReply to delete to recipients
repeat with a from 1 to count theccRecipients
set insertccRecipient to item a of theccRecipients
if insertccRecipient does not contain senttoAddress then
tell theReply to make new cc recipient with properties {address:insertccRecipient}
end if
end repeat
tell theReply to make new to recipient with properties {address:theSender}
repeat with a from 1 to count thetoRecipients
set inserttoRecipient to item a of thetoRecipients
if inserttoRecipient does not contain senttoAddress then
tell theReply to make new to recipient with properties {address:inserttoRecipient}
end if
end repeat
tell theReply to set visible to true
else
display dialog ("Select a message before running this script.")
end if
end tell
end run