removed email address from FROM: field in form and fixed TestMailTasks
diff --git a/Allura/allura/model/auth.py b/Allura/allura/model/auth.py
index 5382996..3f77fa4 100644
--- a/Allura/allura/model/auth.py
+++ b/Allura/allura/model/auth.py
@@ -817,7 +817,6 @@
         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 c6da880..0df7cc0 100644
--- a/Allura/allura/tasks/mail_tasks.py
+++ b/Allura/allura/tasks/mail_tasks.py
@@ -176,7 +176,8 @@
             except Exception:
                 log.exception('Error looking up user with ID: %r' % addr)
                 continue
-            addr = user.email_address_header()
+            # retrieve active email address
+            addr = user.preferences.email_address
             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 7296de8..0db7d57 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; &lt;test-admin@users.localhost&gt;')
+        response.mustcontain('<b>From:</b> &#34;Test Admin&#34;')
 
         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; &lt;test-admin@users.localhost&gt;')
+        response.mustcontain('<b>From:</b> &#34;Test Admin&#34;')
         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 c2663b9..ec664e9 100644
--- a/Allura/allura/tests/test_tasks.py
+++ b/Allura/allura/tests/test_tasks.py
@@ -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" <test-admin@users.localhost>', body)
+            assert_in('From: "Test Admin"', 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" <test-admin@users.localhost>', body)
+            assert_in('From: "Test Admin"', 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" <test-admin@users.localhost>', body)
+            assert_in('From: "Test Admin"', 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" <test-admin@users.localhost>', body)
+            assert_in('From: "Test Admin"', 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" <test-admin@users.localhost>', body)
+            assert_in('From: "Test Admin"', 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" <test-admin@users.localhost>', body)
+            assert_in('From: "Test Admin"', 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" <test-admin@users.localhost>', body)
+            assert_in('From: "Test Admin"', body)
 
     def test_send_email_long_lines_use_quoted_printable(self):
         with mock.patch.object(mail_tasks.smtp_client, '_client') as _client: