Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Qmail and PHP mail fails. Qmail runs fine - how to debug ?!
We have a problem on a running Qmail server on FreeBSD 5.2.1
The qmail server runs fine, even with mail injects from the command
prompt.  (see below)

We compiled PHP 4.3.9 with most options, however we are not quite sure
we may use --enable-sockets on FreeBSD ? PHP runs on apache 1.3.x
and it runs php scripts.

Additionally when we invoke a testmail.php the page does NOT show up
and it loops (continue running) in the browser.  How can we verify
what it's doing ?  We can't see anything in the logs, as there are no
established connections due to intern use of the qmail-inject
function.

We saw similar problems of this.  We want to known the reason of
the loop.

Thanks.

Further details:

We have a running qmail server running on *:25
The mailserver succesfull sends mail from our LAN as from localhost.
Additionally, to be sure, we checked on the command prompt in  this
way : cat test.eml | /var/qmail/bin/qmail-inject

# test.eml
Message-ID: <802973227.20041027110037@person.be>
Date: Wed, 27 Oct 2004 11:00:37 +0200
From: Me <me@here.loc>
To: root
Subject: Lokale test

Mail is received succesfull.

2) We wrote a test.php to have info on PHP 4.3.9
<?
phpinfo();
?>

#Which delivers:

Configure Command:
'./configure' '--prefix=/usr/local' '--enable-bcmath'
'--enable-calendar' '--enable-cli' '--enable-ctype' '--enable-dba'
'--enable-dbx' '--enable-dio' '--enable-exif'
'--enable-fast-install=yes' '--enable-ftp' '--enable-magic-quotes'
'--enable-memory-limit' '--enable-overload' '--enable-posix'
'--enable-session' '--enable-shared=yes' '--enable-short-tags'
'--enable-sockets' '--enable-static=yes' '--enable-tokenizer'
'--enable-versioning' '--enable-xslt' '--enable-xml' '--enable-yp'
'--enable-wddx' '--disable-debug' '--disable-ipv6'
'--with-curl=/usr/local' '--with-expat-dir=/usr/local'
'--with-freetype-dir=/usr/local' '--with-gettext=/usr/local'
'--with-gd' '--enable-gd-native-ttf' '--enable-gd-jis-conv'
'--with-apache=/usr/local/src/apache_1.3.31' '--with-bz2=/usr/local'
'--with-config-file-path=/usr/local/etc' '--with-crack=/usr/local'
'--with-dom=/usr/local' '--with-dom-xslt=/usr/local'
'--with-dom-exslt=/usr/local' '--with-gettext=/usr/local'
'--with-iconv=/usr/local' '--with-jpeg-dir=/usr/local'
'--with-layout=GNU' '--with-ldap=/usr/local'
'--with-mcrypt=/usr/local'
'--with-mime-magic=/usr/share/misc/magic.mime'
'--with-ming=/usr/local' '--with-mysql=/usr/local'
'--with-mysql-sock=/tmp' '--with-openssl=/usr/local'
'--with-openssl-dir=/usr/local' '--with-pear=/usr/local/lib/php'
'--with-pcre-regex=yes' '--with-pgsql=/usr/local'
'--with-png-dir=/usr/local' '--with-pspell=/usr/local'
'--with-regex=php' '--with-t1lib=/usr/local'
'--with-tiff-dir=/usr/local' '--with-tsrm-pthreads'
'--with-unixODBC=/usr/local' '--with-xmlrpc'
'--with-xpm-dir=/usr/local' '--with-xslt-sablot=/usr/local'
'--with-zip=/usr/local' '--with-zlib=yes' '--with-zlib-dir=/usr'
'i586-jurgys-freebsd5.2.1'

sendmail_path:	/var/qmail/bin/qmail-inject

3) We wrote a test script to send mail

#testmail.php
<?
error_reporting(E_ALL);
$result = mail("me@here.loc", "Subjet", "Test mail");
if ( $result )
{
echo("Sent");
}
else
{
echo ("Error");
}
?>

--

\I/
/(@ @)\  Greetings from Jurgy
---o00-(_)-00o--------------------
--

\I/
/(@ @)\  Greetings from CyBy
---o00-(_)-00o--------------------

Report this thread to moderator Post Follow-up to this message
Old Post
Jurgy
10-29-04 01:55 PM


Re: Qmail and PHP mail fails. Qmail runs fine - how to debug ?!
Hello,

On 10/29/2004 06:56 AM, Jurgy wrote:
> We have a problem on a running Qmail server on FreeBSD 5.2.1
> The qmail server runs fine, even with mail injects from the command
> prompt.  (see below)
>
> We compiled PHP 4.3.9 with most options, however we are not quite sure
> we may use --enable-sockets on FreeBSD ? PHP runs on apache 1.3.x
> and it runs php scripts.
>
> Additionally when we invoke a testmail.php the page does NOT show up
> and it loops (continue running) in the browser.  How can we verify
> what it's doing ?  We can't see anything in the logs, as there are no
> established connections due to intern use of the qmail-inject
> function.
>
> We saw similar problems of this.  We want to known the reason of
> the loop.

