User Tools

Site Tools


сервер_cyrus

Сервер Cyrus

Использование saslauthd для аутентификации

FreeBSD

[gate:~] # pkg_add -r cyrus-sasl-saslauthd

[gate:~] # cat /etc/rc.conf
...
saslauthd_enable="YES"

[gate:~] # /usr/local/etc/rc.d/saslauthd start

Ubuntu

root@gate:~# cat /etc/default/saslauthd
...
START=yes
...

root@gate:~# /etc/init.d/saslauthd start

Инсталяция IMAP сервера

FreeBSD

[gate:~] # pkg_add -r cyrus-imapd22

[gate:~] # rehash

[gate:~] # cd /usr/local/etc

Ubuntu

root@gate:~# apt-get install postfix
(Internet Site)

root@gate:~# apt-get install cyrus-imapd-2.2 cyrus-admin-2.2
root@gate:~# apt-get install sasl2-bin libsasl2-modules-gssapi-mit

root@gate:~# cd /etc

Настройка IMAP сервера

gate# rcsdiff imapd.conf
...
108c108
< #admins: <none>
---
> admins: cyrus
306c306
< sasl_pwcheck_method: auxprop
---
> sasl_pwcheck_method: saslauthd

Инициализация хранилища почты IMAP сервера и запуск сервера

FreeBSD

[gate:~] # /usr/local/cyrus/bin/mkimap

[gate:~] # cat /etc/rc.conf
...
cyrus_imapd_enable=yes

[gate:~]# /usr/local/etc/rc.d/imapd start

Ubuntu

root@gate:~# chown -R cyrus:mail /var/spool/cyrus
root@gate:~# chown -R cyrus:mail /var/run/cyrus
root@gate:~# chown -R cyrus:mail /var/lib/cyrus

root@gate:~# /etc/init.d/cyrus2.2 restart

Проверка

gate# telnet localhost 143

Регистрируем пользователя cyrus в вспомогательной базе данных sasl

gate# saslpasswd2 -c cyrus

gate# sasldblistusers2
cyrus@gate.corpX.un: userPassword

Создаем почтовые ящики всех пользователей сервиса IMAP

gate# cyradm -u cyrus localhost
Password: 
localhost.class> cm user.student
localhost.class> cm user.mailuser
localhost.class> lm     
user.student (\HasNoChildren)  user.uX (\HasNoChildren)   
localhost.class> quit

Настраиваем MTA на использование доставщика cyrus-imap

FreeBSD (Sendmail)

[gate:~] # cat /etc/rc.conf
sendmail_enable="YES"
...

[gate:~] # more /usr/local/share/doc/cyrus-imapd/text/install-configure

[gate:~] # cd /etc/mail

[gate:/etc/mail] # cat gate.corpX.un.mc 
OSTYPE(freebsd6)
define(`confLOCAL_MAILER', `cyrusv2')
...
MAILER(local)
MAILER(smtp)
MAILER(`cyrusv2')

[gate:/etc/mail] # make install
...

[gate:/etc/mail] # /etc/rc.d/sendmail restart
Stopping sendmail.
Starting sendmail.

Ubuntu (Postfix)

root@gate:~# cat /etc/postfix/main.cf
...
mailbox_transport = cyrus

root@gate:~# cat /etc/postfix/master.cf
...
cyrus     unix  -   n   n   -   -   pipe
  flags=R user=cyrus argv=/usr/sbin/cyrdeliver ${user}

root@gate:~# /etc/init.d/postfix restart

Использование сертификатов для шифрования трафика

gate# cat imapd.conf 
...
tls_cert_file: /root/imap.crt
tls_key_file: /root/imap.key
tls_ca_file: /root/ca.crt
...

gate# cat cyrus.conf
...
       #imap            cmd="imapd -U 30" listen="imap" prefork=0 maxchild=100
       imaps          cmd="imapd -s -U 30" listen="imaps" prefork=0 maxchild=1
...
сервер_cyrus.txt · Last modified: 2013/05/22 13:50 (external edit)