Commit b3e84191 authored by ale's avatar ale

Fix bad spelling of mailAlternateAddress

parent a9615dd8
Pipeline #1527 passed with stages
in 1 minute and 34 seconds
......@@ -164,7 +164,7 @@ func (h *emailResourceHandler) FromLDAP(entry *ldap.Entry) (*as.Resource, error)
Type: as.ResourceTypeEmail,
Name: email,
Email: &as.Email{
Aliases: entry.GetAttributeValues("mailAlternateAddr"),
Aliases: entry.GetAttributeValues("mailAlternateAddress"),
Maildir: entry.GetAttributeValue("mailMessageStore"),
},
}, nil
......@@ -174,7 +174,7 @@ func (h *emailResourceHandler) ToLDAP(rsrc *as.Resource) []ldap.PartialAttribute
return []ldap.PartialAttribute{
{Type: "objectClass", Vals: []string{"top", "virtualMailUser"}},
{Type: "mail", Vals: s2l(rsrc.ID.Name())},
{Type: "mailAlternateAddr", Vals: rsrc.Email.Aliases},
{Type: "mailAlternateAddress", Vals: rsrc.Email.Aliases},
{Type: "mailMessageStore", Vals: s2l(rsrc.Email.Maildir)},
}
}
......
......@@ -13,13 +13,13 @@ func TestEmailResource_FromLDAP(t *testing.T) {
entry := ldap.NewEntry(
"mail=test@investici.org,uid=test@investici.org,ou=People,dc=example,dc=com",
map[string][]string{
"objectClass": []string{"top", "virtualMailUser"},
"mail": []string{"test@investici.org"},
"status": []string{"active"},
"host": []string{"host1"},
"originalHost": []string{"host1"},
"mailAlternateAddr": []string{"test2@investici.org", "test3@investici.org"},
"mailMessageStore": []string{"test/store"},
"objectClass": []string{"top", "virtualMailUser"},
"mail": []string{"test@investici.org"},
"status": []string{"active"},
"host": []string{"host1"},
"originalHost": []string{"host1"},
"mailAlternateAddress": []string{"test2@investici.org", "test3@investici.org"},
"mailMessageStore": []string{"test/store"},
},
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment