Commit 23fd0592 23fd0592e1bba8ad05f44d24e08b47d77314154f by Sergey Poznyakoff

New mtstailor variable "username"

1 parent a581fd70
Showing 1 changed file with 30 additions and 0 deletions
......@@ -341,6 +341,36 @@ read_mts_profile ()
exit (1);
}
}
if ((p = mh_context_get_value (mts_profile, "username", NULL)))
{
size_t len;
const char *domain;
char *newemail;
int rc;
rc = mu_get_user_email_domain (&domain);
if (rc)
{
mu_error (_("Cannot get user email: %s"), mu_strerror (rc));
exit (1);
}
len = strlen (p) + 1 + strlen (domain) + 1;
newemail = xmalloc (len);
strcpy (newemail, p);
strcat (newemail, "@");
strcat (newemail, domain);
rc = mu_set_user_email (newemail);
if (rc)
{
mu_error (_("Cannot set user email (%s): %s"),
newemail, mu_strerror (rc));
exit (1);
}
free (newemail);
}
}
......