?
Solved

qmail configuration in plesk 8.6 Redhat Enterprise Linux - x86_64 - OS ES 5.0

Posted on 2009-02-22
10
Medium Priority
?
1,057 Views
Last Modified: 2013-12-06
I need help configuring qmail to send email from php scripts in my server
0
Comment
Question by:Jorge Batres
  • 4
  • 3
8 Comments
 
LVL 23

Expert Comment

by:Maciej S
ID: 23711659
I don't use qmail, but please provide some informations from your logfiles. Maybe there is some general rule which can be applied to solve your problem.
What is the way you are trying to send your emails (pasting your code can be helpful). Are there any error messages in your mail log?
0
 
LVL 51

Expert Comment

by:Steve Bink
ID: 23712957
You do not need to specifically set up qmail for PHP.  As long as the qmail installation is working, PHP will use.  The mail() function calls the system's sendmail executable, which should be qmail's app.
0
 

Author Comment

by:Jorge Batres
ID: 23713679
Ok I should be more specific, sorry. My scripts were working fine as far as sending email from my old server which used sendmail, and Ensim X Pro, but now I have migrated mi sites to a new server that uses plesk 8.6 and qmail, and now one of the scripts is having problem with the headers as far as not being properly set, here is an example of my header in hotmail:
"reservations@ (vacationpeople.com reservations@vacationpeople.com)  
 This message may be dangerous. Learn more
Sent: Mon 2/23/09 4:31 AM
To:  batres@msn.com; jorge.batres@gmail.com " and here is how it looks in gmail:
"fromVacationPeople. Com <VacationPeople.Com@web.vacationpeople.net>
tojorge.batres@gmail.com,
batres@msn.com

dateSun, Feb 22, 2009 at 8:02 PM
subjectOmni Hotel Cancun Confirmation"
the from should be: VacationPeople.Com <reservations@vacationpeople.com>
I tried to change tyhe line breaks in the script from \r\n\ to \n\ but that didn't worked either. attached is piece of code that I tried to modified and it didn't work so aI revered it back to what it was before.
case "send_notify":
                        
                        $head = "MIME-Version: 1.0\r\n".
                        				"Content-type: text/html; charset=iso-8859-1\r\n".
							"Return-Path: ".$_POST['from']." <".$_POST['from'].">\r\n".
                               				"From: ".$_POST['from']." <".$_POST['from'].">\r\n".
                        				"Date: ".date("r")."\r\n";
                	//include_once(LEVEL."inc/emailer/emailer.php");
                        //Send($_POST['from'],$_POST['to'],$_POST['subject'],$_POST['content']);
		     	mail($_POST['to'], $_POST['subject'], $_POST['content'],$head, "-f " . $_POST['from']);
                        break;
                case "send_change_status":
                        
                        $head = "MIME-Version: 1.0\r\n".
                        				"Content-type: text/html; charset=iso-8859-1\r\n".
							"Return-Path: ".$_POST['from']." <".$_POST['from'].">\r\n".
                               				"From: ".$_POST['from']." <".$_POST['from'].">\r\n".
                        				"Date: ".date("r")."\r\n";
                	//include_once(LEVEL."inc/emailer/emailer.php");
                        //Send($_POST['from'],$_POST['to'],$_POST['subject'],$_POST['content']);
		     	mail($_POST['to'], $_POST['subject'], $_POST['content'],$head, "-f " . $_POST['from']);
                        break;

Open in new window

0
Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

 
LVL 51

Accepted Solution

by:
Steve Bink earned 2000 total points
ID: 23717882
From what I know of qmail, the problems with your headers are probably coming from another source.  It could be Plesk getting in the way (it tends to take over things that you don't want taken over).  If the qmail installation has any add-ons installed, it could be worth looking at what they do.  In any case, I have a few suggestions for you:

1) Use an email class.  I use HTMLMimeMail, though I understand PHPMailer is popular.  A quick google of either will yield a downloadable class that should be pretty simple to integrate into your application.  This would standardize email sent from your code, thus removing one possible source of problems.  I see that you commented out an emailer class...any reason?

2) Try removing the -f parameter from the mail() function.  You are setting the From: header, which should suffice.

3) The code you posted shows no verification/validation of the $_POST data.  How do you ensure this is good data?

4) Have you tried checking the message as it hits the queue?  This would help determine if the header issue is originating with the outbound server or if the message is being modified in transit.  I would definitely try to capture this data as the next step in troubleshooting.
0
 

Author Comment

by:Jorge Batres
ID: 23728418
Thank you very much routinet, I'll try to install HTMLMimeMail and I would let you know what happens.
Thanks again,
Jorge Batres
0
 

Author Comment

by:Jorge Batres
ID: 23837679
Thank you every one, I have resolved the issue by installing HTMLMimeMail  as suggested by routinet. Thanks again. P.s. routinet, I tried to contact you to the email in your profile but I couldn't get through.
0
 

Author Closing Comment

by:Jorge Batres
ID: 31549859
I guess the arised from upgrading php 4 to php5 and from sendmail to qmail but your suggestion defiinitelly worked. Thanks again.
0
 
LVL 51

Expert Comment

by:Steve Bink
ID: 23843097
I'm happy to hear that worked for you.  HTMLMimeMail is a pretty good package.  I done some of my own customizations on the copy I use, but it does the job even with an as-is download.

My email is just my nick at the domain.  The rest of the 'name' that you see in my profile is a distraction.  If you did send to that email and just didn't get a response, it was probably sent to my junk mail because I did not recognize the incoming address.  Try again with a reference to EE in the subject and I'll be able to pick it out.

Good luck!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
I have written articles previously comparing SARDU and YUMI.  I also included a couple of lines about Easy2boot (easy2boot.com).  I have now been using, and enjoying easy2boot as my sole multiboot utility for some years and realize that it deserves …
To show how to generate a certificate request in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Servers >> Certificates…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Suggested Courses
Course of the Month17 days, 11 hours left to enroll

830 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