The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]

форумы  помощь  поиск  регистрация  майллист  вход/выход  слежка  RSS
"Dovecot,  AUTH SMTP и proxy"
Вариант для распечатки  
Пред. тема | След. тема 
Форумы OpenNET: Виртуальная конференция (Public)
Изначальное сообщение [ Отслеживать ]

"Dovecot,  AUTH SMTP и proxy"  +/
Сообщение от artemrts email(ok) on 01-Окт-09, 11:38 
Возникла необходимость настроить аутентификацию SMTP в AD, т.к. почтовик в конторе на Exchange. Плюс к этому надо проксировать imaps, т.е. "выставить" imaps в мир.

  Значит AUTH Postfix, используя Dovecot SASL,  я настроил. Dovecot производит аутентификацию методом Authentication binds (как описано в Wiki).

  Ниже привожу основную часть конфига dovecot.conf
  
protocols = imaps

protocol imap {
          #listen = *:10143
          ssl_listen = external_ip:993
         }

auth default {
          
      mechanisms = plain login
  
      passdb passwd-file {
              args = /usr/local/etc/dovecot-imap-proxy
                         }

      passdb ldap {
              args = /usr/local/etc/dovecot-ldap.conf
                  }
      
      userdb static {
              args = uid=0 gid=0
                    }

      socket listen {      

           client {
           path = /var/spool/postfix/private/auth
           mode = 0660
           user = postfix
           group = postfix
                  }
                }
              }

   Если вместо protocols = imaps прописать protocols = none, т.е использовать только Dovecot SASL, то SMTP AUTH работает отлично. Но с imaps работать не хочет. Я так понимаю надо создать 2 типа auth, один будет использоваться для SMTP AUTH, другой - для imaps. Но как это сделать? Вобщем прошу помощи.

Высказать мнение | Ответить | Правка | Cообщить модератору

Оглавление

Сообщения по теме [Сортировка по времени | RSS]


1. "Dovecot,  AUTH SMTP и proxy"  +/
Сообщение от mr_gfd on 01-Окт-09, 16:44 
dovecot -n, пжалста. Попробуем помозговать тогда
Высказать мнение | Ответить | Правка | Наверх | Cообщить модератору

2. "Dovecot,  AUTH SMTP и proxy"  +/
Сообщение от artemrts email(ok) on 01-Окт-09, 18:00 
>dovecot -n, пжалста. Попробуем помозговать тогда

  Да, конечно.

# dovecot -n|cat
# 1.2.4: /usr/local/etc/dovecot.conf
# OS: FreeBSD 7.2-RELEASE-p2 i386
protocols: none
ssl_listen: external_ip:993
ssl_cipher_list: ALL:!LOW:!SSLv2
login_dir: /var/run/dovecot/login
login_executable: /usr/local/libexec/dovecot/imap-login
verbose_proctitle: yes
first_valid_uid: 1000
first_valid_gid: 1000
mail_privileged_group: mail
imap_client_workarounds: delay-newmail netscape-eoh tb-extra-mailbox-sep
lda:
  postmaster_address: postmaster@example.com
  sendmail_path: /usr/sbin/sendmail
auth default:
  mechanisms: plain login
  username_format: %Lu
  debug: yes
  passdb:
    driver: ldap
    args: /usr/local/etc/dovecot-ldap.conf
  userdb:
    driver: passwd
    args: blocking=yes
  userdb:
    driver: static
    args: uid=0 gid=0 home=/dev/null
  socket:
    type: listen
    client:
      path: /var/spool/postfix/private/auth
      mode: 432
      user: postfix
      group: postfix

  Полазив в Инете, видел похожие проблемы. Народ рекомендует использовать один auth default и несколько баз с указанием пути к конфигу с использованием переменной %Ls. Но у меня так и не получилось.


Высказать мнение | Ответить | Правка | Наверх | Cообщить модератору

3. "Dovecot,  AUTH SMTP и proxy"  +/
Сообщение от artemrts email(ok) on 01-Окт-09, 18:15 

  Сорри там опечатка  вышла.
  protocols: imaps

  

