HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (
-   HOWTO-Related Questions (
-   -   Virtual Users And Domains With Postfix, Courier And MySQL (

triak 13th January 2006 08:19

Virtual Users And Domains With Postfix, Courier And MySQL
Hi guys.
I just joined your forum cause I'm stuck really bad :)
I have been following the HowTo that falco posted here and trying to setup a mailserver for my friends business. I made some minor adjustments to the setup so that mysql-server is not on localhost, but a completly different computer (we need it for other puposes too). My problem is that amavis is sending the wrong usename to the mysql server an cannot authenticate.
Here's a clip from the mail.log:

Jan 13 08:08:10 mail amavis[5735]: (05735-05) connect_to_sql: unable to connect to DSN 'DBI:mysql:database=mail;host=;port=330 6': Access denied for user: '' (Using password: YES)

And in amavis.conf it clearly says:

@lookup_sql_dsn =
( ['DBI:mysql:database=mail;host=;port=330 6', 'mail_admin', 'somepassord'] );

What must I do so that amavis would send only the usename part and not username@fqdn? I think this is related with me using a external sql server.
Any help is greatly appreciated.

till 13th January 2006 13:01

This problem is related to your mySQL permissions.

"Access denied for user: '' " means that the access was denied for user mail_admin that connects from the host

You must change the permissions on your mySQL server that the user mail_admin is allowed to connect from and not only from localhost. Then reload the mysql server. If that wont help, you can try to allow connections from every host, that means to set host to "%" in the mysql permission tables.

triak 14th January 2006 16:14

Changed the permissions, but problem persists
I am still getting the same error in mail.log complaining that amavis cannot connet to the mysql server. If I connect using mysql client I can access the server
mail:/etc/postfix# mysql -h -u mail_admin -p

So if this works, why cannot amavis connect using exactly the same user/password?

Is there a way to trace the problem?

Thanks in adw.


till 14th January 2006 18:19

In your connect string is:


port=330 6
but it must be:



triak 14th January 2006 22:14

It's working!!! whee :=)
I got it!

I have the correct port. Somehow my opera and this forum does not work togeather and it keeps dropping letters from my posts.

The autentication problem was gone when I changed mail_admin to mailadmin
Now everyting works like a charm.

What about local users, such as me, postmaster etc. How do I add a local alias map so that theese users allso can recive mail?
I think they don't have to use mysql, am I right?

tia: Johannes

All times are GMT +2. The time now is 23:31.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.