niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Apps » Qmail
PHP Mail() Issue?
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
Author Message
Charles Cazabon
*nix forums Guru


Joined: 08 Jan 2005
Posts: 805

PostPosted: Wed Jul 05, 2006 2:09 pm    Post subject: Re: PHP Mail() Issue? Reply with quote

alex@schnarff.com <alex@schnarff.com> wrote:
Quote:

I have Qmail installed and functional, and Perl has zero issues writing
to /usr/bin/sendmail (which is just a symlink to
/var/qmail/bin/sendmail) with a call such as 'open(MAIL,
"|/usr/bin/sendmail -t -i");',

Okay.

Quote:
including from scripts run by Apache. When I run phpinfo(), sendmail_path
is set to /var/qmail/bin/sendmail (though sendmail_from is blank). If I call
mail() from PHP, it returns success, and I see a message in my Qmail logs
that looks like it's almost sent the mail, but not quite:

@4000000044abc1e732265f0c info msg 20981: bytes 264 from
alex@schnarff.com> qp 27970 uid 67
@4000000044abc1e732ac966c end msg 20981

Actually, it did successfully process the message. The above logs indicate
the message had 0 recipients and therefore there was nothing more for qmail to
do.

How are you specifying the recipients of your message? The code and message
template you showed didn't show any.

Charles
--
--------------------------------------------------------------------------
Charles Cazabon <qmail@discworld.dyndns.org>
Read http://pyropus.ca/personal/writings/12-steps-to-qmail-list-bliss.html
My services include qmail consulting. See http://pyropus.ca/ for details.
--------------------------------------------------------------------------
Back to top
schnarff
*nix forums beginner


Joined: 21 Feb 2005
Posts: 3

PostPosted: Wed Jul 05, 2006 1:46 pm    Post subject: PHP Mail() Issue? Reply with quote

Hello All,

I apologize if this question has been asked before, but I've had zero
luck finding an answer, either in the archives or by regular ol'
Googling.

I have Qmail installed and functional, and Perl has zero issues writing
to /usr/bin/sendmail (which is just a symlink to
/var/qmail/bin/sendmail) with a call such as 'open(MAIL,
"|/usr/bin/sendmail -t -i");', including from scripts run by Apache.
When I run phpinfo(), sendmail_path is set to /var/qmail/bin/sendmail
(though sendmail_from is blank). If I call mail() from PHP, it returns
success, and I see a message in my Qmail logs that looks like it's
almost sent the mail, but not quite:

@4000000044abc1e732265f0c info msg 20981: bytes 264 from
<alex@schnarff.com> qp 27970 uid 67
@4000000044abc1e732ac966c end msg 20981

It's as if the message makes it to Qmail, but isn't being properly
processed. Seeing as how I've even set the From: address on the return
envelope, I don't understand what I'm doing wrong here; theoretically,
this should work.

Here's the PHP that sends the mail:

$subj = "Test PHP Mail";
$body = "This is an e-mail from PHP.";
$add_headers = "From: alex@schnarff.com\r\n";
$add_params = "-falex@schnarff.com";
if (mail($_POST['email-addr'], $subj, $body,
$add_headers, $add_params)) {
...

(Note that $_POST['email-addr'] is a known-valid email address -- I'm
just sending to myself at alex@schnarff.com).

Any thoughts?

Thanks,
Alex Kirk
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
The time now is Sat Nov 22, 2008 3:55 am | All times are GMT
navigation Forum index » Apps » Qmail
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Restricting postfix mail incoming only from Barracuda firewa gnewak Postfix 0 Thu Jul 03, 2008 12:57 am
No new posts Filtering internal mail and forwarding to another domain fmaa1 Postfix 0 Wed Apr 30, 2008 12:50 pm
No new posts problem with sending mail nuxia Postfix 0 Mon Apr 21, 2008 3:58 am
No new posts mail delivery to cyrus fails embedded Postfix 0 Mon Mar 03, 2008 2:43 pm
No new posts mail forwarding loop killersushi Postfix 0 Tue Jan 23, 2007 3:43 am

MySpace Images | Mortgages | Record Internet Radio with Tags | Cadillac | MPAA
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.2387s ][ Queries: 20 (0.1648s) ][ GZIP on - Debug on ]