авторизация dovecot не работает при попытке подключения через Mutt, но все предложенные тесты аутентификации dovecot работают

Я не могу понять, почему процесс авторизации dovecot удаляет домен из моего имени пользователя при попытке подключения через моего клиента (mutt).

Я Я использую простой пароль для авторизации userdb / passdb для аутентификации, на данный момент отключил систему аутентификации (с PAM) (она засоряла журналы, так как я только пытался настроить виртуального пользователя). Дополнительные объяснения в конце.

doveadm auth test -x service=imap user@domain.id 
passdb: user@domain.id auth succeeded
extra fields:
  user=user@domain.id

,

dovecot auth test user@domain.id password
passdb: user@domain.id auth succeeded
extra fields:
  user=user@domain.id

и

telnet imap.domain.id 143
trying xx.xxx.xx.x
Connected to imap.domain.id
Escape character is '^]'
* OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ STARTTLS AUTH=PLAIN] Dovecot ready.
a login user password
 OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SNIPPET=FUZZY PREVIEW=FUZZY LITERAL+ NOTIFY SPECIAL-USE] Logged in

пока все в порядке

mail.log:

Apr 18 14:42:32 dserver dovecot: auth: Debug: auth client connected (pid=1153208)
Apr 18 14:42:48 dserver dovecot: auth: Debug: client in: AUTH#0111#011PLAIN#011service=imap#011session=9z4GjJejPOpDqz0B#011lip=192.168.1.18#011rip=67.171.61.1#011lport=143#011rport=59964#011resp=AHNwZW5jZXJAZGF2ZXkuaWQAQmVuZGVyYmMx (previous base64 data may contain sensitive data)
Apr 18 14:42:48 dserver dovecot: auth: Debug: passwd-file(user@domain.id,xx.xx.xx.x,<9z4GjJejPOpDqz0B>): Performing passdb lookup
Apr 18 14:42:48 dserver dovecot: auth: Debug: passwd-file(user@domain.id,xx.xx.xx.x,<9z4GjJejPOpDqz0B>): lookup: user=user@domain.id file=/etc/dovecot/users
Apr 18 14:42:48 dserver dovecot: auth: Debug: passwd-file(user@domain.id,xx.xx.xx.x,<9z4GjJejPOpDqz0B>): Finished passdb lookup
Apr 18 14:42:48 dserver dovecot: auth: Debug: auth(user@domain.id,xx.xx.xx.x,<9z4GjJejPOpDqz0B>): Auth request finished
Apr 18 14:42:48 dserver dovecot: auth: Debug: client passdb out: OK#0111#011user=user@domain.id
Apr 18 14:42:48 dserver dovecot: auth: Debug: master in: REQUEST#0112833514497#0111153208#0111#01168847acfe57555a93ec42d643c212c9b#011session_pid=1153448#011request_auth_token
Apr 18 14:42:48 dserver dovecot: auth: Debug: passwd-file(user@domain.id,xx.xx.xx.x,<9z4GjJejPOpDqz0B>): Performing userdb lookup
Apr 18 14:42:48 dserver dovecot: auth: Debug: passwd-file(user@domain.id,xx.xx.xx.x,<9z4GjJejPOpDqz0B>): lookup: user=user@domain.id file=/etc/dovecot/users
Apr 18 14:42:48 dserver dovecot: auth: Debug: passwd-file(user@domain.id,xx.xx.xx.x,<9z4GjJejPOpDqz0B>): Finished userdb lookup
Apr 18 14:42:48 dserver dovecot: auth: Debug: master userdb out: USER#0112833514497#011user#011uid=500#011gid=5000#011home=/var/vmail/domain/user/#011auth_token=10245b24c5981d5c412658bd640ac3dd0a1c3f57
Apr 18 14:42:48 dserver dovecot: imap-login: Login: user=<user@domain.id>, method=PLAIN, rip=xx.xx.xx.x, lip=192.168.1.18, mpid=1153448
Apr 18 14:42:48 dserver dovecot: imap(user@domain.id)<1153448><9z4GjJejPOpDqz0B>: Debug: Effective uid=500, gid=5000, home=/var/vmail/domain.id/user/
Apr 18 14:42:48 dserver dovecot: imap(user@domain.id)<1153448><9z4GjJejPOpDqz0B>: Debug: Home dir not found: /var/vmail/domain.id/user/
Apr 18 14:42:48 dserver dovecot: imap(user@domain.id)<1153448><9z4GjJejPOpDqz0B>: Debug: Namespace inbox: type=private, prefix=, sep=/, inbox=yes, hidden=no, list=yes, subscriptions=yes location=maildir:~/Maildir
Apr 18 14:42:48 dserver dovecot: imap(user@domian.id)<1153448><9z4GjJejPOpDqz0B>: Debug: maildir++: root=/var/vmail/domain.id/user//Maildir, index=, indexpvt=, control=, inbox=/var/vmail/domain.id/user//Maildir, alt=
Apr 18 14:42:59 dserver dovecot: imap(user@domain.id)<1153448><9z4GjJejPOpDqz0B>: Logged out in=19 out=520 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0

