[Samba] Multiple email addresses for user accounts
Rowland Penny
rpenny at samba.org
Sat Nov 4 10:12:03 UTC 2023
On Fri, 3 Nov 2023 15:46:07 +0000
Willi Schiegel via samba <samba at lists.samba.org> wrote:
>
> On 11/3/23 16:29, Rowland Penny via samba wrote:
> > On Fri, 3 Nov 2023 15:13:22 +0000
> > Willi Schiegel via samba <samba at lists.samba.org> wrote:
> >
> >> Hello to all,
> >>
> >> how can I have multiple email addresses / aliases for an account? I
> >> can only set one address with samba-tool's mail-address (mail is a
> >> single value attribute) and mailAternativeAddress is not found in
> >> the schemata.
> >>
> >> Best regards
> >> Willi
> >>
> >
> > Isn't 'mailAlternativeAddress' an LDAP attribute ?
> > I think you use the 'otherMailbox' attribute on AD.
>
> Perfect, that's it! Will there possibly be a multi valued option for
> samba-tool for otherMailbox(es)? Can you point me to some
> documentation how to script account changes after an account has been
> created?
>
There is always the possibility of additions to samba-tool, someone
just needs to write them.
As for documentation, this is a bit subjective, what script language
for instance.
But it basically boils down to (if adding to an existing user):
First check the user exists.
Next check if the user already has the 'otherMailbox' you wish to add.
If everything is okay then create an ldif like this:
dn: CN=AD User,CN=Users,DC=samdom,DC=example,DC=com
changetype: modify
add: otherMailbox
otherMailbox: email at domain.tld
-
That will add an 'otherMailbox' attribute, containing the email address
'email at domain.tld' to the user 'AD User' in the standard Users
container on a DC that is the 'samdom.example.com' dns domain.
To add multiple email addresses, just keep adding the last three lines
(changing the email address).
You can then add the ldif with:
ldbmodify -H ldap://dc1.samdom.example.com -UAdministrator
/path/to/your/ldif
NOTE: the above ldbmodify command should be all on one line.
Second Note: Obviously, change the sample data with your actual data.
Rowland
More information about the samba
mailing list