User email address customization

can someone help me?

NethServer Version: Nethserver release 7.9.2009 (final)2009

When you create a user, Nethserver automatically creates the user’s email address in the form name@domain.xy.

I want to set the email address for users to name.surname@domain.xy. I want just that one email address for all users. I want to delete the auto-generated email address name@domain.xy. It’s a single domain, not more.

This is necessary because these public email addresses are known to everyone and should be emailed about. It is not a good solution for a user to access webmail (SOGo) with name@domain.xy.

How can this be solved?

Thanks for the help.

Why can’t you create the users with a username of first.last? The email address will be whatever username you selected, at whatever domain you’re using, so if you want email addresses to be first.last@domain, you need the username to be first.last.

I can create and I tested the username in the form name.surname. But there is a problem. The custom programs we use do not handle such long usernames so the user cannot log in directly. Unfortunately, I can’t modify the programs …

That’s why I’m looking for another solution.

I’m afraid it’s not possible to login with usernames that you can’t use because of your programs.

Only workaround I see is to use a mail alias with the long name and to make the default mail address internal so it’s not possible to receive mails to the default address from outside. For sending mails using the correct address, you could use identities in SOGo, see this post.

1 Like

I tried this. I created for user@domain.xy an alias used name.surname@domain.xy. I set name@domain.xy as the internal address.

The problem is that I can only login to SOGo with name@domain.xy address. The login with name.surname@domain.xy doesn’t work and I can’t remove/delete name@domain.xy address.

You could use phpldapadmin or command line to edit the default mail address of a user to firstname.lastname@domain.xy. This way you should be able to login to SOGo with the long name.

Thanks for the idea. This can be useful.

Before I begin, I would like to ask if I understand you correctly.

1st. I need to create an user with default email address (name@domain.xy)
2nd I can change email user’s email address to name.surname@domain.xy by phpldapadmin or command line.
3rd The user’s new email address will appear under the Address and the original Nethserver generated will be deleted.
4th User can login and send/received mail with his new email address.
5th User can connect Samba share with his username.

Am I right? If so, can you tell me how to change the user’s email address from the command line?

Thank you for your help.

Right, SOGo will use the new mail address but you still need a mail alias in server manager and the default address can’t be deleted in server manager but made internal instead.

For AD you need to edit the users userprincipalname field.

I recommend to use phpldapadmin:

For command line editing samba AD check out the wiki: (scroll to “Modify the SAMBA4 AD settings”)

Thank you for your help.

I followed my previous description:

Then I enabled ldap admin (I set a password for the administrator user) and I installed phpldapadmin and modified user’s userPrincipalName to name.surname@domain.xy.

The user can join the Samba share with the username and log in to Nextcloud. The user can only log in to SOGo with the modified email address (name.surname@domain.xy). The user can send and receive mail to the modified email address.

However, the original name@domain.xy email address will not be deleted. Is this necessary? I’m afraid it will cause confusion …

No, it’s not necessary to delete it, setting it internal should be enough. This way the address isn’t usable.

Thanks for your help, I think this will be a good solution for me.