diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2002-11-19 18:19:15 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2002-11-19 18:19:15 +0000 |
commit | 0819261ed5b12d9bf96fd2ef070ea2d2b44c3f2a (patch) | |
tree | 15bef5cf23840ae248560f4ad0ab80c0e09467e0 | |
parent | f423b8258d64a1b6b923c1ca8b58f97f109166ed (diff) | |
download | mailutils-0819261ed5b12d9bf96fd2ef070ea2d2b44c3f2a.tar.gz mailutils-0819261ed5b12d9bf96fd2ef070ea2d2b44c3f2a.tar.bz2 |
(mu_set_user_email): Set user's domain as well.
-rw-r--r-- | mailbox/mutil.c | 16 |
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))) { |