(mu_set_user_email): Set user's domain as well.
Showing
1 changed file
with
10 additions
and
6 deletions
... | @@ -485,7 +485,8 @@ mu_set_user_email (const char *candidate) | ... | @@ -485,7 +485,8 @@ mu_set_user_email (const char *candidate) |
485 | address_t addr = NULL; | 485 | address_t addr = NULL; |
486 | size_t emailno = 0; | 486 | size_t emailno = 0; |
487 | char *email = NULL; | 487 | char *email = NULL; |
488 | 488 | char *domain = NULL; | |
489 | |||
489 | if ((err = address_create (&addr, candidate)) != 0) | 490 | if ((err = address_create (&addr, candidate)) != 0) |
490 | return err; | 491 | return err; |
491 | 492 | ||
... | @@ -501,12 +502,15 @@ mu_set_user_email (const char *candidate) | ... | @@ -501,12 +502,15 @@ mu_set_user_email (const char *candidate) |
501 | if ((err = address_aget_email (addr, 1, &email)) != 0) | 502 | if ((err = address_aget_email (addr, 1, &email)) != 0) |
502 | goto cleanup; | 503 | goto cleanup; |
503 | 504 | ||
504 | |||
505 | if (mu_user_email) | 505 | if (mu_user_email) |
506 | free (mu_user_email); | 506 | free (mu_user_email); |
507 | 507 | ||
508 | mu_user_email = email; | 508 | mu_user_email = email; |
509 | 509 | ||
510 | address_aget_domain (addr, 1, &domain); | ||
511 | mu_set_user_email_domain (domain); | ||
512 | free (domain); | ||
513 | |||
510 | cleanup: | 514 | cleanup: |
511 | address_destroy (&addr); | 515 | address_destroy (&addr); |
512 | 516 | ||
... | @@ -582,10 +586,10 @@ mu_get_user_email (const char *name) | ... | @@ -582,10 +586,10 @@ mu_get_user_email (const char *name) |
582 | status = mu_get_user_email_domain (&domainpart); | 586 | status = mu_get_user_email_domain (&domainpart); |
583 | 587 | ||
584 | if (status) | 588 | if (status) |
585 | { | 589 | { |
586 | errno = status; | 590 | errno = status; |
587 | return NULL; | 591 | return NULL; |
588 | } | 592 | } |
589 | 593 | ||
590 | if ((status = parse822_quote_local_part (&localpart, name))) | 594 | if ((status = parse822_quote_local_part (&localpart, name))) |
591 | { | 595 | { | ... | ... |
-
Please register or sign in to post a comment