LINUX.ORG.RU
ФорумAdmin

Dovecot, не могу подключиться telnet-м


0

1

Телнетом не подключается.

Какие именно конфги надо скинуть?

denis@debianmail:~$ telnet 127.0.0.1 143 Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS AUTH=PLAIN] Dovecot ready. a1 LOGIN john@example.org summersun a1 NO [AUTHENTICATIONFAILED] Authentication failed.

лог

Jul 03 18:18:14 auth: Debug: client in: AUTH 1 PLAIN service=imap secured session=GjrjIZzgNwB/AAAB lip=127.0.0.1 rip=127.0.0.1 lport=143 rport=50999 resp=AGpvaG5AZXhhbXBsZS5vcmcAc3VtbWVyc3Vu Jul 03 18:18:14 auth-worker(13305): Debug: Loading modules from directory: /usr/lib/dovecot/modules/auth Jul 03 18:18:14 auth-worker(13305): Debug: Module loaded: /usr/lib/dovecot/modules/auth/libdriver_mysql.so Jul 03 18:18:14 auth-worker(13305): Debug: Module loaded: /usr/lib/dovecot/modules/auth/libdriver_pgsql.so Jul 03 18:18:14 auth-worker(13305): Debug: Module loaded: /usr/lib/dovecot/modules/auth/libdriver_sqlite.so Jul 03 18:18:14 auth-worker(13305): Debug: pam(john@example.org,127.0.0.1): lookup service=dovecot Jul 03 18:18:14 auth-worker(13305): Debug: pam(john@example.org,127.0.0.1): #1/1 style=1 msg=Password: Jul 03 18:18:18 auth: Debug: client out: FAIL 1 user=john@example.org

Jul 02 20:20:42 auth-worker(10941): Info: pam(john@example.org,127.0.0.1): pam_authenticate() failed: Authentication failure (password mismatch?) (given password: summersun) Jul 02 20:20:45 imap-login: Info: Disconnected: Too many invalid commands (auth failed, 1 attempts in 5 secs): user=<john@example.org>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured, session=<FI/luYngHgB/AAAB>



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

Учимся читать логи:

Info: pam(john@example.org,127.0.0.1): pam_authenticate() failed: Authentication failure (password mismatch?) (given password: summersun)

Пользователя john@example.org нету в системе, либо пароль неверный

anonymous
()
Ответ на: комментарий от anonymous

дык, настроено.

# Database driver: mysql, pgsql, sqlite driver = mysql

# Examples: # connect = host=192.168.1.1 dbname=users # connect = host=sql.example.com dbname=virtual user=virtual password=blarg # connect = /etc/dovecot/authdb.sqlite #

connect = host=10.5.1.249 dbname=mailserver user=mailuser password=sans

# Default password scheme. # # List of supported schemes is in # http://wiki2.dovecot.org/Authentication/PasswordSchemes #

default_pass_scheme = PLAIN

запрос

# Example: # password_query = SELECT userid AS user, pw AS password \ # FROM users WHERE userid = '%u' AND active = 'Y'

password_query = SELECT email as user, password FROM virtual_users WHERE email='%u';

# For using doveadm -A: iterate_query = SELECT userid AS username, domain FROM users

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

sry. :(

# Database driver: mysql, pgsql, sqlite

driver = mysql

# Examples:
#   connect = host=192.168.1.1 dbname=users
#   connect = host=sql.example.com dbname=virtual user=virtual password=blarg
#   connect = /etc/dovecot/authdb.sqlite

connect = host=10.5.1.249 dbname=mailserver user=mailuser password=sans

# Default password scheme. # # List of supported schemes is in # http://wiki2.dovecot.org/Authentication/PasswordSchemes

default_pass_scheme = PLAIN

запрос

# Example:
#   password_query = SELECT userid AS user, pw AS password \
#     FROM users WHERE userid = '%u' AND active = 'Y'

password_query = SELECT email as user, password FROM virtual_users WHERE email='%u';

# For using doveadm -A:

iterate_query = SELECT userid AS username, domain FROM users
nebraska_edu
() автор топика
Ответ на: комментарий от anonymous

я делал вот по этому гайду, там user_query нет.

http://workaround.org/ispmail/squeeze/setting-up-dovecot

если делать по вики, то надо добавлять

user_query = SELECT home, uid, gid FROM users WHERE userid = '%n' AND domain = '%d'

у меня все пользователи в mysql в таблице vitrtual_users.

как запрос правильно сформировать?

nebraska_edu
() автор топика
Ответ на: комментарий от nebraska_edu
use:
userdb static {
    args = uid=5000 gid=5000 home=/var/vmail/%d/%n allow_all_users=yes
}
to tell Dovecot where the mailboxes are located. This is similar to the mail_location setting. The user gets authenticated in the "passdb sql" section. So the "userdb static" section defined where the mail folders are located. Using "userdb sql" is not needed as all mailboxes follow a fixed directory schema. This saves an SQL query for each access. The "allow_all_users=yes" setting means that it is not necessary for Dovecot to check if a certain user exists. We can do that because Postfix has already ensured (in the virtual_mailbox_maps query) that the users existed before their email was handed over to Dovecot's "deliver" agent.

Эта цитата из вашего же гайда, читайте до полного понимания.

anonymous
()
Ответ на: комментарий от anonymous

прочитал, сделал, спасибо - проблема осталась.

там же в гайде написано

You will want to comment out the section called "passdb pam that deals with system users. Otherwise Dovecot will also look for system users when someone fetches emails which leads to warnings in your log file.

в логах как раз эта проблема, но я не могу найти эту секцию. В каком файле она должна быть?

nebraska_edu
() автор топика
Ответ на: комментарий от anonymous
Jul 4 16:46:45 debianmail postfix/pipe[14766]: 970C416007E: to=<john@example.org>, relay=dovecot, delay=4714, delays=4714/0.02/0/0.07, dsn=4.3.0, status=deferred (temporary failure. Command output: pipe: fatal: pipe_command: execvp /usr/local/libexec/dovecot/deliver: No such file or directory ) 

как я понял, не хватает какого файла, а в пути прописан он.

ткните в ман, где это описано.

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

main.cf

 # Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_sasl_type = dovecot

smtpd_sasl_path = private/auth

# and the common settings to enable SASL:
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

dovecot_destination_recipient_limit = 1
virtual_mailbox_domains = 
virtual_transport = dovecot

myhostname = debianmail.rus.local
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = debianmail.rus.local, localhost.rus.local, , localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 10.5.1.0/24
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf
denis@debianmail:~$ # Debian specific:  Specifying a file name will cause the first
denis@debianmail:~$ # line of that file to be used as the name.  The Debian default
denis@debianmail:~$ # is /etc/mailname.
denis@debianmail:~$ #myorigin = /etc/mailname
denis@debianmail:~$
denis@debianmail:~$ smtpd_sasl_type = dovecot 
nebraska_edu
() автор топика
Ответ на: комментарий от nebraska_edu

Откуда тогда взялся это путь?

/usr/local/libexec/dovecot/deliver

В Debian deliver находится в /usr/lib/dovecot/deliver

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