diff --git a/cli/koji b/cli/koji
index dddca20..e56b6cf 100755
--- a/cli/koji
+++ b/cli/koji
@@ -1606,6 +1606,7 @@ def handle_add_user(options, session, args):
     usage += _("\n(Specify the --help global option for a list of other help options)")
     parser = OptionParser(usage=usage)
     parser.add_option("--principal", help=_("The Kerberos principal for this user"))
+    parser.add_option("--email", help=_("This users email"))
     parser.add_option("--disable", help=_("Prohibit logins by this user"), action="store_true")
     (options, args) = parser.parse_args(args)
     if len(args) < 1:
@@ -1618,7 +1619,7 @@ def handle_add_user(options, session, args):
     else:
         status = koji.USER_STATUS['NORMAL']
     activate_session(session)
-    user_id = session.createUser(username, status=status, krb_principal=options.principal)
+    user_id = session.createUser(username, status=status, krb_principal=options.principal, email=options.email)
     print "Added user %s (%i)" % (username, user_id)
 
 def handle_enable_user(options, session, args):
diff --git a/hub/kojihub.py b/hub/kojihub.py
index 9c3df54..b4999b2 100644
--- a/hub/kojihub.py
+++ b/hub/kojihub.py
@@ -925,7 +925,7 @@ def readPackageList(tagID=None, userID=None, pkgID=None, event=None, inherit=Fal
     packages = {}
     fields = (('package.id', 'package_id'), ('package.name', 'package_name'),
               ('tag.id', 'tag_id'), ('tag.name', 'tag_name'),
-              ('users.id', 'owner_id'), ('users.name', 'owner_name'),
+              ('users.id', 'owner_id'), ('users.name', 'owner_name'), ('users.email', 'owner_email'),
               ('extra_arches','extra_arches'),
               ('tag_packages.blocked', 'blocked'))
     flist = ', '.join([pair[0] for pair in fields])
@@ -2713,16 +2713,17 @@ def get_user(userInfo=None,strict=False):
       name: user name
       status: user status (int), may be null
       usertype: user type (int), 0 person, 1 for host, may be null
-      krb_principal: the user's Kerberos principal"""
+      krb_principal: the user's Kerberos principal
+      email: user's email"""
     if userInfo is None:
         userInfo = context.session.user_id
         #will still be None if not logged in
-    fields = ('id', 'name', 'status', 'usertype', 'krb_principal')
+    fields = ('id', 'name', 'status', 'usertype', 'krb_principal','email')
     q = """SELECT %s FROM users WHERE""" % ', '.join(fields)
     if isinstance(userInfo, int) or isinstance(userInfo, long):
         q += """ id = %(userInfo)i"""
     elif isinstance(userInfo, str):
-        q += """ (krb_principal = %(userInfo)s or name = %(userInfo)s)"""
+        q += """ (email = %(userInfo)s or krb_principal = %(userInfo)s or name = %(userInfo)s)"""
     else:
         raise koji.GenericError, 'invalid type for userInfo: %s' % type(userInfo)
     return _singleRow(q,locals(),fields,strict=strict)
@@ -2794,7 +2795,7 @@ def get_build(buildInfo, strict=False):
               ("package.name || '-' || build.version || '-' || build.release", 'nvr'),
               ('EXTRACT(EPOCH FROM events.time)','creation_ts'),
               ('EXTRACT(EPOCH FROM build.completion_time)','completion_ts'),
-              ('users.id', 'owner_id'), ('users.name', 'owner_name'))
+              ('users.id', 'owner_id'), ('users.name', 'owner_name'), ('users.email', 'owner_email'))
     query = """SELECT %s
     FROM build
     JOIN events ON build.create_event = events.id
@@ -4046,12 +4047,12 @@ def get_notification_recipients(build, tag_id, state):
 
     if notify_on_success is True or state != koji.BUILD_STATES['COMPLETE']:
         # user who submitted the build
-        emails.append('%s@%s' % (build['owner_name'], email_domain))
+        emails.append(build['owner_email'])
 
         if tag_id:
             packages = readPackageList(pkgID=package_id, tagID=tag_id, inherit=True)
             # owner of the package in this tag, following inheritance
-            emails.append('%s@%s' % (packages[package_id]['owner_name'], email_domain))
+            emails.append(packages[package_id]['owner_email'])
         #FIXME - if tag_id is None, we don't have a good way to get the package owner.
         #   using all package owners from all tags would be way overkill.
 
@@ -6118,7 +6119,7 @@ class RootExports(object):
         WHERE user_id = %(user_id)i and perm_id = %(perm_id)i"""
         _dml(update, locals())
 
