1

Topic: How To: adding email aliases at the command line for LDAP

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.2.1
- Deployed with iRedMail Easy or the downloadable installer? download
- Linux/BSD distribution name and version: Ubuntu 18.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? Yes
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
We started with the how-to page:
https://docs.iredmail.org/user.alias.address.html

And I felt it didn't go into enough detail for those of us who may not have worked with or deployed an LDAP server before.
First I create an LDIF file called aliasesToAdd.ldif that contains the email accounts and aliases I want to add to the server:

 cat aliases-add.ldif 
dn: mail=stuartc@domain1.com,ou=Users,domainName=domain1.com,o=domains,dc=domain1,dc=com
changetype: modify
add: shadowAddress
shadowAddress: superman@domain1.com

dn: mail=willb@domain1.com,ou=Users,domainName=domain1.com,o=domains,dc=domain1,dc=com
changetype: modify
add: shadowAddress
shadowAddress: spiderman@domain1.com

dn: mail=paulc@domain1.com,ou=Users,domainName=domain1.com,o=domains,dc=domain1,dc=com
changetype: modify
add: shadowAddress
shadowAddress: batman@domain1.com
shadowAddress: robin@domain1.com

Make sure to leave a blank line between each. Then run:
ldapmodify -x -W -D "cn=Manager,dc=domain1,dc=com" -f aliasesToAdd.ldif

Just wanted to get this in the google/site search history in case someone else had problems. Feel free to comment if I did somethign incorrectly.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: How To: adding email aliases at the command line for LDAP

Thanks for sharing.

For user not familiar with LDAP LDIF, it's recommended to use command line tool like `ldapvi` or web admin panel like `phpldapadmin` to manage it.

I personally found `ldapvi` is awesome. smile

3

Re: How To: adding email aliases at the command line for LDAP

Thanks for the top on ldapvi, will check it out!