LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-01-2008, 05:26 PM   #1
asshammer
LQ Newbie
 
Registered: Aug 2008
Posts: 4

Rep: Reputation: 0
sendmail on Fedora 9


I've been having trouble with the mail function in php. I call the function correctly and it returns a 1 like it has ran sucessfully, but no email shows up in my inbox. I tried it with a simple perl script too. I am completely send mail retarded and haven't changed anything in it. Its the default install that comes with Fedora 9 on x86-64.

Here is an example of my a sendmail log for it attempting to send an email to a test account.

Code:
Aug  1 17:24:52 localhost sendmail[29061]: m71MOqoF029061: from=daemon, size=141, class=0, nrcpts=1, msgid=<200808012224.m71MOqoF029061@localhost.localdomain>, relay=daemon@localhost
Aug  1 17:24:52 localhost sendmail[29062]: m71MOqfF029062: from=<daemon@localhost.localdomain>, size=376, class=0, nrcpts=1, msgid=<200808012224.m71MOqoF029061@localhost.localdomain>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Aug  1 17:24:52 localhost sendmail[29061]: m71MOqoF029061: to=carl0rossi@yahoo.com, ctladdr=daemon (2/2), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30141, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (m71MOqfF029062 Message accepted for delivery)
Here is the php script
Code:
<?php
$headers = "From: asdf@asdf.com"; 
$to = "carl0rossi@yahoo.com";
$subject = "We will respond back to you shortly - please don't reply back to this email.";
$body = "asdfasdf";

$send = mail($to, $subject, $body, $headers); 
echo $send;
?>
Any help would make you my bffe
 
Old 08-01-2008, 05:45 PM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Certainly looks like it's gone (I assume you are sending to your yahoo account).

Why don't you try sending to a local user. There's a pretty good chance that yahoo is treating it like spam if you don't have reverse DNS set properly or if your IP is blacklisted for some reason.

If that is the case then you can relay through your ISP using "smarthost"
 
Old 08-01-2008, 05:50 PM   #3
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
There is nothing in the log that indicates the relay was a yahoo machine. Looks like the relay was localhost.
 
Old 08-01-2008, 06:03 PM   #4
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
The recipient is a yahoo address
 
Old 08-01-2008, 06:10 PM   #5
asshammer
LQ Newbie
 
Registered: Aug 2008
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by billymayday View Post
Certainly looks like it's gone (I assume you are sending to your yahoo account).

Why don't you try sending to a local user. There's a pretty good chance that yahoo is treating it like spam if you don't have reverse DNS set properly or if your IP is blacklisted for some reason.

If that is the case then you can relay through your ISP using "smarthost"
I have the yahoo spam filter turned off. I also have a few gmail accounts I've tried sending it to just incase. I posted the logs because that account already gets spammed to high heaven anyways.

Quote:
Originally Posted by Mr. C. View Post
There is nothing in the log that indicates the relay was a yahoo machine. Looks like the relay was localhost.
How would I go about making the relay not be localhost? Or do I want it to be? Like I said I'm MTA retarded. I also just made a half-assed attempt at trying to use postfix instead, but so far I'm not having much luck with that either.

Here is a little more about the machine I'm running this one, just in case any of this might help. Its a simple dev server I have. I (poorly) hand configured apache 2.2.8, PHP 5.2.5, and mysql 5.0.45. When setting it I never touched sendmail at all, but it was installed when I compiled PHP.

Thanks for the quick replies.

edit: and sorry the code I posted earlier broke the layout. If a mod wants me to edit that in anyway, I can.

Last edited by asshammer; 08-01-2008 at 06:11 PM.
 
Old 08-01-2008, 06:14 PM   #6
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
My understanding is that the relay= syslog equate for recipient syslog lines will show the receiving host's MX or A record.
 
Old 08-01-2008, 06:28 PM   #7
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
I generally don't debug Sendmail setups anymore. I stopped using Sendmail years ago.

Before you set yourself in stone, its important that you learn if:

a) your IP address will be able to send mail, and
b) other remote sites are willing to receive email from your server

If you are on a residential block, or a dynamic block, many sites will reject your mail.
In such a case, you will need to setup your mail as a smarthost, which relays through your
ISP.

It appears that you don't have an official domain name, so you'll need to perform address
rewriting on the envelope sender, so that mail can bounce back in case it is not deliverable,
and so that other sites don't reject the mail (because the latter is not possible). You can
do this with the 5th parameter (additional sendmail options) to mail(). You'd set something
like "-f you@realdomain.com", or have your MTA do this on all outbound mail.
 
Old 08-01-2008, 09:10 PM   #8
asshammer
LQ Newbie
 
Registered: Aug 2008
Posts: 4

Original Poster
Rep: Reputation: 0
Awesome! I read up on that and tried it out. Still not going through but my log is looking a little more promissing.

Code:
Aug  1 20:58:34 localhost sendmail[24497]: m721wUiW024495: to=<_________________@gmail.com>, ctladdr=<daemon@localhost.localdomain> (2/2), delay=00:00:04, xdelay=00:00:04, mailer=esmtp, pri=120383, relay=gmail-smtp-in.l.google.com. [209.85.133.27], dsn=5.0.0, stat=Service unavailable
Aug  1 20:58:34 localhost sendmail[24497]: m721wUiW024495: m721wYiW024497: DSN: Service unavailable
Aug  1 20:58:34 localhost sendmail[24497]: m721wYiW024497: to=root, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31646, dsn=2.0.0, stat=Sent
Instead of the relay being localhost it is now showing up in the logs as gmail-smtp-in.l.google.com.

The edit I made was this
Code:
dnl define(`SMART_HOST', `smtp-server.nc.rr.com')dnl
before that line was in there but instead of smtp-server.nc.rr.com there was mysmtprelay or some junk like that. I dont remeber what it was, but it was junk. Should I remove the dnl on either end? What do those do?
 
Old 08-01-2008, 09:22 PM   #9
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
Your system is trying to send directly instead of using roadrunner.

The dnl are silly sendmail macros. Sendmail use a macro processing language to parse the config files.

Rather than fight Sendmail, you indicate you tried Postfix. Are you ready to switch and get Help?

Here's the documentation that will move you forward:

http://www.postfix.org/SOHO_README.html

I'll help move you along as well.
 
Old 08-02-2008, 01:41 AM   #10
asshammer
LQ Newbie
 
Registered: Aug 2008
Posts: 4

Original Poster
Rep: Reputation: 0
I just switched over to postfix using system-switch-mail and then saw a little notification pop up saying that I had new mail in my yahoo account. For some reason it won't goto my gmail acount, probably getting delete as spam, but who cares. Thank you very very much. As promised, Mr C, you are now my bffe.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sendmail 8.13 Relaying on Fedora 2 treedstang Linux - General 0 02-07-2005 07:14 AM
Sendmail on Fedora Core 1 sp!d3rm@n Linux - Newbie 9 07-29-2004 10:33 AM
Sendmail on Fedora Core 2? carlosinfl Fedora 0 07-26-2004 10:35 PM
sendmail and Fedora skou2 Linux - Networking 8 01-21-2004 09:50 AM
Fedora Sendmail Wickedinterface Fedora 1 01-14-2004 02:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration