postfix+mysql+dovecot

# yum -y install dovecot dovecot-mysql
# chkconfig dovecot on
# vi /etc/dovecot/conf.d/10-mail.conf

mail_location = maildir:/home/email/%d/%n
# cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf
# cp /usr/share/doc/dovecot-2.0/example-config/dovecot-sql.conf.ext /etc/dovecot/
# vi /etc/dovecot/dovecot-sql.conf.ext

driver = mysql
default_pass_scheme = PLAIN
connect = host=localhost dbname=postfix user=email password=westos
password_query = \
  SELECT username, domain, password \
  FROM email WHERE username = '%u'
user_query = \
  SELECT mailbox, 600 AS uid, 600 AS gid \
  FROM email WHERE username = '%u'
# yum -y install telnet
# telnet localhost 110

Connected to localhost.
Escape character is '^]'.
+OK Dovecot ready. <[email protected]>
user [email protected]
+OK
pass westos
+OK Logged in.
list
+OK 2 messages:
1 548
2 548
.

你可能感兴趣的:(数据库,mysql,linux,postfix,Dovecot)