LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   CentOS php mail issues after restart and plesk control panel issue (http://www.linuxquestions.org/questions/linux-server-73/centos-php-mail-issues-after-restart-and-plesk-control-panel-issue-4175413675/)

AhMatt 06-27-2012 10:57 AM

CentOS php mail issues after restart and plesk control panel issue
 
Please see below the ticket I raised with our server providers (who were unable to provide any level of support because we changed our SSH port and upgraded PHP, months before the issue arose!)

"
- A colleague of mine changed the password for a mysql user (a custom user, not an important system user)
- The Plesk control panel was inaccessible, simply saying that there was a "PleskFatalException"
- After ringing technical support, an engineer restarted the server and fixed the Plesk control panel, allowing us access
- The control panel and mysql were now the only things working, as the server hadn't started up numerous services on reboot such as apache
- We manually started up the apache service, so that our websites were working but FTP and SSH were still unavailable.
- As apache hadn't started on the reboot, we thought that this may have occurred with other services - we enabled FTP and SSH after having to manually alter the firewall rules and restarted the server again.
- After this reboot everything was working, including the Control Panel, FTP, SSH, SQL and Apache. However, it became apparent that the PHP mail() function was no longer sending out emails (the code always has, and does work fine).
- After some testing I have found that the mail() function is returning success, and those emails are showing up when I log in to the server using SSH and use the command 'mailq'.
- When I run 'mailq' it does however report this error:
"postqueue: warning: Mail system is down -- accessing queue directly"
- I have researched this error and apparently this is an error generated by the 'postfix' service
"

As stated above, the emails processed by the PHP mail() function appear when i type 'mailq' but i get a postqueue warning. This issue stays apparent whether i set the sendmail_path php config to /usr/sbin/sendmail or /var/qmail/bin/sendmail - we were told that the server should be using Plesk and qmail, but the fact that we are getting postfix errors means they won't help.

Lack of knowledge = lack of required details in many cases. In which case, let me know what you'd need to know in order to help/provide us with any ideas.

Running 'service postfix stop' or 'service sendmail stop' both return "failed", /var/log/messages and maillog both stay empty or have nothing relevant in them.

'service sendmail status' returns stopped or "dead but subsys locked" - deleting lock and restarting service gets same result

'service postfix status' returns "master is stopped" ???


Any light that can be shed on this matter would be incredibly helpful as none of our websites are able to send confirmation emails etc

lithos 06-27-2012 11:56 AM

Quote:

Originally Posted by AhMatt (Post 4713396)
.....

- When I run 'mailq' it does however report this error:
"postqueue: warning: Mail system is down -- accessing queue directly"
- I have researched this error and apparently this is an error generated by the 'postfix' service
"

....

Running 'service postfix stop' or 'service sendmail stop' both return "failed", /var/log/messages and maillog both stay empty or have nothing relevant in them.

'service sendmail status' returns stopped or "dead but subsys locked" - deleting lock and restarting service gets same result

'service postfix status' returns "master is stopped" ???

It would help to restart Postfix
Code:

# service postfix restart
then you can watch if mail queue will get processed, otherwise you can
Code:

# postqueue -f
from postfix queue command

You can enable posftix at startup with:
Code:

# chkconfig --levels 235 postfix
Some postfix troubleshooters:
- Centos howto
- debugging
- CentOS configure Postfix

good luck

AhMatt 06-27-2012 12:01 PM

No luck
 
Thanks for the reply lithos, however I've tried those things and get the following.

Code:

~]# service postfix restart
Shutting down postfix:                                    [FAILED]
Starting postfix:                                          [  OK  ]

Code:

~]# postqueue -f
postqueue: fatal: Cannot flush mail queue - mail system is down

I've tried most of the common "fixes" so far, including deleting syslocks as mentioned in the previous post, force killing processes etc etc - I guess we're just really special?

lithos 06-27-2012 02:27 PM

what does your system show about default mta agent
Code:

# alternatives --display mta
If it's Sendmail, then all above was for nothing.

AhMatt 06-28-2012 05:27 AM

See output below. I assumed sendmail as that's PHP's default, but our provider said it should be using Plesk which uses qmail. Then when I did 'mailq' it threw an error which I was told got thrown by postfix - at this point there's so many options flying about I have no idea!

Code:

~]# alternatives --display mta
mta - status is manual.
 link currently points to /usr/sbin/sendmail.postfix
/usr/sbin/sendmail.sendmail - priority 90
 slave mta-pam: /etc/pam.d/smtp.sendmail
 slave mta-mailq: /usr/bin/mailq.sendmail
 slave mta-newaliases: /usr/bin/newaliases.sendmail
 slave mta-rmail: /usr/bin/rmail.sendmail
 slave mta-sendmail: /usr/lib/sendmail.sendmail
 slave mta-mailqman: /usr/share/man/man1/mailq.sendmail.1.gz
 slave mta-newaliasesman: /usr/share/man/man1/newaliases.sendmail.1.gz
 slave mta-aliasesman: /usr/share/man/man5/aliases.sendmail.5.gz
 slave mta-sendmailman: /usr/share/man/man8/sendmail.sendmail.8.gz
/var/qmail/bin/sendmail - priority 100
 slave mta-pam: (null)
 slave mta-mailq: (null)
 slave mta-newaliases: (null)
 slave mta-rmail: (null)
 slave mta-sendmail: (null)
 slave mta-mailqman: (null)
 slave mta-newaliasesman: (null)
 slave mta-aliasesman: (null)
 slave mta-sendmailman: (null)
/usr/sbin/sendmail.postfix - priority 30
 slave mta-pam: /etc/pam.d/smtp.postfix
 slave mta-mailq: /usr/bin/mailq.postfix
 slave mta-newaliases: /usr/bin/newaliases.postfix
 slave mta-rmail: /usr/bin/rmail.postfix
 slave mta-sendmail: /usr/lib/sendmail.postfix
 slave mta-mailqman: /usr/share/man/man1/mailq.postfix.1.gz
 slave mta-newaliasesman: /usr/share/man/man1/newaliases.postfix.1.gz
 slave mta-aliasesman: /usr/share/man/man5/aliases.postfix.5.gz
 slave mta-sendmailman: /usr/share/man/man1/sendmail.postfix.1.gz
Current `best' version is /var/qmail/bin/sendmail.


lithos 06-28-2012 07:18 AM

Quote:

Originally Posted by AhMatt (Post 4714003)
See output below. I assumed sendmail as that's PHP's default, but our provider said it should be using Plesk which uses qmail. Then when I did 'mailq' it threw an error which I was told got thrown by postfix - at this point there's so many options flying about I have no idea!

Code:

~]# alternatives --display mta
mta - status is manual.

Current `best' version is /var/qmail/bin/sendmail.


Darn, I have no idea about qmail, sorry.
From what I read here it's qmail who replaces sendmail,
so in my opinion it would need to restart sendmail instead of postfix.
Then it probably should send messages out ?.


Please, if any LQ users have any experience in Qmail, can you help out.

lithos 06-28-2012 07:51 AM

This might be interesting for Plesk panel.

good luck

AhMatt 06-28-2012 08:04 AM

Thanks for getting involved and trying to help - don't worry about not knowing qmail, I'll go through those links you've posted (thanks for posting them) and hopefully I'll get it sorted through those, or another user on the forum might help...


All times are GMT -5. The time now is 09:41 AM.