HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   HOWTO-Related Questions (http://www.howtoforge.com/forums/forumdisplay.php?f=2)
-   -   postfix trying to use root to log onto mysql (http://www.howtoforge.com/forums/showthread.php?t=56517)

mattgrannary 12th March 2012 19:18

postfix trying to use root to log onto mysql
 
I've been trying to set up a mail server on a rackspace CentOS 6 cloud server for the past couple days. I've followed your tutorial to a tee with the exception that I didn't compile a new postfix with quota as I don't need a quota system.

Everything seemed to install perfectly, I did have to install some extra packages that weren't listed. But everything seemed to go well.

The issue I'm having is that I'm not able to send any mail (I haven't even tried receiving yet..). After looking at the maillog I can see that postfix gives me the error:

postfix/cleanup[31896]: warning: connect to mysql server 127.0.0.1: Access denied for user 'root'@'localhost' (using password: YES)

So, I'm guessing that postfix isn't using the .cf files I created with the proper user and password. I've triple checked all the files. The permissions are set properly, the vmail user is correct, mysql lets me log in with the mailadmin user and password, the aliases are set as you've listed, I can telnet to the smtp post and the pop3 port...

Any ideas?

falko 13th March 2012 17:01

Are you sure you use the correct username in your mysql*.cf files?

mattgrannary 13th March 2012 21:35

Yes.

I've created a user called mailadmin and granted the proper privileges to the mail database. Just did a full check on the users privileges and logged in as that user and performed some basic SELECT queries and was successful.

falko 14th March 2012 19:34

The MySQL errors that you get in your mail log - are these current errors or old ones?

mattgrannary 14th March 2012 21:52

These are new ones. I've emptied the file and started fresh. The error is reported after I initiate a call to mailx. The log then is appended with these errors:

Code:

Mar 14 20:50:21 mgcloud postfix/pickup[24159]: 320547EA2C: uid=0 from=<root>
Mar 14 20:50:21 mgcloud postfix/cleanup[24333]: 320547EA2C: message-id=<20120314205021.320547EA2C@stumblecloud.stumbleabroad.com>
Mar 14 20:50:21 mgcloud postfix/qmgr[24160]: 320547EA2C: from=<root@stumbleabroad.com>, size=465, nrcpt=1 (queue active)
Mar 14 20:50:22 mgcloud postfix/smtpd[24166]: 0ED037E9A3: client=unknown[127.0.0.1]
Mar 14 20:50:22 mgcloud postfix/cleanup[24333]: warning: connect to mysql server 127.0.0.1: Access denied for user 'root'@'localhost' (using password: YES)
Mar 14 20:50:22 mgcloud postfix/cleanup[24333]: warning: 0ED037E9A3: virtual_alias_maps map lookup problem for matty@ignitedcreations.com
Mar 14 20:50:22 mgcloud amavis[22713]: (22713-02) Negative SMTP response to data-dot (<matty@ignitedcreations.com>): 451 4.3.0 Error: queue file write error
Mar 14 20:50:22 mgcloud amavis[22713]: (22713-02) (!)FWD via SMTP: <root@stumbleabroad.com> -> <matty@ignitedcreations.com>,BODY=7BIT 451 4.3.0 TempFailed, id=22713-02, from MTA([127.0.0.1]:10025): 451 4.3.0 Error: queue file write error
Mar 14 20:50:22 mgcloud postfix/cleanup[24333]: warning: 109FF7E9A3: virtual_alias_maps map lookup problem for postmaster@stumbleabroad.com
Mar 14 20:50:22 mgcloud postfix/smtpd[24166]: disconnect from unknown[127.0.0.1]
Mar 14 20:50:22 mgcloud amavis[22713]: (22713-02) Blocked MTA-BLOCKED, <root@stumbleabroad.com> -> <matty@ignitedcreations.com>, Message-ID: <20120314205021.320547EA2C@stumblecloud.stumbleabroad.com>, mail_id: h1+zXapomosw, Hits: -0.001, size: 465, 841 ms
Mar 14 20:50:22 mgcloud postfix/smtp[24335]: 320547EA2C: to=<matty@ignitedcreations.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.89, delays=0.04/0.01/0/0.84, dsn=4.3.0, status=deferred (host 127.0.0.1[127.0.0.1] said: 451 4.3.0 TempFailed, id=22713-02, from MTA([127.0.0.1]:10025): 451 4.3.0 Error: queue file write error (in reply to end of DATA command))


falko 15th March 2012 18:48

Did you disable SELinux?

mattgrannary 15th March 2012 18:53

I don't think so, I'm not even sure this was enabled. Is there a way to check?

TiTex 15th March 2012 21:02

try one of these
Code:

getenforce
sestatus


mattgrannary 15th March 2012 21:13

Ya, just tried that out and it says that it's disabled. Do I need to enable Selinux to use postfix, courier-imap with mysql?

mattgrannary 15th March 2012 21:20

ok, I just enabled Selinux and rebooted. I tried the mailx command again and this time postfix tried to log on as a different user (postfix)

Here is the new error:

Code:

postfix/cleanup[1848]: warning: connect to mysql server 127.0.0.1: Access denied for user 'postfix'@'localhost' (using password: YES)


All times are GMT +2. The time now is 10:05.

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