so i'm completely new to both postfix and mysql. I'm following the wiki postfix article to a tee, but have had several issues. First, on step 2 of mysql configuration, I entered these command exactly:
CREATE TABLE `domains` ( `domain` varchar(50) NOT NULL default , PRIMARY KEY (`domain`), UNIQUE KEY `domain` (`domain`) ); CREATE TABLE `forwardings` ( `source` varchar(80) NOT NULL default , `destination` text NOT NULL, PRIMARY KEY (`source`) ); CREATE TABLE `users` ( `email` varchar(80) NOT NULL default , `password` varchar(20) NOT NULL default , `quota` varchar(20) NOT NULL default '20971520', `domain` varchar(255) NOT NULL default , UNIQUE KEY `email` (`email`) );
This gives me a syntax error. I tried adding '' (2 single quotes) after each "default" statement, and that made the commands work. But i'm not sure whether I should have done that or not.... ?
Then, I get to the step "Test Postfix" and of course it fails. System logs show this when I try to start postfix:
warning: connect to mysql server localhost: Access denied for user 'postfixuser'@'localhost' (using password: YES)
If i do a "mysql --user=postfixuser postfix" I get access denied. I followed every step in the article up to this point.
I'm not sure which config files might be helpful to post, so let me know which ones I should. Keep in mind I have never used postfix or mysql (apparently it's acually "mariadb"??)
EDIT: specifically, i've got 2 questions:
-in the 3 files for mysql_virtual_(domains, forwards, mailboxes), the user in the wiki is listed as "postfixuser". But at the beginning of the guide it says to check for the existence of user "postfix". So should the user in these 3 mysql files be "postfix" or "postfixuser"?
-does "virtualdomain.tld" need to be changed to my domain name that I purchased through a registrar, or does it need to stay as "virtualdomain.tld"?
Last edited by train_wreck (2013-06-16 02:31:18)
Regarding your default "", that is okay; and is wrong in the wiki so I'll correct that.
When the guide talks about "the postfix user" it refers to the 'postfix' system user, which has nothing to do with the 'postfixuser' in mysql. When you use the username 'postfixuser' in the cnf files; and also used that user in the GRANT command in mysql then you should be able to connect to mysql using that username. First; make sure your connection to mysql works okay by trying this:
mysql --user postfixuser -p
This will connect and actually ask for a password; you should get a mysql-client prompt then. Until that works; don't bother starting postfix because it won't work either. If it doesn't work; tell us what the error-message is.
And yes, the 'virtualdomain.tld' is a reference to the actual domain name you want to user for sending and receiving email
Thanks, that cleared that up. I've now got postfix up and running & can send/receive mail through "telnet localhost 25", but now am having a problem logging in to the courier-imap. I am telnetting to localhost imap, but even though I'm entering the same user/password that I entered in the "INSERT INTO 'users'" step, it's still giving me "NO Login failed".... grrr. The password contains some special characters (an ampersand, semicolon and exclamation mark), maybe courier can't handle these? EDIT: nevermind, hadn't started rpcbind. works now
Btw, there are a few other oddities in that postfix article. For example, the step 3 "Create a mysql user" says that "Note that the GRANT statements need to be executed after creating the tables in the next step." But the next step isn't to create a table.... the previous one is, maybe thats what its referring to?
Last edited by train_wreck (2013-06-16 16:05:10)