Установка Dovecot

Материал из wiki.lissyara.su
Перейти к: навигация, поиск

Dovecot - Это IMAP/POP3 сервер.


Установка Dovecot:

cd/usr/ports/mail/dovecot
make install clean

[X] KQUEUE	  kqueue(2) support
[X] POP3	  POP3 support
[X] LDA	  LDA support
[X] MYSQL	  MySQL support
[X] MANAGESIEVE  ManageSieve support

dovecot-sql.conf

driver = mysql
connect = host=/tmp/mysql.sock dbname=eximbase user=eximuser password=eximpassword
default_pass_scheme = MD5-CRYPT
password_query = SELECT username AS user,password FROM mailbox WHERE username = '%u' AND active =
'1' LIMIT 1
# Начальный каталог у нас /mnt/mail/ + то, что postfixadmin в столбце maildir хранит. (%h)
user_query = SELECT CONCAT("/mnt/mail/",maildir) AS home,26 AS uid,6 AS 
gid,CONCAT("*:storage=",quota,"B") AS quota_rule FROM mailbox WHERE username = '%u' AND active =
'1' LIMIT 1

dovecot.conf

base_dir = /var/run/dovecot/

protocols = pop3 imap managesieve
listen = *
ssl = no
disable_plaintext_auth = no
shutdown_clients = yes
log_timestamp = "%b %d %H:%M:%S "
syslog_facility = mail
login_dir = /var/run/dovecot/login
login_chroot = yes
login_user = dovecot
login_process_size = 64
login_process_per_connection = yes
login_processes_count = 3
login_max_processes_count = 64
login_max_connections = 256
login_greeting = Dovecot ready.
login_log_format_elements = user=<%u> method=%m rip=%r lip=%l %c
login_log_format = %$: %s
verbose_proctitle = yes
first_valid_uid = 25
first_valid_gid = 0
mail_access_groups = mail
mail_location = maildir:%h
#umask = 0077
#Upgrading Dovecot to v1.2 Removed umask. It wasn't really used anywhere anymore. 
# Для отладки, если что-то не работает установить в yes
mail_debug = no
auth_debug = no
auth_debug_passwords = no


protocol managesieve {
   mail_debug = no
   sieve=%hsieve/.dovecot.sieve
   sieve_storage=%hsieve
}

protocol imap {
  imap_client_workarounds = delay-newmail outlook-idle netscape-eoh tb-extra-mailbox-sep
  mail_plugins = quota imap_quota
}

protocol pop3 {
  pop3_uidl_format = %08Xu%08Xv
  pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
  mail_plugins = quota
}

protocol lda {
  postmaster_address = admin@mydomain.ru
  sendmail_path = /usr/sbin/sendmail
  auth_socket_path = /var/run/dovecot/auth-master
  mail_plugins = quota cmusieve
}

auth default {
  mechanisms = plain login cram-md5
  socket listen {
    master {
      path = /var/run/dovecot/auth-master
      mode = 0600
      user = mailnull
    }
    client {
      path = /var/run/dovecot/auth-client
      mode = 0660
      user = mailnull
    }
                }

passdb sql {
    args = /usr/local/etc/dovecot-sql.conf
}

userdb sql {
    args = /usr/local/etc/dovecot-sql.conf
}
 user = root
}

plugin {
  quota = maildir
  sieve=%hsieve/.dovecot.sieve
}

Полезные ссылки:
http://www.lissyara.su/?id=1173
Описание проекта Dovecot на WIKIPEDIA