[Dovecot] dovecot v-2.0, postfix+mysql configuration issue.

Vimuth vimuthd at gmail.com
Thu Mar 28 08:18:42 EET 2013


Greetings Gentlemen,
Im in the attempt of configuring a postfix mail server on RHEL6.2 with the
said components in the subject. I followed a couple of guides and I beleive
that Im almost there, but I get the following error when I try to send a
mail to a user who is in the mysql database as follows, Dovecot version
that is being used is 2.0.X.

echo test | mail vimuth at mydomain.rock

[root at box1 ~]# tail -f /var/log/maillog
Mar 26 07:00:44 box1 dovecot: auth: Error: sql(vimuth at mydomain.rock): User
query failed: Table 'mailserver.users' doesn't exist (using built-in
default user_query: SELECT home, uid, gid FROM users WHERE username = '%n'
AND domain = '%d')
Mar 26 07:00:44 box1 dovecot: lda: Error: user vimuth at mydomain.rock: Auth
USER lookup failed
Mar 26 07:00:44 box1 dovecot: lda: Fatal: Internal error occurred. Refer to
server log for more information.
Mar 26 07:00:44 box1 postfix/pipe[6291]: A9E0E23B96:
to=<vimuth at mydomain.rock>, relay=dovecot, delay=14255,
delays=14255/0.02/0/0.12, dsn=4.3.0, status=deferred (temporary failure)
Mar 26 07:05:44 box1 postfix/qmgr[5675]: 2E5AD23B66:
from=<root at box1.mydomain.rock>, size=421, nrcpt=1 (queue active)
Mar 26 07:05:44 box1 dovecot: auth: Error: mysql: Query failed, retrying:
Table 'mailserver.users' doesn't exist
Mar 26 07:05:44 box1 dovecot: auth: Error: sql(vimuth at mydomain.rock): User
query failed: Table 'mailserver.users' doesn't exist (using built-in
default user_query: SELECT home, uid, gid FROM users WHERE username = '%n'
AND domain = '%d')
Mar 26 07:05:44 box1 dovecot: lda: Error: user vimuth at mydomain.rock: Auth
USER lookup failed
Mar 26 07:05:44 box1 dovecot: lda: Fatal: Internal error occurred. Refer to
server log for more information.
Mar 26 07:05:44 box1 postfix/pipe[6312]: 2E5AD23B66:
to=<vimuth at mydomain.rock>, relay=dovecot, delay=16007,
delays=16007/0.03/0/0.08, dsn=4.3.0, status=deferred (temporary failure)

As I understand, this has something to do with the way I have setup my
database. Im gonna post what are in my most important configuration files
and also of course in the database.

here's *"/etc/dovecot/dovecot-sql.conf.ext"*

driver = mysql
connect = host=127.0.0.1 dbname=mailserver user=mailuser password=redhat
default_pass_scheme = MD5
password_query = SELECT email as user, password FROM virtual_users WHERE
email='%u';

here's */etc/postfix/main.cf*

# TLS parameters
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_tls_key_file = /etc/pki/tls/private/smtpd.key
smtpd_tls_cert_file = /etc/pki/tls/smtpd.crt
smtpd_tls_CAfile = /etc/pki/tls/certs/cacert.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom

# set smtpd restrictions
smtpd_recipient_restrictions = permit_sasl_authenticated,
                               permit_mynetworks,
                               reject_unauth_destination</pre>
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

mailbox_command = /usr/libexec/dovecot/deliver
mailbox_transport = dovecot
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1

Now to the *database
*
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mail               |
| mailserver         |
| mysql              |
+--------------------+[

mysql> use mailserver;
Database changed
mysql> select * from mailserver;
mysql> show tables;
+----------------------+
| Tables_in_mailserver |
+----------------------+
| virtual_aliases      |
| virtual_domains      |
| virtual_users        |
+----------------------+

mysql> select * from virtual_users;
+----+-----------+----------------------------------+----------------------+
| id | domain_id | password                         | email                |
+----+-----------+----------------------------------+----------------------+
|  1 |         1 | e2798af12a7a0f4f70b4d69efbc25f4d | vimuth at mydomain.rock |
+----+-----------+----------------------------------+----------------------+
1 row in set (0.00 sec)

Please can someone help. If you need more information please let me know.
I'm ready to tear down the entire implementation and start from the scratch.

Many thanks in advance.
/Vimuth


More information about the dovecot mailing list