Установил почтовый сервер в связке postfix+dovecot+mysql+postfixadmin (Fedora8).
Работа пока только внутри частной сети.
Отправка почты работает исправно.
Получение почты не работает. Но почта не принимается клиентом (пробовал пользоваться OE и BAT).
Через telnet подключается.
конфиги
Код: Выделить всё
cat /etc/dovecot.conf
## Dovecot configuration file
#
base_dir = /var/run/dovecot/
#
# imap imaps pop3 pop3s (use imaps and pop3s if configured for SSL)
protocols = imap pop3
#
# Uncomment the ssl_listen statements and comment out listen if using SSL
protocol imap {
listen = *:143
# ssl_listen = *:993
}
protocol pop3 {
listen = *:110
# ssl_listen = *:995
}
log_path = /var/log/dovecot
info_log_path = /var/log/dovecot
#
log_timestamp = "%Y-%m-%d %H:%M:%S"
syslog_facility = mail
#
# Uncomment these if using SSL
ssl_disable = yes
#ssl_cert_file = /etc/ssl/mycompany/mailserver/mail-cert.pem
#ssl_key_file = /etc/ssl/mycompany/mailserver/mail-key.pem
#ssl_ca_file = /etc/ssl/mycompany/ca/mycompany.pem
#ssl_verify_client_cert = yes
#ssl_parameters_regenerate = 168
#verbose_ssl = no
#
# Where the mailboxes are located
mail_location = maildir:/var/vmail/%d/%u
#
mail_extra_groups = mail
mail_debug = no
first_valid_uid = 150
last_valid_uid = 150
maildir_copy_with_hardlinks = yes
#
protocol imap {
login_executable = /usr/libexec/dovecot/imap-login
mail_executable = /usr/libexec/dovecot/imap
imap_max_line_length = 65536
}
protocol pop3 {
login_executable = /usr/libexec/dovecot/pop3-login
mail_executable = /usr/libexec/dovecot/pop3
pop3_uidl_format = %08Xu%08Xv
}
protocol lda {
postmaster_address = postmaster@mail.kul
sendmail_path = /usr/lib/sendmail
auth_socket_path = /var/run/dovecot/auth-master
}
#
auth_verbose = no
auth_debug = no
auth_debug_passwords = no
#
auth default {
mechanisms = PLAIN
passdb sql {
args = /etc/dovecot/dovecot-sql.conf
}
userdb sql {
args = /etc/dovecot/dovecot-sql.conf
}
user = nobody
socket listen {
master {
path = /var/run/dovecot/auth-master
mode = 0660
user = vmail
group = mail
}
client {
path = /var/spool/postfix/private/auth
mode = 0660
user = postfix
group = postfix
}
}
#
# If you want client certificates, use these lines
# ssl_require_client_cert = yes
# ssl_username_from_cert = yes
}
Код: Выделить всё
cat /etc/dovecot/dovecot-sql.conf
driver = mysql
connect = host=localhost dbname=mail user=mail password=mail
default_pass_scheme = PLAIN
password_query = SELECT username as user, password, '/var/vmail/mail.kul/%n' as userdb_home, 'maildir:/var/vmail/mail.kul/%n' as userdb_mail, $mail, 150 as userdb_uid, 12 as userdb_gid FROM mailbox WHERE username ='%u' AND active = '1'
user_query = SELECT '/var/vmail/mail.kul/%n' as home, 'maildir:/var/vmail/mail.kul/%n' as mail, 150 AS uid, 12 AS gid, concat('dirsize:storag=',quota) AS quota FROM mailbox WHERE username = '%u' AND active = '1'
При проверке почты в логах пишет:
dovecot: Apr 07 10:54:30 Info: auth(default): new auth connection: pid=22726
dovecot: Apr 07 10:54:53 Info: pop3-login: Disconnected: rip=10.29.11.13, lip=10.29.11.12
Если в клиенте (OE) убираю галку Безопасная проверка пароля SPA, то в логах идёт следующее
[codebox]dovecot: Apr 07 10:52:57 Info: auth(default): client in: AUTH 1 PLAIN service=POP3 lip=10.29.11.12 rip=10.29.11.13 resp=AHRlc3QyADExMTE=
dovecot: Apr 07 10:52:57 Info: auth-worker(default): sql(test2,10.29.11.13): query: SELECT username as user, password, '/var/vmail/mail.kul/test2' as userdb_home, 'maildir:/var/vmail/mail.kul/test2' as userdb_mail, 150 as userdb_uid, 12 as userdb_gid FROM mailbox WHERE username ='test2' AND active = '1'
dovecot: Apr 07 10:52:57 Info: auth-worker(default): sql(test2,10.29.11.13): unknown user
dovecot: Apr 07 10:52:58 Info: auth(default): new auth connection: pid=22723
dovecot: Apr 07 10:52:58 Info: auth(default): client out: FAIL 1 user=test2
dovecot: Apr 07 10:52:58 Info: pop3-login: Disconnected: user=<test2>, method=PLAIN, rip=10.29.11.13, lip=10.29.11.12
dovecot: Apr 07 10:54:30 Info: pop3-login: Disconnected: rip=10.29.11.13, lip=10.29.11.12
[/code]
если захожу телнетом
Код: Выделить всё
# telnet mail.kul 110
Trying 10.29.11.12...
Connected to mail.kul.
Escape character is '^]'.
+OK dovecot MUA ready
user test2@mail.kul
+OK
pass 1111
+OK Logged in.
list
+OK 2 messages:
1 560
2 2650
.
quit
+OK Logging out.
Код: Выделить всё
dovecot: Apr 07 16:59:06 Info: auth(default): new auth connection: pid=23618
dovecot: Apr 07 16:59:22 Info: auth(default): client in: AUTH 1 PLAIN service=POP3 secured lip=10.29.11.12 rip=10.29.11.12 resp=AHRlc3QyQG1haWwua3VsADExMTE=
dovecot: Apr 07 16:59:22 Info: auth-worker(default): mysql: Connected to localhost (mail)
dovecot: Apr 07 16:59:22 Info: auth-worker(default): sql(test2@mail.kul,10.29.11.12): query: SELECT username as user, password, '/var/vmail/mail.kul/test2' as userdb_home, 'maildir:/var/vmail/mail.kul/test2' as userdb_mail, 150 as userdb_uid, 12 as userdb_gid FROM mailbox WHERE username ='test2@mail.kul' AND active = '1'
dovecot: Apr 07 16:59:22 Info: auth(default): client out: OK 1 user=test2@mail.kul
dovecot: Apr 07 16:59:22 Info: auth(default): master in: REQUEST 4 23590 1
dovecot: Apr 07 16:59:22 Info: auth-worker(default): sql(test2@mail.kul,10.29.11.12): SELECT '/var/vmail/mail.kul/test2' as home, 'maildir:/var/vmail/mail.kul/test2' as mail, 150 AS uid, 12 AS gid, concat('dirsize:storage=',quota) AS quota FROM mailbox WHERE username = 'test2@mail.kul' AND active = '1'
dovecot: Apr 07 16:59:22 Info: auth(default): master out: USER 4 test2@mail.kul home=/var/vmail/mail.kul/test2 mail=maildir:/var/vmail/mail.kul/test2 uid=150 gid=12 quota=dirsize:storage=0
dovecot: Apr 07 16:59:22 Info: pop3-login: Login: user=<test2@mail.kul>, method=PLAIN, rip=10.29.11.12, lip=10.29.11.12, secured
dovecot: Apr 07 16:59:22 Info: POP3(test2@mail.kul): Effective uid=150, gid=12
dovecot: Apr 07 16:59:22 Info: POP3(test2@mail.kul): maildir: data=/var/vmail/mail.kul/test2
dovecot: Apr 07 16:59:22 Info: POP3(test2@mail.kul): maildir: root=/var/vmail/mail.kul/test2, index=/var/vmail/mail.kul/test2, control=, inbox=
dovecot: Apr 07 16:59:31 Info: POP3(test2@mail.kul): Disconnected: Logged out top=0/0, retr=0/0, del=0/2, size=3210