теперь ошибки:

mutt -f imap://user@domain.id
Password: *******
login failed

mail.log:

Apr 18 14:52:24 dserver dovecot: auth: Debug: Loading modules from directory: /usr/lib/dovecot/modules/auth
Apr 18 14:52:24 dserver dovecot: auth: Debug: Module loaded: /usr/lib/dovecot/modules/auth/lib20_auth_var_expand_crypt.so
Apr 18 14:52:24 dserver dovecot: auth: Debug: Read auth token secret from /var/run/dovecot//auth-token-secret.dat
Apr 18 14:52:24 dserver dovecot: auth: Debug: passwd-file /etc/dovecot/users: Read 1 users in 0 secs
Apr 18 14:52:24 dserver dovecot: auth: Debug: auth client connected (pid=1160786)
Apr 18 14:52:33 dserver dovecot: auth: Debug: client in: AUTH#0111#011PLAIN#011service=imap#011secured=tls#011session=fcvlrpejlutDqz0B#011lip=192.168.1.18#011rip=67.171.61.1#011lport=143#011rport=60310#011local_name=davey.id#011ssl_cipher=TLS_AES_256_GCM_SHA384#011ssl_cipher_bits=256#011ssl_pfs=KxANY#011ssl_protocol=TLSv1.3#011resp=c3BlbmNlcgBzcGVuY2VyAEJlbmRlcmJjMQ== (previous base64 data may contain sensitive data)
Apr 18 14:52:33 dserver dovecot: auth: Debug: passwd-file(user,xx.xxx.xx.x,<fcvlrpejlutDqz0B>): Performing passdb lookup
Apr 18 14:52:33 dserver dovecot: auth: Debug: passwd-file(user,xx.xxx.xx.x,<fcvlrpejlutDqz0B>): lookup: user=user file=/etc/dovecot/users
Apr 18 14:52:33 dserver dovecot: auth: passwd-file(user,xx.xxx.xx.x,<fcvlrpejlutDqz0B>): unknown user
Apr 18 14:52:33 dserver dovecot: auth: Debug: passwd-file(user,xx.xxx.xx.x,<fcvlrpejlutDqz0B>): Finished passdb lookup
Apr 18 14:52:33 dserver dovecot: auth: Debug: auth(user,xx.xxx.xx.x,<fcvlrpejlutDqz0B>): Auth request finished
Apr 18 14:52:35 dserver dovecot: auth: Debug: client passdb out: FAIL#0111#011user=user
Apr 18 14:55:24 dserver dovecot: imap-login: Disconnected: Inactivity (auth failed, 1 attempts in 171 secs): user=<user>, method=PLAIN, rip=xx.xxx.xx.x, lip=192.168.1.18, TLS

Я хочу свой passdb для включения (скрытого) в поле пользователя, чтобы иметь возможность различать одно и то же имя пользователя в разных доменах в одном файле. А также сопоставить мои почтовые ящики как:

~/%d/%n/Maildir

Он работает правильно, когда я удаляю (скрытое) из поля имени пользователя в моем файле passdb. Я читал все о том, что dovecot не заботится о доменах, и вы можете управлять аутентификацией с помощью % u или % n

Проблема довольно очевидна, мои исправления просто не сработали . При входе в систему через Mutt auth удаляет (скрытый) из имени пользователя, поэтому он не аутентифицируется в моем файле passdb. Я пробовал все комбинации:

auth_username_format = %u
auth_username_format = %n

и

passdb {
  driver = passwd-file
  args = scheme=CRYPT **username_format=%u** /etc/dovecot/passdb
}

passdb {
  driver = passwd-file
  args = scheme=CRYPT **username_format%n** /etc/dovecot/passdb

** - это мое мнение

Почему аутентификация IMAP будет работать иначе, чем мои тесты telnet, а не через Mutt? Мне пришлось временно включить аутентификацию с открытым текстом для тестирования, но это не повлияло на несоответствие имени пользователя в моем файле passdb. Есть ли где-нибудь еще, где определяется username_format (или подобная конфигурация)? Я прочесал всю дорогу 24 часа.

Любая помощь приветствуется.

0
задан 19 April 2020 в 01:24
1 ответ

Выдергивание волос, глядя не в то место. Проблема в том, как я получал доступ от Mutt. mutt -fпросит найти файл почтового ящика, я предполагаю, что он называется просто 'user', так что это то, что отправляется в механизм аутентификации, игнорируя '@domain.id'. Я попробовал это с другим клиентом и смог успешно создать / получить доступ к учетной записи.

0
ответ дан 19 April 2020 в 04:05

Теги

Похожие вопросы