>Собрал на этот раз с подержкой SSL
>cd /usr/ports/mail/cclient
>make -DWITH_SSL_AND_PLAINTEXT install
>
>cd /usr/ports/mail/imap-uw
>make -DWITH_SSL_AND_PLAINTEXT install
good, достаточно было только в imap-uw сделать make с нужными
опциями, библиотека cclient собралась бы как нужно.
Самое главное - после make install выдается СООБЩЕНИЕ на консоль,
вы внимательно его читали?!
# less /usr/ports/mail/imap-uw/pkg-message
>создал сертификат
>make cert
good
>Gate# ls -lA /var/db/pkg | grep cclient
>drwxr-xr-x 2 root wheel 512 Feb 10 11:11 cclient-2004g,1
>
>
>Gate# ls -lA /var/db/pkg | grep imap
>drwxr-xr-x 2 root wheel 512 Feb 10 11:11 imap-uw-2004g_1,1
>
>
>Gate# cat /usr/local/include/c-client/portrevision.h
>#define CCLIENT_PORTVERSION "2004g"
>#define CCLIENT_SSLENABLED "yes"
good
>Gate# cat /etc/pam.d/imap
>#
># $FreeBSD: src/etc/pam.d/imap,v 1.5 2003/03/08 09:50:11 markm Exp $
>#
># PAM configuration for the "imap" service
>#
>
># auth
>#auth required
> pam_nologin.so
> no_warn
>#auth sufficient
> pam_krb5.so
> no_warn try_first_pass
>#auth sufficient
> pam_ssh.so
> no_warn try_first_pass
>auth
>required pam_unix.so
> no_warn
>try_first_pass
>#auth required
> pam_unix.so
> try_first_pass
>
>Gate# cat /etc/pam.d/pop3
>#
># $FreeBSD: src/etc/pam.d/pop3,v 1.5 2003/03/08 09:50:11 markm Exp $
>#
># PAM configuration for the "pop3" service
>#
>
># auth
>#auth required
> pam_nologin.so
> no_warn
>#auth sufficient
> pam_krb5.so
> no_warn try_first_pass
>#auth sufficient
> pam_ssh.so
> no_warn try_first_pass
>auth
>required pam_unix.so
> no_warn
>try_first_pass
Э-э-эх, ну что тут сказать, см.выше про чтение pkg-message, что
должно быть в PAM'е (если сборка с PAM, она там by default):
/etc/pam.d/imap
#...
#...
imap auth required pam_unix.so
imap account required pam_unix.so
imap session required pam_unix.so
/etc/pam.d/pop3
#...
#...
pop3 auth required pam_unix.so
pop3 account required pam_unix.so
pop3 session required pam_unix.so
>Gate# grep imap /etc/inetd.conf
># example entry for the optional imap4 server
>#imap4 stream tcp nowait root
> /usr/local/libexec/imapd
>imapd
>imaps stream tcp nowait
>root /usr/local/libexec/imapd
> imapd
>
>Gate# grep pop3 /etc/inetd.conf
># example entry for the optional pop3 server
>#pop3 stream tcp nowait
>root /usr/local/libexec/popper
>popper
>pop3 stream tcp nowait
> root /usr/local/libexec/popa3d
> popa3d
подразумевается запуск imap/pop3 демоном inetd, для чего демон inetd
должен быть застартован:
# grep inetd /etc/rc.conf
inetd_enable="YES"
# ps -axuww | grep inetd
/etc/inetd.conf:
...
#-- start pop3-daemon from inetd 110/tcp port
pop3 stream tcp nowait root /usr/local/libexec/ipop3d ipop3d
#-- start imap-daemon from inetd 143/tcp port
imap4 stream tcp nowait root /usr/local/libexec/imapd imapd
#-- start pop3/ssl 995/tcp port, imap/ssl 993/tcp port
pop3s stream tcp nowait root /usr/local/libexec/ipop3d ipop3d
imaps stream tcp nowait root /usr/local/libexec/imapd imapd
...
после изменений в /etc/inetd.conf - kill -HUP "процессу inetd"
если не нужен POP3 и POP3/SSL - закомментировать, если не нужен IMAP и
IMAP/SSL - закомментировать и тд и тп в любых сочетаниях
Допустим мы закрываем в FIREWALL доступ к clear-text протоколам POP3/IMAP
снаружи, чтобы защититься от прослушки, те разрешаем работу POP3/IMAP
только внутри локалки, а для тех кто извне хочет читать почту, пусть
пользуются защищенными протоколами POP3/IMAP через SSL: порты 995/993
[unix1]~ > sockstat | grep ":110"
root inetd 907 4 tcp4 *:110 *:*
[unix1]~ > sockstat | grep ":143"
root inetd 907 5 tcp4 *:143 *:*
[unix1]~ > sockstat | grep ":995"
root inetd 907 6 tcp4 *:995 *:*
[unix1]~ > sockstat | grep ":993"
root inetd 907 7 tcp4 *:993 *:*
[unix1]~ >
[cntc]~ > nmap -p110 unix1.jinr.ru
Starting nmap V. 3.00 ( www.insecure.org/nmap/ )
Interesting ports on unix1.jinr.ru (159.93.44.57):
Port State Service
110/tcp filtered pop-3
Nmap run completed -- 1 IP address (1 host up) scanned in 2 seconds
[cntc]~ > nmap -p143 unix1.jinr.ru
Starting nmap V. 3.00 ( www.insecure.org/nmap/ )
Interesting ports on unix1.jinr.ru (159.93.44.57):
Port State Service
143/tcp filtered imap2
Nmap run completed -- 1 IP address (1 host up) scanned in 3 seconds
[cntc]~ > nmap -p995 unix1.jinr.ru
Starting nmap V. 3.00 ( www.insecure.org/nmap/ )
Interesting ports on unix1.jinr.ru (159.93.44.57):
Port State Service
995/tcp open pop3s
Nmap run completed -- 1 IP address (1 host up) scanned in 0 seconds
[cntc]~ > nmap -p993 unix1.jinr.ru
Starting nmap V. 3.00 ( www.insecure.org/nmap/ )
Interesting ports on unix1.jinr.ru (159.93.44.57):
Port State Service
993/tcp open imaps
Nmap run completed -- 1 IP address (1 host up) scanned in 0 seconds
[cntc]~ >
filtered - отфильтрован в firewall
open - открыт
тонкости:
- проверить правильно ли СГЕНЕРЕНЫ сертификаты
- проверить POP3/IMAP авторизацию через telnet (так как clear-text
пароли разрешены при сборке)
# telnet host 110
...
user имя
должны получить ok
pass пароль
должны получить ok
quit
проверить для imap по 143 порту
Поиск по форуму, imap-uw - я это много раз расписывал
>Gate# sockstat | grep ":110"
>root inetd 670
> 5 tcp4 *:110
>
> *
>
>nobody squid 14227 23 tcp4
> 192.168.0.2:3128 192.168.0.20:1430
>Gate# sockstat | grep ":993"
>root inetd 670
> 9 tcp4 *:993
>
> *:*