LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 05-03-2009, 11:44 AM   #1
ElGeorge
LQ Newbie
 
Registered: May 2007
Posts: 8

Rep: Reputation: 0
Question Problem with Postfix and Google Mail for Domains


I have a server which is running a social network PHP app. This app needs to send Email notifications to users and also to me (as the admin) when certain actions take place on the app. Let's say that the server's domain name is mydomain.com

I have mail for "mydomain.com" being handled by "Google Mail for Domains", so the MX records of mydomain.com points to Google servers. Thus when people send emails to "admin@mydomain.com" those emails are entirely handled by Google.

I have Postfix setup on the server to handle Email notifications sent by the PHP app. I'm not using Google's SMTP server for sending those notifications because they have a 500 Email/day limit.

So... when the PHP app sends Email notifications through the local Postfix service to users with Emails like "user@whatever.com" it works pefectly and mails are delivered, but when the PHP app tries to send an Email notification to myself at "admin@mydomain.com" it gives this error on the maillog file:

Quote:
May 3 04:20:51 mydomain postfix/smtpd[11180]: NOQUEUE: reject: RCPT from mydomain.com[xx.xxx.xxx.xxx]: 550 5.1.1 <admin@mydomain.com>: Recipient address rejected: User unknown in local recipient table; from=<notification@mydomain.com> to=<admin@mydomain.com> proto=SMTP helo=<mydomain.com>
I suppose that Postfix understands that since the recipient is located at "mydomain.com" it needs to deliver that Email to a local account, but obviously not Email account exist locally on the server since the admin@mydomain.com account is actually at Google Mail.

What can I do on this case?. How can I tell Postfix to handle that Email being sent to "admin@mydomain.com" as any other Email and route it through the Internet to the servers on the MX record (Google's).

Thanks in advance,

George
 
Old 05-03-2009, 02:24 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Do you have mydomain set in your main.conf? I believe that if you don't set it explictly to something else it will use your local domain as you're experiencing. If you specify an alternative, e.g local.example.com instead of example.com then other emails to example.com should be sent off as normal emails.
 
Old 05-03-2009, 03:28 PM   #3
10speed705
Member
 
Registered: May 2009
Location: Ontario Canada
Distribution: debian
Posts: 56

Rep: Reputation: 17
Quote:
Originally Posted by acid_kewpie View Post
Do you have mydomain set in your main.conf? I believe that if you don't set it explictly to something else it will use your local domain as you're experiencing. If you specify an alternative, e.g local.example.com instead of example.com then other emails to example.com should be sent off as normal emails.
This is indeed correct. What I don't understand is why you would use an alternative mail server when you already have a server set up to do this. in the event that changing mydomain in the main.cf file does not work please postback with the logs from /var/log/mail.log/
 
Old 05-03-2009, 04:06 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
If there is no direct technical association, then it doesn't matter how mail is treated.
 
Old 05-03-2009, 05:20 PM   #5
ElGeorge
LQ Newbie
 
Registered: May 2007
Posts: 8

Original Poster
Rep: Reputation: 0
Post

Well... that did the trick. I specified mydomain as "local.mydomain.com" and now the Emails to "admin@mydomain.com" are being delivered. Thanks for the help.

As for the question of why using an alternative Email service??... two main things: SPAM Handling and flexibility.

When you have a site with a decent amount of traffic the amount of SPAM email that you'll receive is going to be huge, and even though you can set local spam filters etc, you're still wasting bandwith and cpu power processing them. Having all Email handled by Google is a "Piece of mind" decision. Their SPAM filter are IMHO the best, and you have the flexibility of managing your email from everywhere without much effort.

Thanks,

George
 
  


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
Setting up a mail server with Dovecot and/or Postfix with virtual domains Josh1billion Linux - Server 12 11-27-2008 02:57 AM
LXer: Postfix Mail Server With Multiple Domains LXer Syndicated Linux News 0 09-22-2008 02:11 AM
How to make postfix accept mail from multiple domains Farthom Linux - Newbie 4 09-14-2006 11:13 AM
Postfix - how do hosted domains download their mail from my postfix franschoek Linux - Software 1 04-01-2006 09:41 PM
No Incoming postfix mail, virtual domains geokker Linux - Software 0 06-22-2004 06:09 AM

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

All times are GMT -5. The time now is 11:10 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