[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Sending emails on PHP isn't working correctly (centos)

Posted on 2014-12-21
11
Medium Priority
?
276 Views
Last Modified: 2014-12-21
Hello, I've recently set up a new website http://minecraftcommunity.org/ and everything has worked so far exept the email sending trough php. If you for example try to register http://minecraftcommunity.org/register or contacting http://minecraftcommunity.org/register no emails are being sent away. And I do have configuered the php.ini correctly. So I wonder how to fix this issue.

php.ini
[mail function]
; For Win32 only.
; http://www.php.net/manual/en/mail.configuration.php#ini.smtp
SMTP = localhost
; http://www.php.net/manual/en/mail.configuration.php#ini.smtp-port
smtp_port = 25

; For Win32 only.
; http://www.php.net/manual/en/mail.configuration.php#ini.sendmail-from
sendmail_from = Mail@minecraftcommunity.org

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
; http://www.php.net/manual/en/mail.configuration.php#ini.sendmail-path
sendmail_path = /var/www/mail -t -i

; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =

; Add X-PHP-Originaiting-Script: that will include uid of the script followed by the filename
mail.add_x_header = On

; Log all mail() calls including the full path of the script, line #, to address and headers
mail.log = /var/www/error

Open in new window

0
Comment
Question by:johandrex
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
11 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 40511610
And what is in your error log?
Do you install Postfix?
0
 

Author Comment

by:johandrex
ID: 40511613
Is it required to have postfix when sending mail in php? Because postfix isn't startable for me.
0
 
LVL 58

Expert Comment

by:Gary
ID: 40511615
Whats in the logs?

When you installed Centos did you not install a GUI like ISPConfig?
0
Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

 

Author Comment

by:johandrex
ID: 40511623
--------------------- Postfix Begin ------------------------

        6   *Fatal:   General fatal
 
        2   Postfix start        
 
 
 
 **Unmatched Entries**
        1   Dec 19 20:24:14 ns331757 postfix/postfix-script[1198]: warning: not owned by postfix: /var/lib/postfix/./master.lock
        1   Dec 19 20:24:03 ns331757 postfix/postfix-script[864]: warning: not owned by postfix: /var/lib/postfix/./master.lock
 
 ---------------------- Postfix End -------------------------
0
 

Author Comment

by:johandrex
ID: 40511625
And when trying to send a email with sendmail
   ----- The following addresses had permanent fatal errors -----
<johannes.seldevall@telia.com>
    (reason: 553 <root@email.minecraftcommunity.org> unable to verify address)

   ----- Transcript of session follows -----
... while talking to mail.telia.com.:
>>> MAIL From:<root@email.minecraftcommunity.org> SIZE=781
<<< 553 <root@email.minecraftcommunity.org> unable to verify address
501 5.6.0 Data format error

--sBL9qUwS029173.1419155550/email.minecraftcommunity.org
Content-Type: message/delivery-status

Reporting-MTA: dns; email.minecraftcommunity.org
Received-From-MTA: DNS; email.minecraftcommunity.org
Arrival-Date: Sun, 21 Dec 2014 10:52:30 +0100

Final-Recipient: RFC822; johannes.seldevall@telia.com
Action: failed
Status: 5.1.3
Diagnostic-Code: SMTP; 553 <root@email.minecraftcommunity.org> unable to verify address
Last-Attempt-Date: Sun, 21 Dec 2014 10:52:30 +0100

--sBL9qUwS029173.1419155550/email.minecraftcommunity.org
Content-Type: message/rfc822

Return-Path: <root@email.minecraftcommunity.org>
Received: from email.minecraftcommunity.org (email.minecraftcommunity.org [127.0.0.1])
	by email.minecraftcommunity.org (8.14.4/8.14.4) with ESMTP id sBL9qUwS029171
	for <johannes.seldevall@telia.com>; Sun, 21 Dec 2014 10:52:30 +0100
Received: (from root@localhost)
	by email.minecraftcommunity.org (8.14.4/8.14.4/Submit) id sBL9qUkN029170
	for johannes.seldevall@telia.com; Sun, 21 Dec 2014 10:52:30 +0100
From: root <root@email.minecraftcommunity.org>
Message-Id: <201412210952.sBL9qUkN029170@email.minecraftcommunity.org>
Date: Sun, 21 Dec 2014 10:52:30 +0100
To: johannes.seldevall@telia.com
Subject: testing mail
User-Agent: Heirloom mailx 12.4 7/29/08
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

awd
d.

--sBL9qUwS029173.1419155550/email.minecraftcommunity.org--

Open in new window

0
 
LVL 58

Accepted Solution

by:
Gary earned 2000 total points
ID: 40511626
I meant your mail.log after trying to send an email.

The postfix error is a permissions issue
Try running
chown postfix.postfix -R /var/lib/postfix

Open in new window


And start postfix
0
 

Author Comment

by:johandrex
ID: 40511628
oh wow it worked haha
0
 

Author Comment

by:johandrex
ID: 40511629
I'll set up the postfix and check if it works now, thanks
0
 
LVL 58

Expert Comment

by:Gary
ID: 40511631
Your email is being rejected by the destination server.

In your PHP script specify a valid from address
0
 
LVL 58

Expert Comment

by:Gary
ID: 40511632
Then you can follow the instructions for the email routing in the previous question and your email shouldn't be rejected then.
0
 

Author Comment

by:johandrex
ID: 40511742
Thank you so much dude! Finally it's working!!!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Unified and professional email signatures help maintain a consistent company brand image to the outside world. This article shows how to create an email signature in Exchange Server 2010 using a transport rule and how to overcome native limitations …
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question