LINUX.ORG.RU
ФорумAdmin

Postfix, Dovecot, SQL

 , ,


0

4

Продолжение истории http://www.linux.org.ru/forum/admin/7629316
Настроил всё, заработало. Пока решаю вопросы с DNS(nic.ru), обратил внимание что пользователь авторизуется по имени ящика, а не по логину.

В частности для Thunderbird'а пришлось руками править имя пользователя на соответствие адресу(name: user@example.com, mail:user@example.com) т.к. по умолчанию он схватывал имя как «user» и отказывался авторизоваться.

Реализовал обратное «в лоб»: в dovecot-sql.conf.ext

password_query = SELECT mail as username, password FROM users WHERE userid = '%n' [br]
user_query = SELECT '/var/mail/'||home AS home, uid, gid FROM users WHERE userid = '%n'


и в virtual.cf

select_field=address
where_field=address

Вопрос: как можно добиться такого же эффекта «правильнее», т.к. тут явное пртиворечие с Postfix'ом, который ожидает полное имя пользователя как логин.

В документации к Postfix'у(убрать фрагмент под кат не получилось:():

# TABLE SEARCH ORDER
#        With lookups from indexed files such as DB or DBM, or from
#        networked tables such as NIS, LDAP or  SQL,  patterns  are
#        tried in the order as listed below:
#
#        user@domain address, address, ...
#               Redirect  mail  for  user@domain  to address.  This
#               form has the highest precedence.
#
#        user address, address, ...
#               Redirect mail for user@site to address when site is
#               equal  to $myorigin, when site is listed in $mydes-
#               tination, or when it is listed in  $inet_interfaces
#               or $proxy_interfaces.
#
#               This  functionality  overlaps with functionality of
#               the local aliases(5) database.  The  difference  is
#               that virtual(5) mapping can be applied to non-local
#               addresses.
#
#        @domain address, address, ...
#               Redirect mail for other users in domain to address.
#               This form has the lowest precedence.
#
#               Note:  @domain  is a wild-card. With this form, the
#               Postfix SMTP server accepts mail for any  recipient
#               in  domain,  regardless  of  whether that recipient
#               exists.  This may turn  your  mail  system  into  a
#               backscatter  source: Postfix first accepts mail for
#               non-existent recipients and then  tries  to  return
#               that  mail  as  "undeliverable" to the often forged
#               sender address.

Других вариантов скормить ему только логин я не нашел.
PS. Передача логина Довкоту(%n, когда ожидается %u) мне тоже не нравится.

★★★★

Последнее исправление: Yustas (всего исправлений: 1)

Ответ на: комментарий от lnx

Он авторизуется так, да. Тут вопрос о том что бы раскидывать почту в ящики. Т.е. по логину определять директорию где почта(Maildir).

Yustas ★★★★
() автор топика
Ответ на: комментарий от Yustas

если я правильно понял вопрос - смотри в сторону virtual_mailbox_maps=
Сам использую dovecot'овский LDA с SIEVE.

lnx
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.