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 09-26-2012, 10:30 PM   #1
RMLinux
Member
 
Registered: Jul 2006
Posts: 260

Rep: Reputation: 37
LAMP not sending email.


Hi All,

My LAMP not sending email to my domain.name email.

example: xxx@example.com

i setup php.ini
sendmail_path = /usr/sbin/sendmail -t -i

i have php script to send email for testing and it works in gmail account but in mydomain cannot.

Thanks.
 
Old 09-26-2012, 10:52 PM   #2
rosehosting.com
Member
 
Registered: Jun 2012
Location: Missouri, USA
Posts: 236

Rep: Reputation: 64
You should check your mail logs for any error messages.



Quote:
Originally Posted by RMLinux View Post
Hi All,

My LAMP not sending email to my domain.name email.

example: xxx@example.com

i setup php.ini
sendmail_path = /usr/sbin/sendmail -t -i

i have php script to send email for testing and it works in gmail account but in mydomain cannot.

Thanks.
 
Old 09-28-2012, 03:56 AM   #3
RMLinux
Member
 
Registered: Jul 2006
Posts: 260

Original Poster
Rep: Reputation: 37
HI GUYS,

I found the answer in this site: SOURCE: http://serverfault.com/questions/653.../128450#128450

*******************************************

What I did to disable local delivery. I'll be using the example.com domain.

Requirements:

example.com A entry pointing to IP address assigned to one of the eth interfaces.
/etc/hosts defining example.com assigned to the very same IP address as above
example.com MX records pointing to Google servers (ASPMX.L.GOOGLE.COM, etc)
default sendmail installation (mine was on Ubuntu)

Steps:

vim /etc/mail/sendmail.mc

at the end:

define(`MAIL_HUB', `example.com.')dnl
define(`LOCAL_RELAY', `example.com.')dnl

and then:

sendmailconfig (or /etc/mail/make depending on your distro)
service sendmail restart

testing:

echo -e "To: user@example.com\nSubject: Test\nTest\n" | sendmail -bm -t -v
echo -e "To: user\nSubject: Test\nTest\n" | sendmail -bm -t -v

You should see it connecting to the google server and then you should see your mail being delivered to your Google inbox.

Last edited by RMLinux; 09-28-2012 at 04:02 AM.
 
Old 09-28-2012, 04:03 AM   #4
RMLinux
Member
 
Registered: Jul 2006
Posts: 260

Original Poster
Rep: Reputation: 37
THE SAME PROBLEM AS MINE CAME FROM THIS SOURCE: http://stackoverflow.com/questions/7...1-user-unknown


When sending emails to ordinary domains like @google.com or @hotmail.com, my code works properly.

But, when I try to send an email to the domain that I own (let's say example.com), which server is set up I'm getting error code 67 from mail command.

I'm using mail() function of PHP but I've also tried "mail -stest kubilayeksioglu@example.com" and it returns the same error, so it should not be related with the code itself.

Here's a portion of mail that I receive in /var/mail/root

Final-Recipient: RFC822; kubilayeksioglu@example.com

Action: failed

Status: 5.1.1 Remote-MTA: DNS; [127.0.0.1]

Diagnostic-Code: SMTP; 550 5.1.1 ... User unknown

Last-Attempt-Date: Wed, 21 Sep 2011 17:43:59 GMT

I guess I should also add that, our domain example.com is using Google Apps.

Can anyone give me an idea about how can I fix that?

---------- Post added 09-28-12 at 04:04 AM ----------

Thanks to all.
 
  


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
Problem sending email through new email server bigben747 Linux - Server 3 01-26-2009 05:16 PM
sending email to an ip pyu7 Linux - Software 4 10-08-2004 02:46 PM
sending email GraemeK Linux - Networking 1 08-24-2003 05:14 PM
sending email csDraco_ Slackware 5 08-22-2003 05:50 PM
sending an email to a email address after a perl operation meluser Programming 9 04-07-2003 01:26 PM

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

All times are GMT -5. The time now is 05:40 PM.

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