Dovecot postfix ldap: Difference between revisions

From DWIKI
Line 24: Line 24:


=Dovecot=
=Dovecot=
dovecot-ldap.conf
ldap_version = 3
base = o=ldap
user_attrs = %n,%Dd=user,mailQuota=quota_rule=*:storage=%$,=home=/data/vmail/domains/%d/%n/Maildir
user_filter = (&(objectClass=inetOrgPerson)(mail=%u))
pass_attrs = mail=user,userPassword=password,mailQuota=userdb_quota_rule=*:bytes=%$,=userdb_home=/data/vmail/domains/%d/%n/Maildir,mail=userdb_user
pass_filter = (&(objectClass=inetOrgPerson)(mail=%u))
default_pass_scheme = SSHA


dovecot.conf
base_dir = /var/run/dovecot/
protocols = imap imaps pop3 managesieve
mail_uid = 101
mail_gid = 101
disable_plaintext_auth = no
ssl_disable = no
ssl_cert_file = /etc/ssl/certs/dovecot.pem
ssl_key_file = /etc/ssl/private/dovecot.pem
mail_location = maildir:/data/vmail/domains/%d/%n/Maildir
mail_privileged_group = mail
mail_debug = yes
verbose_proctitle = no
first_valid_uid = 101
last_valid_uid = 101
first_valid_gid = 101
last_valid_gid = 101
protocol imap {
    mail_plugins = quota imap_quota
    imap_client_workarounds = delay-newmail outlook-idle netscape-eoh tb-extra-mailbox-sep
}
protocol pop3 {
    mail_plugins = quota
    pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
}
protocol lda {
  postmaster_address = postmaster@example.com
  plugins = quota
  mail_plugins = cmusieve quota
  sieve_global_path = /data/vmail/domains/.dovecot.sieve
  mail_plugin_dir = /usr/local/lib/dovecot/imap
  sendmail_path = /usr/local/sbin/sendmail
  log_path = /var/log/dovecot-deliver.log
  info_log_path = /var/log/dovecot-deliver.log
  rejection_reason = Your message to<%t> was automatically rejected:%n%r
}
protocol managesieve {
  sieve = /data/vmail/domains/%d/%n/.dovecot.sieve
  sieve_storage = /data/vmail/domains/%d/%n/sieve
  login_executable = /usr/local/libexec/dovecot/managesieve-login
  mail_executable = /usr/local/libexec/dovecot/managesieve
}
#for users logging in without @domain.tld
auth_default_realm = example.com
auth_verbose = no
auth_debug = no
auth_debug_passwords = no
auth default {
  mechanisms = plain login
  socket listen {
        master {
            path = /var/run/dovecot/auth-master
            mode = 0666
            user = vmail
        }
        client {
            path = /var/spool/postfix/private/auth
            mode = 0660
            user = postfix
            group = postfix
        }
  }
  passdb ldap {
    args = /usr/local/etc/dovecot-ldap.conf
  }
  userdb prefetch {
  }
  userdb ldap {
      args = /usr/local/etc/dovecot-ldap.conf
  }
  user = vmail
}
dict {
  #quota = mysql:/usr/local/etc/dovecot-dict-quota.conf
}
plugin {
    quota = maildir:User quota
    quota_rule = *:storage=100M
    quota_rule2 = Trash:storage=10M
    quota_warning = storage=80%% /usr/local/bin/quota-warning.sh 80
    quota_warning2 = storage=90%% /usr/local/bin/quota-warning.sh 90
    quota_warning3 = storage=95%% /usr/local/bin/quota-warning.sh 95
    sieve = /data/vmail/domains/%d/%n/.dovecot.sieve
}


=Postfix=
=Postfix=

Revision as of 16:29, 3 December 2008

LDAP

For the per use mail quota and aliases i added schema qmail.schema to slapd.conf, with some small alterations: http://dhits.nl/download/qmail.new.schema

