summaryrefslogtreecommitdiff
path: root/mailbox/mutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'mailbox/mutil.c')
-rw-r--r--mailbox/mutil.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/mailbox/mutil.c b/mailbox/mutil.c
index fa202f93e..73797e9dd 100644
--- a/mailbox/mutil.c
+++ b/mailbox/mutil.c
@@ -485,7 +485,8 @@ mu_set_user_email (const char *candidate)
address_t addr = NULL;
size_t emailno = 0;
char *email = NULL;
-
+ char *domain = NULL;
+
if ((err = address_create (&addr, candidate)) != 0)
return err;
@@ -501,12 +502,15 @@ mu_set_user_email (const char *candidate)
if ((err = address_aget_email (addr, 1, &email)) != 0)
goto cleanup;
-
if (mu_user_email)
free (mu_user_email);
mu_user_email = email;
+ address_aget_domain (addr, 1, &domain);
+ mu_set_user_email_domain (domain);
+ free (domain);
+
cleanup:
address_destroy (&addr);
@@ -582,10 +586,10 @@ mu_get_user_email (const char *name)
status = mu_get_user_email_domain (&domainpart);
if (status)
- {
- errno = status;
- return NULL;
- }
+ {
+ errno = status;
+ return NULL;
+ }
if ((status = parse822_quote_local_part (&localpart, name)))
{

Return to:

Send suggestions and report system problems to the System administrator.