Solved

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

Posted on 2014-12-21
11
252 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
  • 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
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 

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 500 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Suggested Solutions

Title # Comments Views Activity
VMware Tools Install On Linux Problem 3 80
ignore other .htaccess 2 58
AWS EC2 HTTP & HTTPS 2 44
LINUX Field Separators 7 31
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
In this Experts Exchange video Micro Tutorial, I'm going to show how small business owners who use Google Apps can save money by setting up what is called a catch-all email address in their Gmail accounts. By using the catch-all feature, small busin…

791 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