You are not logged in.

#1 2013-11-17 11:40:51

robug
Member
Registered: 2010-11-17
Posts: 28

postfix+dovecot mail server with virtual users - login problem

Ok, i manage a little machine, which acts as a server/gateway for a LAN. For a while now i've been trying to set up a mail server using this guide.
Note that in every postfix conf file i substituted

hosts = 127.0.0.1

with

hosts = /run/mysqld/mysqld.sock

since it was recommended. And, of course, i edited all the users and passwords to fit my needs
Looking at error logs obtained when trying to log i think that mysql is the mail problem:

paź 23 11:37:15 silo postfix/smtpd[921]: connect from unknown[192.168.0.105]
paź 23 11:37:15 silo postfix/trivial-rewrite[924]: warning: connect to mysql server /run/mysqld/mysqld.sock: Unknown MySQL server host '/run/mysqld/mysqld.sock' (0)
paź 23 11:37:15 silo postfix/trivial-rewrite[924]: warning: mysql:/etc/postfix/mysql-virtual-alias-maps.cf: table lookup problem
paź 23 11:37:15 silo postfix/trivial-rewrite[924]: warning: virtual_alias_domains lookup failure
paź 23 11:37:15 silo postfix/smtpd[921]: NOQUEUE: reject: RCPT from unknown[192.168.0.105]: 451 4.3.0 <student2@my.loving.server>: Temporary lookup failure; from=<student2@my.loving.server> to=<student2@my.loving.server> proto=SMTP helo=<student5>
paź 23 11:37:15 silo postfix/smtpd[921]: disconnect from unknown[192.168.0.105]
paź 23 11:37:41 silo dovecot[351]: auth-worker(930): Error: mysql(/run/mysqld/mysqld.sock): Connect failed to database (vmailserver):
Access denied for user 'vmailuser'@'localhost' (using password: YES) - waiting for 1 seconds before retry
paź 23 11:37:41 silo dovecot[351]: auth-worker(930): Error: mysql(/run/mysqld/mysqld.sock): Connect failed to database (vmailserver):
Access denied for user 'vmailuser'@'localhost' (using password: YES) - waiting for 1 seconds before retry
paź 23 11:37:42 silo dovecot[351]: auth-worker(930): Error: mysql(/run/mysqld/mysqld.sock): Connect failed to database (vmailserver):
Access denied for user 'vmailuser'@'localhost' (using password: YES) - waiting for 5 seconds before retry
paź 23 11:37:42 silo dovecot[351]: auth-worker(930): Error: mysql(/run/mysqld/mysqld.sock): Connect failed to database (vmailserver):
Access denied for user 'vmailuser'@'localhost' (using password: YES) - waiting for 5 seconds before retry

The problem is that vmailuser was granted all permissions on that database.

Just in case i'm posting my my.cnf file:

[client]
port	= 3306
socket	= /run/mysqld/mysqld.sock

[mysqld]
port	= 3306
socket = /run/mysqld/mysqld.sock
skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
bind-address = localhost
log-bin=mysql-bin
binlog_format=mixed
server-id	= 1

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash

[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

i'll be googling hard for a solution, but if you can give me any insight on this - please do so.

EDIT:
journal was to long, so i wrapped it

Last edited by robug (2013-11-17 11:42:22)

Offline

#2 2013-11-17 20:52:09

mixer
Member
Registered: 2013-08-16
Posts: 47

Re: postfix+dovecot mail server with virtual users - login problem

How many virtual users do you have?  It may be easier to use btree files instead of a MySQL database.

Offline

#3 2013-11-17 22:21:21

robug
Member
Registered: 2010-11-17
Posts: 28

Re: postfix+dovecot mail server with virtual users - login problem

thank you for your reply.

there are 18 virtual users in total

i tested the connection with

postmap -q email1@example.com mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf

as the guide suggested (of course it was edited to match my settings) and it was a success.
i think that the problem lies somewhere between the client and mysql on the server, but i can't pinpoint it.

all computers connecting to the mail server use ms outlook as their mail client.
all relevant ports are unlocked in iptables

Offline

Board footer

Powered by FluxBB