reverted FROM: field changes and set message_reply_real_address to false if checkbox is unchecked
diff --git a/Allura/allura/ext/user_profile/templates/send_message_form.html b/Allura/allura/ext/user_profile/templates/send_message_form.html
index df31796..26caa8f 100644
--- a/Allura/allura/ext/user_profile/templates/send_message_form.html
+++ b/Allura/allura/ext/user_profile/templates/send_message_form.html
@@ -31,7 +31,7 @@
         <b>To:</b> <a href="{{user.url()}}">{{user.display_name|default(user.username)}}</a>
     </div>
     <div class="grid-19">
-        <b>From:</b> {{c.user.email_address_header()}}
+        <b>From:</b> {{c.user.display_name}}
     </div>
     <div class="grid-19">&nbsp;</div>
     <form method="{{method}}" action="{{action}}">
diff --git a/Allura/allura/ext/user_profile/user_main.py b/Allura/allura/ext/user_profile/user_main.py
index b7ca32b..22b4200 100644
--- a/Allura/allura/ext/user_profile/user_main.py
+++ b/Allura/allura/ext/user_profile/user_main.py
@@ -209,6 +209,8 @@
         if c.user.can_send_user_message():
             if reply_to_real_address:
                 c.user.set_pref('message_reply_real_address', True)
+            else:
+                c.user.set_pref('message_reply_real_address', False)
             c.user.send_user_message(
                 c.project.user_project_of, subject, message, cc, reply_to_real_address, c.user.preferences.email_address)
             flash("Message sent.")
@@ -217,7 +219,7 @@
                 g.user_message_max_messages,
                 g.user_message_time_interval), 'error')
         return redirect(c.project.user_project_of.url())
-        
+
     @without_trailing_slash
     @expose('jinja:allura.ext.user_profile:templates/user_card.html')
     def user_card(self):
diff --git a/Allura/allura/model/auth.py b/Allura/allura/model/auth.py
index 3f77fa4..5382996 100644
--- a/Allura/allura/model/auth.py
+++ b/Allura/allura/model/auth.py
@@ -817,6 +817,7 @@
         h = header.Header()
         h.append('"%s"%s' % (self.get_pref('display_name'),
                              ' ' if six.PY2 else ''))  # py2 needs explicit space for unicode/text_type cast of Header
+        h.append('<%s>' % self.get_pref('email_address'))
         return h
 
     def update_notifications(self):
diff --git a/Allura/allura/tasks/mail_tasks.py b/Allura/allura/tasks/mail_tasks.py
index 0df7cc0..c6da880 100644
--- a/Allura/allura/tasks/mail_tasks.py
+++ b/Allura/allura/tasks/mail_tasks.py
@@ -176,8 +176,7 @@
             except Exception:
                 log.exception('Error looking up user with ID: %r' % addr)
                 continue