You may want try this class that comes with a sub-class specialized in
deliverying via Qmail using qmail-inject. Just let me know if you still
have problems:

http://www.phpclasses.org/mimemessage


--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

Report this thread to moderator Post Follow-up to this message
Old Post
Manuel Lemos
10-29-04 08:55 PM


Re: Qmail and PHP mail fails. Qmail runs fine - how to debug ?!
On Fri, 29 Oct 2004 14:48:13 -0300, Manuel Lemos <mlemos@acm.org>
wrote:

>Hello,
>
>On 10/29/2004 06:56 AM, Jurgy wrote: 
>
>You may want try this class that comes with a sub-class specialized in
>deliverying via Qmail using qmail-inject. Just let me know if you still
>have problems:
>
>http://www.phpclasses.org/mimemessage

Yes I known this class, and I will see if i can embed it.

However I want to known the source of the problem or I need to update
a whole bunch of scripts.  I can sent mail from one system with the
same script and I can't do it on the testing server for some reason,
and I want to find out the source of the problem.
--

\I/
/(@ @)\  Greetings from CyBy
---o00-(_)-00o--------------------

Report this thread to moderator Post Follow-up to this message
Old Post
Jurgy
10-29-04 08:56 PM


Re: Qmail and PHP mail fails. Qmail runs fine - how to debug ?!
Hello,

On 10/29/2004 02:55 PM, Jurgy wrote: 
>
>
> Yes I known this class, and I will see if i can embed it.
>
> However I want to known the source of the problem or I need to update
> a whole bunch of scripts.  I can sent mail from one system with the
> same script and I can't do it on the testing server for some reason,
> and I want to find out the source of the problem.

If there is a queueing error, the class will return that error. I am
afraid that the mail() function may just ignore that. So, just try the
class and tell me what happens.

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

Report this thread to moderator Post Follow-up to this message
Old Post
Manuel Lemos
10-29-04 08:56 PM


Re: Qmail and PHP mail fails. Qmail runs fine - how to debug ?!
On Fri, 29 Oct 2004 15:04:40 -0300, Manuel Lemos <mlemos@acm.org>
wrote:

>Hello,
>
>On 10/29/2004 02:55 PM, Jurgy wrote: 
>
>If there is a queueing error, the class will return that error. I am
>afraid that the mail() function may just ignore that. So, just try the
>class and tell me what happens.

Ok, I took Your class from PHP classes which is indeed  nice written.

a) I deinstalled the whole bunch of PHP 4.3.9 with:
pkg_delete -x "php4*"
pkg_delete -x "pecl-*"
rm -d -r /usr/local/lib/php

b) Because I would use some php 5 stuff, I installed PHP, but only the
core from FreeBSD port systems:

cd /usr/ports/lang/php5
make WITH_APACHE=yes PHP_SAPI=full
make WITH_APACHE=yes  PHP_SAPI=full install

I copied php.ini-dist to php.ini
and i change

;sendmail_path

into

sendmail_path = /var/qmail/bin/qmail-inject

I write a test.php file with
<?
phpinfo();
?>


c) Some verification of PHP:

# php -v
PHP 5.0.2 (cli) (built: Oct 31 2004 11:12:24) (DEBUG)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.2, Copyright (c) 1998-2004 Zend Technologies

(Ok next time i try WITH_DEBUG=no)

#php -m
[PHP Modules]
libxml
SPL
Standard

#php -f test.php | grep sendmail_path
sendmail_path => /var/qmail/bin/qmail-inject =>
/var/qmail/bin/qmail-inject

(Ok, seems OK)

d) Some verification of my Qmail server
I create a test.eml file with:

<snip>
Message-ID: <802973227.20041027110037@person.be>
Date: Wed, 27 Oct 2004 11:00:37 +0200
From: me <me@mydomain.loc>
To: me2@mydomain.loc
Subject: Lokale test

Helleuu.
</snip>

I test Qmail from shell with:
cat test.eml | /var/qmail/bin/qmail-inject      (works)

e) Your classes to sent mail :
http://www.phpclasses.org/browse/pa...-1
1.zip

I installed those files from Your source:
* email_message.php
* qmail_mail.php
* qmail_message.php
* test_qmail_mail.php

I changed the test_qmail_mail.php with me and me2
And here we go....

#php -f test_qmail_mail.php

Same results, the mail hangs and sits waiting.
No core dumped, it just runs and waits...

What I saw, in the To field i tried to mail a local user.  This errors
comes (which should be more in detail) :

Error: the additional parameters that were specified are not supported

So I presume You need to enter a FULL email.  However there are
such possibilities as user,user+, &user for local users !!!
besides user@FQDN

Anyway this does not solve my problem.  So my opinion, php tries to
use the qmail server and waits to have access to it.  qmail-inject can
be executed by others, so I don't see the problem.  I think it can't
connect, but I use internal mail injects.  :-/

So what next ?

--

\I/
/(@ @)\  Greetings from CyBy
---o00-(_)-00o--------------------

Report this thread to moderator Post Follow-up to this message
Old Post
Jurgy
10-31-04 01:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Language archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:23 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.