Высказать мнение | Ответить | Правка | Наверх | Cообщить модератору

4. "Dovecot,  AUTH SMTP и proxy"  +/
Сообщение от mr_gfd on 01-Окт-09, 18:26 
>
>  Сорри там опечатка  вышла.
>  protocols: imaps
>
>
>

что-то я сертификата не вижу.
что в /var/log/maillog какает ?

Высказать мнение | Ответить | Правка | Наверх | Cообщить модератору

5. "Dovecot,  AUTH SMTP и proxy"  +/
Сообщение от artemrts email(ok) on 01-Окт-09, 18:40 
Вобщем, заработало немножко:-).

# dovecot -n
# 1.2.4: /usr/local/etc/dovecot.conf
# OS: FreeBSD 7.2-RELEASE-p2 i386
protocols: imaps
ssl_listen: external_ip:993
ssl_cipher_list: ALL:!LOW:!SSLv2
login_dir: /var/run/dovecot/login
login_executable: /usr/local/libexec/dovecot/imap-login
verbose_proctitle: yes
first_valid_uid: 1000
first_valid_gid: 1000
mail_privileged_group: mail
imap_client_workarounds: delay-newmail netscape-eoh tb-extra-mailbox-sep
lda:
  postmaster_address: postmaster@example.com
  sendmail_path: /usr/sbin/sendmail
auth default:
  mechanisms: plain login
  username_format: %Lu
  debug: yes
  passdb:
    driver: passwd-file
    args: /usr/local/etc/dovecot-%Ls.conf
  passdb:
    driver: ldap
    args: /usr/local/etc/dovecot-ldap.conf
  userdb:
    driver: passwd
    args: blocking=yes
  socket:
    type: listen
    client:
      path: /var/spool/postfix/private/auth
      mode: 432
      user: postfix
      group: postfix

Не знаю почему не выдает сертификаты, но я их сгенерировал (с помощью mkcert.sh) и в конфиге dovecot.conf прописал.

  cat /usr/local/etc/dovecot-%Ls.conf

  user1@example.com:{PLAIN}BigSecret:0:0::::proxy host=10.0.10.3 port=143

где 10.0.10.3 - адрес корпоративного Ексченджя.

  В /usr/local/etc/dovecot-ldap.conf  раскомментировал только
  auth_bind=yes
  auth_bind_userdn = cn=%n, ou=CIT, dc=example, dc=com
  ldap_version = 3
  base = dc=example, dc=com


Вот в таком виде работает, но теперь проблема. КАК заставить это работать без дополнительной записи логин\пароль в passwd-file???

Да, и еще, спасибо за то что откликнулись :-).

Высказать мнение | Ответить | Правка | Наверх | Cообщить модератору

6. "Dovecot,  AUTH SMTP и proxy"  +/
Сообщение от mr_gfd on 01-Окт-09, 23:59 
Что-то мне подсказывает, что лдап тут не работает. Мне что-то подсказывает, что userdb в данном случае работает при помощи имапа эксчейнджа.

Для эктив дайректори нужно лдап на порт 3268 биндить.

http://wiki.dovecot.org/AuthDatabase/LDAP/AuthBinds вот тут, кстати, чуть другой темплейт. ldapsearch уже заставили выбирать из активдайректори?

Высказать мнение | Ответить | Правка | Наверх | Cообщить модератору

7. "Dovecot,  AUTH SMTP и proxy"  +/
Сообщение от artemrts email(ok) on 02-Окт-09, 10:32 
>Что-то мне подсказывает, что лдап тут не работает. Мне что-то подсказывает, что
>userdb в данном случае работает при помощи имапа эксчейнджа.
>
>Для эктив дайректори нужно лдап на порт 3268 биндить.
>
>http://wiki.dovecot.org/AuthDatabase/LDAP/AuthBinds вот тут, кстати, чуть другой темплейт. ldapsearch уже заставили выбирать из
>активдайректори?

  Сорри, я пропустил главные строчки в dovecot-ldap.conf
  hosts = 10.0.29.2:389 10.0.29.3:389

  На самом деле лдап работает, потому как если закоментировать dovecot-imap.conf, то аутентификация SMTP проходит успешно.

  Проблему вижу в следующем.
  Вот здесь написано http://wiki.dovecot.org/PasswordDatabase/ExtraFields/Proxy
  
Password forwarding

Make sure that the authentication succeeds with any given password. You can do this by using empty passwords. v1.1+ requires also that you return nopassword field.

Ну я взял и прописал в файле dovecot-imap.conf следующее

%u:{PLAIN}:0:0::::proxy host=10.0.10.3 port=143

  Ниже приведу лог, с включенный auth debug

  Oct  2 09:20:11 relay dovecot: auth(default): new auth connection: pid=60178
Oct  2 09:20:44 relay dovecot: auth(default): new auth connection: pid=60182
Oct  2 09:20:45 relay dovecot: auth(default): client in: AUTH   1       PLAIN   service=imap    secured lip=external_ip     rip=199.0.149.3  lport=993       rport=27958     resp=<hidden>
Oct  2 09:20:45 relay dovecot: auth(default): passwd-file /usr/local/etc/dovecot-imap.conf: Read 1 users
Oct  2 09:20:45 relay dovecot: auth(default): passwd-file(user1@example.com,199.0.149.3): lookup: user=user1@example.com file=/usr/local/etc/dovecot-imap.conf
Oct  2 09:20:45 relay dovecot: auth(default): passwd-file(user1@example.com,199.0.149.3): unknown user
Oct  2 09:20:45 relay dovecot: auth(default): ldap_bind
Oct  2 09:20:45 relay dovecot: auth(default): ldap_simple_bind
Oct  2 09:20:45 relay dovecot: auth(default): ldap_sasl_bind
Oct  2 09:20:45 relay dovecot: auth(default): ldap_send_initial_request
Oct  2 09:20:45 relay dovecot: auth(default): ldap_send_server_request
Oct  2 09:20:45 relay dovecot: auth(default): ldap_result ld 0x185290c0 msgid -1
Oct  2 09:20:45 relay dovecot: auth(default): ldap_chkResponseList ld 0x185290c0 msgid -1 all 1
Oct  2 09:20:45 relay dovecot: auth(default): ldap_chkResponseList returns ld 0x185290c0 NULL
Oct  2 09:20:45 relay dovecot: auth(default): wait4msg ld 0x185290c0 msgid -1 (timeout 0 usec)
Oct  2 09:20:45 relay dovecot: auth(default): wait4msg continue ld 0x185290c0 msgid -1 all 1
Oct  2 09:20:45 relay dovecot: auth(default): ** ld 0x185290c0 Connections:
Oct  2 09:20:45 relay dovecot: auth(default): * host: 10.0.29.2  port: 389  (default)
Oct  2 09:20:45 relay dovecot: auth(default):   refcnt: 2  status: Connected
Oct  2 09:20:45 relay dovecot: auth(default):   last used: Fri Oct  2 09:20:45 2009
Oct  2 09:20:45 relay dovecot: auth(default):
Oct  2 09:20:45 relay dovecot: auth(default): ** ld 0x185290c0 Outstanding Requests:
Oct  2 09:20:45 relay dovecot: auth(default):  * msgid 2,  origid 2, status InProgress
Oct  2 09:20:45 relay dovecot: auth(default):    outstanding referrals 0, parent count 0
Oct  2 09:20:45 relay dovecot: auth(default): ** ld 0x185290c0 Response Queue:
Oct  2 09:20:45 relay dovecot: auth(default):    Empty
Oct  2 09:20:45 relay dovecot: auth(default): ldap_chkResponseList ld 0x185290c0 msgid -1 all 1
Oct  2 09:20:45 relay dovecot: auth(default): ldap_chkResponseList returns ld 0x185290c0 NULL
Oct  2 09:20:45 relay dovecot: auth(default): ldap_int_select
Oct  2 09:20:45 relay dovecot: auth(default): read1msg: ld 0x185290c0 msgid -1 all 1
Oct  2 09:20:45 relay dovecot: auth(default): read1msg: ld 0x185290c0 msgid 2 message type bind
Oct  2 09:20:45 relay dovecot: auth(default): ldap_chase_referrals
Oct  2 09:20:45 relay dovecot: auth(default): read1msg:  V2 referral chased, mark request completed, id = 2
Oct  2 09:20:45 relay dovecot: auth(default): new result:  res_errno: 49, res_error: <80090308: LdapErr: DSID-0C090334, comment: AcceptSecurityContext error, data 525, vece>, res_matched: <>
Oct  2 09:20:45 relay dovecot: auth(default): read1msg: ld 0x185290c0 0 new referrals
Oct  2 09:20:45 relay dovecot: auth(default): read1msg:  mark request completed, ld 0x185290c0 msgid 2
Oct  2 09:20:45 relay dovecot: auth(default): request done: ld 0x185290c0 msgid 2
Oct  2 09:20:45 relay dovecot: auth(default): res_errno: 49, res_error: <80090308: LdapErr: DSID-0C090334, comment: AcceptSecurityContext error, data 525, vece>, res_matched: <>
Oct  2 09:20:45 relay dovecot: auth(default): ldap_free_request (origid 2, msgid 2)
Oct  2 09:20:45 relay dovecot: auth(default): ldap_free_connection 0 1
Oct  2 09:20:45 relay dovecot: auth(default): ldap_free_connection: refcnt 1
Oct  2 09:20:45 relay dovecot: auth(default): ldap_parse_result
Oct  2 09:20:45 relay dovecot: auth(default): ldap_parse_result
Oct  2 09:20:45 relay dovecot: auth(default): ldap(user1@example.com,199.0.149.3): invalid credentials
Oct  2 09:20:45 relay dovecot: auth(default): ldap_msgfree
Oct  2 09:20:45 relay dovecot: auth(default): ldap_result ld 0x185290c0 msgid -1
Oct  2 09:20:45 relay dovecot: auth(default): ldap_chkResponseList ld 0x185290c0 msgid -1 all 1
Oct  2 09:20:45 relay dovecot: auth(default): ldap_chkResponseList returns ld 0x185290c0 NULL
Oct  2 09:20:45 relay dovecot: auth(default): wait4msg ld 0x185290c0 msgid -1 (timeout 0 usec)
Oct  2 09:20:45 relay dovecot: auth(default): wait4msg continue ld 0x185290c0 msgid -1 all 1
Oct  2 09:20:45 relay dovecot: auth(default): ** ld 0x185290c0 Connections:
Oct  2 09:20:45 relay dovecot: auth(default): * host: 10.0.29.2  port: 389  (default)
Oct  2 09:20:45 relay dovecot: auth(default):   refcnt: 1  status: Connected
Oct  2 09:20:45 relay dovecot: auth(default):   last used: Fri Oct  2 09:20:45 2009
Oct  2 09:20:45 relay dovecot: auth(default):
Oct  2 09:20:45 relay dovecot: auth(default): ** ld 0x185290c0 Outstanding Requests:
Oct  2 09:20:45 relay dovecot: auth(default):    Empty
Oct  2 09:20:45 relay dovecot: auth(default): ** ld 0x185290c0 Response Queue:
Oct  2 09:20:45 relay dovecot: auth(default):    Empty
Oct  2 09:20:45 relay dovecot: auth(default): ldap_chkResponseList ld 0x185290c0 msgid -1 all 1
Oct  2 09:20:45 relay dovecot: auth(default): ldap_chkResponseList returns ld 0x185290c0 NULL
Oct  2 09:20:45 relay dovecot: auth(default): ldap_int_select
Oct  2 09:20:47 relay dovecot: auth(default): client out: FAIL  1       user=user1@example.com


  КАкие предложения?


Высказать мнение | Ответить | Правка | Наверх | Cообщить модератору

Архив | Удалить

Индекс форумов | Темы | Пред. тема | След. тема




Партнёры:
PostgresPro
Inferno Solutions
Hosting by Hoster.ru
Хостинг:

Закладки на сайте
Проследить за страницей
Created 1996-2024 by Maxim Chirkov
Добавить, Поддержать, Вебмастеру