-            # retrieve active email address
-            addr = user.preferences.email_address
+            addr = user.email_address_header()
             if not addr and user.email_addresses:
                 addr = user.email_addresses[0]
                 log.warning(
diff --git a/Allura/allura/tests/functional/test_user_profile.py b/Allura/allura/tests/functional/test_user_profile.py
index 0db7d57..ecaa6f5 100644
--- a/Allura/allura/tests/functional/test_user_profile.py
+++ b/Allura/allura/tests/functional/test_user_profile.py
@@ -115,7 +115,7 @@
         response = self.app.get(
             '/u/test-user/profile/send_message', status=200)
         assert 'you currently have user messages disabled' not in response
-        response.mustcontain('<b>From:</b> &#34;Test Admin&#34;')
+        response.mustcontain('<b>From:</b> Test Admin')
 
         self.app.post('/u/test-user/profile/send_user_message',
                       params={'subject': 'test subject',
@@ -163,7 +163,7 @@
         response = self.app.get(
             '/u/test-user/profile/send_message', status=200)
         assert 'you currently have user messages disabled' not in response
-        response.mustcontain('<b>From:</b> &#34;Test Admin&#34;')
+        response.mustcontain('<b>From:</b> Test Admin')
         self.app.post('/u/test-user/profile/send_user_message',
                       params={'subject': 'test subject',
                               'message': 'test message',
diff --git a/Allura/allura/tests/test_tasks.py b/Allura/allura/tests/test_tasks.py
index ec664e9..7c73399 100644
--- a/Allura/allura/tests/test_tasks.py
+++ b/Allura/allura/tests/test_tasks.py
@@ -34,7 +34,7 @@
 from tg import tmpl_context as c, app_globals as g
 
 from datadiff.tools import assert_equal
-from alluratest.tools import assert_in, assert_less
+from nose.tools import assert_in, assert_less
 from ming.orm import FieldProperty, Mapper
 from ming.orm import ThreadLocalORMSession
 from testfixtures import LogCapture
@@ -271,7 +271,7 @@
 
             assert_equal(rcpts, [c.user.get_pref('email_address')])
             assert_in('Reply-To: %s' % g.noreply, body)
-            assert_in('From: "Test Admin"', body)
+            assert_in('From: "Test Admin" <test-admin@users.localhost>', body)
             assert_in('Subject: Test subject', body)
             # plain
             assert_in('This is a test', body)
@@ -355,7 +355,7 @@
             assert_equal(_client.sendmail.call_count, 1)
             return_path, rcpts, body = _client.sendmail.call_args[0]
             body = body.split('\n')
-            assert_in('From: "Test Admin"', body)
+            assert_in('From: "Test Admin" <test-admin@users.localhost>', body)
 
             c.user.disabled = True
             ThreadLocalORMSession.flush_all()
@@ -385,7 +385,7 @@
             assert_equal(_client.sendmail.call_count, 1)
             return_path, rcpts, body = _client.sendmail.call_args[0]
             body = body.split('\n')
-            assert_in('From: "Test Admin"', body)
+            assert_in('From: "Test Admin" <test-admin@users.localhost>', body)
             assert_in('Sender: tickets@test.p.domain.net', body)
             assert_in('To: test@mail.com', body)
 
@@ -401,7 +401,7 @@
             assert_equal(_client.sendmail.call_count, 1)
             return_path, rcpts, body = _client.sendmail.call_args[0]
             body = body.split('\n')
-            assert_in('From: "Test Admin"', body)
+            assert_in('From: "Test Admin" <test-admin@users.localhost>', body)
             assert_in('Sender: tickets@test.p.domain.net', body)
             assert_in('To: 123@tickets.test.p.domain.net', body)
 
@@ -419,7 +419,7 @@
             assert_equal(_client.sendmail.call_count, 1)
             return_path, rcpts, body = _client.sendmail.call_args[0]
             body = body.split('\n')
-            assert_in('From: "Test Admin"', body)
+            assert_in('From: "Test Admin" <test-admin@users.localhost>', body)
             assert_in('References: <a> <b> <c>', body)
 
             _client.reset_mock()
@@ -434,7 +434,7 @@
             assert_equal(_client.sendmail.call_count, 1)
             return_path, rcpts, body = _client.sendmail.call_args[0]
             body = body.split('\n')
-            assert_in('From: "Test Admin"', body)
+            assert_in('From: "Test Admin" <test-admin@users.localhost>', body)
             assert_in('References: <ref>', body)
 
     def test_cc(self):
@@ -465,7 +465,7 @@
                 message_id=h.gen_message_id())
             assert_equal(_client.sendmail.call_count, 1)
             return_path, rcpts, body = _client.sendmail.call_args[0]
-            assert_in('From: "Test Admin"', body)
+            assert_in('From: "Test Admin" <test-admin@users.localhost>', body)
 
     def test_send_email_long_lines_use_quoted_printable(self):
         with mock.patch.object(mail_tasks.smtp_client, '_client') as _client: