Author Topic: Postfix: Can't add email account  (Read 6178 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Postfix: Can't add email account
« on: December 13, 2014, 01:11:19 PM »
Hello,

I got an error below after completely installing CWP on my server.

I have do searching for many error encountered that problems, but no clue to solve it now.

and there's no file as mention here: /usr/local/cwpsrv/htdocs/admin/include/postfix.php

Quote
Warning: mysql_connect(): Access denied for user 'postfix'@'localhost' (using password: YES) in /usr/local/cwpsrv/htdocs/resources/admin/modules/mail_add-new.php(1) : eval()'d code(1) : eval()'d code on line 2

Warning: mysql_select_db() expects parameter 2 to be resource, boolean given in /usr/local/cwpsrv/htdocs/resources/admin/modules/mail_add-new.php(1) : eval()'d code(1) : eval()'d code on line 2
Could not connect to database postfix check configuration file: /usr/local/cwpsrv/htdocs/admin/include/postfix.php
thank you

Offline
*
Re: Postfix: Can't add email account
« Reply #1 on: December 15, 2014, 02:08:40 AM »
this error is because you don't have that file, have you installed CWP on the clean CentOS server minimal?
AntiDDoS Protection (web + mail)
http://centos-webpanel.com/website-ddos-protection-proxy

Join our Development Team and get paid !
http://centos-webpanel.com/develope-modules-for-cwp


Services Monitoring & RBL Monitoring
http://centos-webpanel.com/services-monitor


Do you need Fast and FREE Support included for your CWP linux server?
http://centos-webpanel.com/noc-partner-list
Installation Instructions
http://centos-webpanel.com/installation-instructions
Get Fast Support Here
http://centos-webpanel.com/support-services

Offline
*
Re: Postfix: Can't add email account
« Reply #2 on: January 05, 2015, 03:40:43 AM »
this error is because you don't have that file, have you installed CWP on the clean CentOS server minimal?

hello admin,

Yes, sadly, the main problem: because CWP installed on existing server, not the clean one :(

I try to browse spesificly through the CWP script installation and found the mail server steps didn't work correctly. So, I've checked it and have done my own setup based on my server configuration before. It solved.

After that, I installed CWP in clean VM server, I found no error at all.

Thanks


Offline
*
Re: Postfix: Can't add email account
« Reply #3 on: February 26, 2015, 10:24:34 AM »
They have changed the postfix's config location to

Quote
/usr/local/cwpsrv/htdocs/resources/admin/include/postfix.php

Offline
*
Re: Postfix: Can't add email account
« Reply #4 on: March 23, 2016, 10:44:35 AM »
Hello all,

I managed to fix my problem with changing password for user postfix in mysql.

remember that you can;t change the file /usr/local/cwpsrv/htdocs/resources/admin/include/postfix.php, so just copy the password :)

so here are the steps:

login to server via SSH,

[root@yourserver~]#mysql

SET PASSWORD FOR 'postfix'@'localhost' = PASSWORD('YOURPASSWORD');

[root@yourserver~]#service mysqld restart

this is it
enjoy

Offline
*
Re: Postfix: Can't add email account
« Reply #5 on: March 23, 2016, 11:07:52 AM »
Hi valivarona

Thanks for providing a resolution on this fix however I've not really used a SSH service before and a little worried I mess things up.

I have installed Putty to access the Root to server and can login as the root user however after that I'mm completely lost. I tried what you had put but got a message SET: command not found.

Would you please be so kind as to provide an idiots guide to correcting this as I would really like to create an email address with my domain rather than use gmail or yahoo mail.

Thanks in advance

Offline
*
Re: Postfix: Can't add email account
« Reply #6 on: March 23, 2016, 12:22:40 PM »
Hello @Moonshine

1. Login into your server via SSH.

2. nano /usr/local/cwpsrv/htdocs/resources/admin/include/postfix.php

Code: [Select]
?php

        /* MySQL hostname [ localhost (127.0.0.1 via TCP/IP) ] */
        $db_host_postfix = "localhost";

        /* The name of the database */
        $db_name_postfix = "postfix";

        /* MySQL database username */
        $db_user_postfix = "postfix";

        /* MySQL database password */
        $db_pass_postfix = 'YOUR_PASWORD';

?>


3. copy your password

4. enter mysql
Code: [Select]
[root@yourserver~]#mysql
it should look like this
Code: [Select]
[root@your_server ~]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1472
Server version: 5.5.48 MySQL Community Server (GPL) by Remi

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

5. change postfix password
 
Code: [Select]
SET PASSWORD FOR 'postfix'@'localhost' = PASSWORD('YOUR_PASSWORD');
6. exit mysql
Code: [Select]
mysql> Ctrl-C -- exit!
Aborted

7. restart mysql
Code: [Select]
[root@yourserver~]#service mysqld restart

also you can try to reboot your server.

hope this helps.
« Last Edit: March 23, 2016, 12:24:28 PM by valivarona »

Offline
*
Re: Postfix: Can't add email account
« Reply #7 on: March 23, 2016, 01:04:39 PM »
Hi @Valivarona

Thanks for the quick response. I tried what you had writen and I did get the information regarding the post pasword etc however when typing in "[root@yourserver~]#mysql" nothing else happened at all.

Not sure if I did it right to be honest.

The actual error message I get is

Warning: mysql_connect(): Access denied for user 'postfix'@'localhost' (using password: YES) in /usr/local/cwpsrv/htdocs/resources/admin/modules/mail_list.php(1) : eval()'d code(1) : eval()'d code on line 2

Warning: mysql_select_db() expects parameter 2 to be resource, boolean given in /usr/local/cwpsrv/htdocs/resources/admin/modules/mail_list.php(1) : eval()'d code(1) : eval()'d code on line 2
Could not connect to database postfix check configuration file: /usr/local/cwpsrv/htdocs/admin/include/postfix.php

Thanks again
Moonshine


Offline
*
Re: Postfix: Can't add email account
« Reply #8 on: March 24, 2016, 12:59:00 AM »
you need to type in only "mysql" when  you login as root on the server and then following two commands
Code: [Select]
mysql
SET NEW PASSWORD
Code: [Select]
SET PASSWORD FOR 'postfix'@'localhost' = PASSWORD('YOUR_PASSWORD');
ACCEPT NEW Changes
Code: [Select]
flush privileges
AntiDDoS Protection (web + mail)
http://centos-webpanel.com/website-ddos-protection-proxy

Join our Development Team and get paid !
http://centos-webpanel.com/develope-modules-for-cwp


Services Monitoring & RBL Monitoring
http://centos-webpanel.com/services-monitor


Do you need Fast and FREE Support included for your CWP linux server?
http://centos-webpanel.com/noc-partner-list
Installation Instructions
http://centos-webpanel.com/installation-instructions
Get Fast Support Here
http://centos-webpanel.com/support-services

Offline
**
Re: Postfix: Can't add email account
« Reply #9 on: March 27, 2017, 06:10:25 AM »
After an auto-update of CWP, I dont know what is the reason I lost the user postfix in mysql

This is how i fixed it, run this SQL as root

GRANT ALL PRIVILEGES ON postfix.* TO 'postfix'@'localhost' IDENTIFIED BY 'YOUR_PASSWORD' WITH GRANT OPTION;

Then, the configuration of postfix file was also changed its location, we need to copy from old location and put it back in right place

Quote
sudo chattr -i /usr/local/cwpsrv/htdocs/admin
mkdir /usr/local/cwpsrv/htdocs/admin/include/
mv /usr/local/cwpsrv/htdocs/resources/admin/include/postfix.php /usr/local/cwpsrv/htdocs/admin/include/postfix.php
nano /usr/local/cwpsrv/htdocs/admin/include/postfix.php

put your new password in the file

Offline
*
Re: Postfix: Can't add email account
« Reply #10 on: May 14, 2017, 07:16:45 PM »
Hi valivarona

Thanks for providing a resolution on this fix however I've not really used a SSH service before and a little worried I mess things up.

I have installed Putty to access the Root to server and can login as the root user however after that I'mm completely lost. I tried what you had put but got a message SET: command not found.

Would you please be so kind as to provide an idiots guide to correcting this as I would really like to create an email address with my domain rather than use gmail or yahoo mail.

Thanks in advance

made my Sunday !!!!!

Thanks

Offline
*
Re: Postfix: Can't add email account
« Reply #11 on: July 27, 2017, 09:45:56 AM »
I still can't get my email working :( i already set it all up and the last error was

Quote
2017/07/27 16:19:54 [error] 1685#0: *13921 FastCGI sent in stderr: "PHP message: PHP Warning:  [obfuscated]() expects exactly 1 parameter, 0 given in /usr/local/cwpsrv/htdocs/resources/admin/modules/mail_add-new.php on line 0
PHP message: PHP Warning:  [obfuscated]() expects exactly 1 parameter, 0 given in /usr/local/cwpsrv/htdocs/resources/admin/modules/mail_add-new.php on line 0" while reading upstream

Offline
*
Re: Postfix: Can't add email account
« Reply #12 on: July 27, 2017, 03:17:44 PM »
I still can't get my email working :( i already set it all up and the last error was

Quote
2017/07/27 16:19:54 [error] 1685#0: *13921 FastCGI sent in stderr: "PHP message: PHP Warning:  [obfuscated]() expects exactly 1 parameter, 0 given in /usr/local/cwpsrv/htdocs/resources/admin/modules/mail_add-new.php on line 0
PHP message: PHP Warning:  [obfuscated]() expects exactly 1 parameter, 0 given in /usr/local/cwpsrv/htdocs/resources/admin/modules/mail_add-new.php on line 0" while reading upstream

to create email account you need to have created account with domain which you can then use when creating new email address...if you dont have account then you can't create email address.
This is info if only if you postifx db admin user works properly and its set in all required locations.

If you need to set new user then  make sure that you use old username and password for database as otherwise you will need to change it on many locations, you can check your old user details in /etc/postifx/mysql-***.cf file
VPS & Dedicated server provider with included FREE Managed support for CWP.
http://www.studio4host.com/

*** Don't allow that your server or website is down, choose hosting provider with included expert managed support for your CWP.

Offline
*
Re: Postfix: Can't add email account
« Reply #13 on: July 28, 2017, 08:23:55 AM »
I still can't get my email working :( i already set it all up and the last error was

Quote
2017/07/27 16:19:54 [error] 1685#0: *13921 FastCGI sent in stderr: "PHP message: PHP Warning:  [obfuscated]() expects exactly 1 parameter, 0 given in /usr/local/cwpsrv/htdocs/resources/admin/modules/mail_add-new.php on line 0
PHP message: PHP Warning:  [obfuscated]() expects exactly 1 parameter, 0 given in /usr/local/cwpsrv/htdocs/resources/admin/modules/mail_add-new.php on line 0" while reading upstream

to create email account you need to have created account with domain which you can then use when creating new email address...if you dont have account then you can't create email address.
This is info if only if you postifx db admin user works properly and its set in all required locations.

If you need to set new user then  make sure that you use old username and password for database as otherwise you will need to change it on many locations, you can check your old user details in /etc/postifx/mysql-***.cf file

I already set things up , already have an account and the passwords to connect to mysql is correct.
But still the error persist.

Thank you in advance