New User

From d00d3
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!

Contents

LDAP

Domain

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

Group

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

User

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 courier-dovecot-migrate.pl:
    1. Download courier-dovecot-migrate.pl to folder /root/c2d from [1] and run
      chmod +x courier-dovecot-migrate.pl
    2. Create file /root/c2d/c2d.sh containing
      #!/bin/bash
       
      if [ "$1" == "" ]; then
              echo "Specify path!"
              exit 1
      fi
      
      find $1 -name "courierpop3dsizelist" -print0 | xargs -0 rm -r
      /root/c2d/courier-dovecot-migrate.pl --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/c2d.sh 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