New User

From d00d3
Revision as of 10:34, 29 March 2012 by Andrenarchy (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Assume we want to add a user USER with email address MAIL@DOMAIN and password PASS.

CAUTION: If you are migrating users then always migrate all users of a domain!




Make sure DOMAIN is registered in LDAP under ou=domains,dc=d00d3,dc=net, see New Domain.


Add LDAP object posixGroup ("Generic: Posix Group") with cn=USER under ou=groups,dc=d00d3,dc=net with gidNumber>=2000.


Add LDAP object inetOrgPerson+posixAccount ("Generic: User Account") with cn=USER under ou=people,dc=d00d3,dc=net with the attributes

  • cn=USER
  • uid=USER
  • userPassword=PASS (ssha)
  • gidNumber=see above
  • homeDirectory=/home/USER
  • loginShell=/bin/sh

Also add the attribute

  • mail=MAIL@DOMAIN

Migrate Maildir from Courier to Dovecot

  1. If not yet done: configure
    1. Download to folder /root/c2d from [1] and run
      chmod +x
    2. Create file /root/c2d/ containing
      if [ "$1" == "" ]; then
              echo "Specify path!"
              exit 1
      find $1 -name "courierpop3dsizelist" -print0 | xargs -0 rm -r
      /root/c2d/ --recursive --to-dovecot --convert $1
      find $1 -name "courierimaphieracl" -print0 | xargs -0 rm -r
      find $1 -name "courierimapkeywords" -print0 | xargs -0 rm -r
      find $1 -name "courierimapsubscribed" -print0 | xargs -0 rm -r
      find $1 -name "courierimapuiddb" -print0 | xargs -0 rm -r
      chmod -R go-rwx $1
      chown -R vmail:vmail $1
  2. Stop the old mail server (IMAP+POP3+SMTP) temporarily to prevent loss of mails.
  3. Copy Maildir from old mail server to temporary folder TMP on new machine.
  4. Run
    /root/c2d/ TMP
    and check if errors occured.
  5. Move TMP to /var/vmail/DOMAIN/MAIL/Maildir (such that the Maildir folders cur, new, tmp,... are in this directory).
  6. Check in webmailer if mails are present.
  7. Disable user and domain on old machine.
  8. Start old mail server (IMAP+POP3+SMTP).
Personal tools