Sendmail not sending WAS email app i can use
jim lawrence
fedorajim at gmail.com
Mon Apr 25 13:52:07 UTC 2005
On 4/25/05, replies-lists-redhat at listmail.innovate.net
<replies-lists-redhat at listmail.innovate.net> wrote:
> you need to do some (simple) debugging to see what's going on.
>
> first, print out the variables that you're submitting to the mail()
> function to make certain that they are there, and valid. second,
> check the sendmail man page to find the commands necessary to check
> both "regular" mail queue and the submit queue to see if the messages
> are sitting there. third, look in your mail log to see if/what
> messages it may be giving if/when it gets a message from php.
>
> a properly formed php mail() function will submit the message to your
> MTA, which will process the message for delivery. you need to try to
> figure out where things are going wrong among these pieces.
>
>
> ---------- Original Message ----------
> > From: jim lawrence <fedorajim at gmail.com>
> > To: Alexander Dalloz <ad+lists at uni-x.org>, For users of Fedora Core
> releases <fedora-list at redhat.com>
> > Cc:
> > Date: Monday, April 25, 2005 08:23:09 AM -0400
> > Subject: Re: Sendmail not sending WAS email app i can use
> >
> > On 4/24/05, jim lawrence <fedorajim at gmail.com> wrote:
> >> On 4/24/05, Alexander Dalloz <ad+lists at uni-x.org> wrote:
> >> > Am So, den 24.04.2005 schrieb jim lawrence um 18:48:
> >> >
> >> > > > the set enforce 0 didn't make a difference
> >> > > Tried the above still nothing
> >> > >
> >> > > if my php script is executing where are the messages being
> >> > > sent? or logged?
> >> >
> >> > > Jim Lawrence
> >> >
> >> > /var/log/maillog is the log file Sendmail is logging into.
> >> > "mailq -v" may show messages queued because of trouble sending
> >> > them out? As SELinux isn't actually what is stopping you, you
> >> > should make use of PHP's error reporting to see where you made
> >> > faults in scripting.
> >> >
> >> > Alexander
> >> >
> >> > --
> >> > Alexander Dalloz | Enger, Germany | GPG http://pgp.mit.edu
> >> > 0xB366A773 legal statement: http://www.uni-x.org/legal.html
> >> > Fedora Core 2 GNU/Linux on Athlon with kernel 2.6.11-1.14_FC2smp
> >> > Serendipity 18:59:41 up 12 days, 15:40, load average: 0.21,
> >> > 0.30, 0.26
> >> >
> >> >
> >> >
> >> 01:09 PM[jim at jimsdesktop ~]$ sudo mailq -v
> >> /var/spool/mqueue is empty
> >> Total requests: 0
> >> 01:09 PM[jim at jimsdesktop ~]$
> >>
> >> The script is a generic one
> >> ************************************************* Start
> >> Script**************************
> >> <?php
> >>
> >> // your email address
> >> $youremail = "myemailaddress";
> >>
> >> // field validation, I changed this line, didn't make new variables
> >> here but you could if you wanted (this saves some memory :) )
> >> if (empty($_POST['email']) || empty($_POST['comments']) ||
> >> empty($_POST['name'])){
> >> print ("All fields are required! Please go back and try again.");
> >> }
> >>
> >> else {
> >>
> >> //new stuff :)
> >> $email = $_POST['email'];
> >> $name = $_POST['name'];
> >> $comments = $_POST['comments'];
> >> //end new stuff, you can use you own variables now
> >>
> >> // email validation
> >> if(!eregi('^([._a-z0-9-]+[._a-z0-9-]*)@(([a-z0-9-]+\.)*([a-z0-9-]+
> >> )(\.[a-z]{2,3})?)$', $email)) {
> >> print ("Your email address does not appear to be valid. Please go
> >> back and try again.");
> >> exit;
> >> }
> >>
> >> // send email
> >> $headers = "From: \"$name\" <$email>\n";
> >> $subject = "Feedback Form";
> >> $message = "$comments";
> >>
> >> mail ("$youremail", "$subject", $message, $headers);
> >> print ("Thank you $name, your email has been sent.");
> >>
> >> }
> >> ?>
> >> **************************************End
> >> Script****************************************
> >>
> >> Anything wrong with this?
> >> the last line of the script does get executed
> >> I sent a message with webmin to a online account which works
> >> I guess i'm lost
> >> I thought it works like so
> >>
> >> comment form
> >> |
> >> php script
> >> |
> >> sendmail
> >> |
> >> my online account
> >>
> >>
> >> --
> > If sendmail isn't sending the mail, ( or isn't suposed to), then
> > what is ? I asked around at a php forum and they have no luck
> > either
> >
> >
> > --
>
> you need to do some (simple) debugging to see what's going on.
>
> first, print out the variables that you're submitting to the mail()
> function to make certain that they are there, and valid.
First thats for the reply
i redid the script a bit but same result
from this line
>
mail($youremail, $subject, $message, $headers) or die('Email Not Sent!');
>
only $youremail is getting printed to the screen
So, 1 out of 4 isn't bad LOL
If i use this line
mail($youremail . $subject . $message . $headers) or print ($youremail
. $subject . $comments . $headers);
it prints all info to the page
second,
> check your web server error log for any insights.
Nothing found in var/log/
third,
> turn on (at a high level) php debugging.
bluefish is what i have
fourth, check the sendmail man page to
> find the commands necessary to check both "regular" mail queue and
> the submit queue to see if the messages are sitting there.
Sendmail
Niothing is in the mail queue
[root at jimsdesktop ~]# sendmail -bp
/var/spool/mqueue is empty
Total requests: 0
How can i check to see if sendmail is configured properly?
I can send a message from webmin using me at localhost.localdomain to anyone
fifth,
> look in your mail log to see if/what messages it may be giving
> if/when it gets a message from php.
Nothing in /var/mail/
> properly formed use of the php mail() function will submit the
> message to your MTA, which will process the message for delivery. you
> need to try to figure out where things are going wrong among these
> pieces.
>
> hint: if the last line of your php script (the "thank you") isn't
> getting printed, then you likely have a php scripting problem (and
> resulting error) above that point. [don't blame your MTA if you're
> not ever getting a message submitted to it.]
>
> [i'm assuming that you have sendmail running (and properly
> configured) on your machine. if you don't the messages will simply
> sit in the submit queue. you can submit directly to the "regular"
> mail queue (so that you can send mail without having sendmail running
> as a daemon), but not with the php mail() function. this is only
> relevant if in item 4, above, you find the messages in the submit
> queue.]
>
>
--
Jim Lawrence
Registered Linux User: #376813
********************************************************
When I'm feeling down, I like to whistle.
It makes the neighbor's dog run to the end of his chain and gag himself.
************************************
More information about the fedora-list
mailing list