include         /usr/local/etc/openldap/schema/qmail.new.schema

#users will be allowed to change password via squirrelmail
access to attrs=userPassword
       by self write
       by anonymous auth
       by * read

To allow users to maintain mail aliases via squirrelmail

access to attrs=mailAlternateAddress
       by self write
       by * read

???

access to attrs=entry
       by self write
       by * read
access to * by * read

Dovecot

dovecot-ldap.conf

ldap_version = 3
base = o=ldap
user_attrs = %n,%Dd=user,mailQuota=quota_rule=*:storage=%$,=home=/data/vmail/domains/%d/%n/Maildir
user_filter = (&(objectClass=inetOrgPerson)(mail=%u))
pass_attrs = mail=user,userPassword=password,mailQuota=userdb_quota_rule=*:bytes=%$,=userdb_home=/data/vmail/domains/%d/%n/Maildir,mail=userdb_user
pass_filter = (&(objectClass=inetOrgPerson)(mail=%u))
default_pass_scheme = SSHA

dovecot.conf

base_dir = /var/run/dovecot/
protocols = imap imaps pop3 managesieve
mail_uid = 101
mail_gid = 101
disable_plaintext_auth = no
ssl_disable = no
ssl_cert_file = /etc/ssl/certs/dovecot.pem
ssl_key_file = /etc/ssl/private/dovecot.pem
mail_location = maildir:/data/vmail/domains/%d/%n/Maildir
mail_privileged_group = mail
mail_debug = yes
verbose_proctitle = no
first_valid_uid = 101
last_valid_uid = 101
first_valid_gid = 101
last_valid_gid = 101
protocol imap {
   mail_plugins = quota imap_quota
   imap_client_workarounds = delay-newmail outlook-idle netscape-eoh tb-extra-mailbox-sep
}
protocol pop3 {
   mail_plugins = quota
   pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
}
protocol lda {
 postmaster_address = postmaster@example.com
 plugins = quota
 mail_plugins = cmusieve quota
 sieve_global_path = /data/vmail/domains/.dovecot.sieve
 mail_plugin_dir = /usr/local/lib/dovecot/imap
 sendmail_path = /usr/local/sbin/sendmail
 log_path = /var/log/dovecot-deliver.log
 info_log_path = /var/log/dovecot-deliver.log
 rejection_reason = Your message to<%t> was automatically rejected:%n%r
}
protocol managesieve {
  sieve = /data/vmail/domains/%d/%n/.dovecot.sieve
  sieve_storage = /data/vmail/domains/%d/%n/sieve
  login_executable = /usr/local/libexec/dovecot/managesieve-login
  mail_executable = /usr/local/libexec/dovecot/managesieve
}
#for users logging in without @domain.tld
auth_default_realm = example.com
auth_verbose = no
auth_debug = no
auth_debug_passwords = no
auth default {
 mechanisms = plain login
 socket listen {
       master {
           path = /var/run/dovecot/auth-master
           mode = 0666
           user = vmail
       }
       client {
           path = /var/spool/postfix/private/auth
           mode = 0660
           user = postfix
           group = postfix
       }
 } 
 passdb ldap {
    args = /usr/local/etc/dovecot-ldap.conf
 }
 userdb prefetch {
 }
 userdb ldap {
     args = /usr/local/etc/dovecot-ldap.conf
 }
 user = vmail
}
dict {
 #quota = mysql:/usr/local/etc/dovecot-dict-quota.conf
}
plugin {
   quota = maildir:User quota
   quota_rule = *:storage=100M
   quota_rule2 = Trash:storage=10M
   quota_warning = storage=80%% /usr/local/bin/quota-warning.sh 80
   quota_warning2 = storage=90%% /usr/local/bin/quota-warning.sh 90
   quota_warning3 = storage=95%% /usr/local/bin/quota-warning.sh 95
   sieve = /data/vmail/domains/%d/%n/.dovecot.sieve
}

Postfix