-    def createUser(self, username, status=None, krb_principal=None):
+    def createUser(self, username, status=None, krb_principal=None, email=None):
         """Add a user to the database"""
         context.session.assertPerm('admin')
         if get_user(username):
@@ -6126,7 +6127,7 @@ class RootExports(object):
         if krb_principal and get_user(krb_principal):
             raise koji.GenericError, 'user with this Kerberos principal already exists: %s' % krb_principal
         
-        return context.session.createUser(username, status=status, krb_principal=krb_principal)
+        return context.session.createUser(username, status=status, krb_principal=krb_principal, email=email)
 
     def enableUser(self, username):
         """Enable logins by the specified user"""
@@ -6791,7 +6792,7 @@ class RootExports(object):
             raise koji.GenericError, 'user %s cannot create notifications for user %s' % \
                   (currentUser['name'], notificationUser['name'])
         
-        email = '%s@%s' % (notificationUser['name'], context.opts['EmailDomain'])
+        email = notificationUser['email']
         insert = """INSERT INTO build_notifications
         (user_id, package_id, tag_id, success_only, email)
         VALUES
diff --git a/koji.spec b/koji.spec
index 8c8a61d..7ab49b0 100644
--- a/koji.spec
+++ b/koji.spec
@@ -1,6 +1,6 @@
 %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
 
-%define baserelease 2%{?distribution}
+%define baserelease 3%{?distribution}
 #build with --define 'testbuild 1' to have a timestamp appended to release
 %if "x%{?testbuild}" == "x1"
 %define release %{baserelease}.%(date +%%Y%%m%%d.%%H%%M.%%S)
@@ -191,6 +191,9 @@ if [ $1 = 0 ]; then
 fi
 
 %changelog
+* Tue Mar 30 2010 Christos Triantafyllidis <ctria@grid.auth.gr> - 1.3.2-3%{?distribution}
+- Added email field at users and used it for notifications
+
 * Tue Dec 15 2009 Christos Triantafyllidis <ctria@grid.auth.gr> - 1.3.2-2%{?distribution}
 - Restored an old 'ugly' hack that is needed for old yum versions.
 - Added 32bit packages to the 64bit repositories.
diff --git a/koji/auth.py b/koji/auth.py
index df84d52..5d88b6d 100644
--- a/koji/auth.py
+++ b/koji/auth.py
@@ -563,7 +563,7 @@ class Session(object):
         else:
             return None
 
-    def createUser(self, name, usertype=None, status=None, krb_principal=None):
+    def createUser(self, name, usertype=None, status=None, krb_principal=None, email=None):
         """
         Create a new user, using the provided values.
         Return the user_id of the newly-created user.
@@ -586,8 +586,8 @@ class Session(object):
         cursor.execute(select, locals())
         user_id = cursor.fetchone()[0]
 
-        insert = """INSERT INTO users (id, name, usertype, status, krb_principal)
-        VALUES (%(user_id)i, %(name)s, %(usertype)i, %(status)i, %(krb_principal)s)"""
+        insert = """INSERT INTO users (id, name, usertype, status, krb_principal, email)
+        VALUES (%(user_id)i, %(name)s, %(usertype)i, %(status)i, %(krb_principal)s, %(email)s)"""
         cursor.execute(insert, locals())
         context.cnx.commit()
 
