Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

My domain's email is managed by Google Apps, so that domain users get Gmail and Calendar, etc. But I also want to be able to send applicative notifications to users outside the domain via email (e.g. "some commented on your post", and so on). However, if I try to send email through code I get blocked by Gmail after a few emails.

I send marketing email through MailChimp, to minimize the risk of appearing as spam to my users (one-click unsubscribe, etc.). But I can't send applicative message in this way.

I want to install a local MTA (my server runs Ubuntu), but I'm not sure what anti-spam measures I need to implement so that receiving MTAs don't think it's a spam server. What's stopping anyone from setting up a mail server and sending emails using my domain name? AFAIK it's the DNS records that show the MTA's address actually belongs to the domain. But my understanding of this is rather superficial, so someone please correct me if I'm wrong.

But what sort of DNS configuration do I need to put in place so that I don't get blacklisted (assuming I don't actually spam anyone)? The MX records already point to Google, and I'd like to keep it this way. So do I just need to define an A record for my internal mail server? Should it show email as coming from a sub-domain, so as not to conflict with the bare domain being managed by google?

Edit:

Does the following SPF record make sense if I want email from my domain name to be sent by either google's servers or any server with a dns name ending with mydomain.com?

"v=spf1 ptr mx:google.com mx:googlemail.com ~all"

How should I set up reverse DNS for my server? If I have an A record that points mailsender.mydomain.com to my MTA's ip address, does it mean that reverse lookup will only allow emails sent from address@mailsender.mydomain.com?

share|improve this question
    
Could you define blocked by Gmail? As far as i know Gmail accepts even high-rated spam content (it always ends up with a spam-label though). –  Mark Mar 12 '11 at 7:03
    
I mean after you send a few emails their server's stop accepting your SMTP authentication and direct you to a CAPTCHA page to unblock your account. –  Assaf Lavie Mar 12 '11 at 7:26
    
Your SPF record should be "v=spf1 a:mailsender.mydomain.com include:aspmx.googlemail.com ~all" –  adamo Mar 12 '11 at 7:46
1  
I summed up the configuration needed for sendmail here: blog.postmaster.gr/2011/03/14/… –  adamo Mar 13 '11 at 22:28

1 Answer 1

up vote 2 down vote accepted

What's stopping anyone from setting up a mail server and sending emails using my domain name?

Nothing actually. That is why recipients setup antispam measures.

But what sort of DNS configuration do I need to put in place so that I don't get blacklisted?

As a first step setup your SPF records to include your MTA and Google's include:aspmx.googlemail.com http://www.openspf.org/ has a simple wizard that helps you on this.

share|improve this answer
    
I want to send email from an address like: noreply@mydomain.com. Can I setup reverse DNS with my hosting provider with mydomain.com as the record or must is be some-host.mydomain.com? And if the latter, won't that necessitate sending email from address@some-host.mydomain.com? –  Assaf Lavie Mar 12 '11 at 7:16
2  
What is needed for your sending MTA is that its A record and PTR record provide the same information. If the server's name is ser.ver.name and it's address 1.2.3.4 then the PTR record for 4.3.2.1.in-addr.arpa should point to ser.ver.name. It does not have to be identical to mydomain.com. And ser.ver.name or its IP address should be included in the SPF record. –  adamo Mar 12 '11 at 7:26
2  
Although include:aspmx.googlemail.com will work as it redirects to _spf.google.com it preferable to use include:_spf.google.com. –  Mark Mar 12 '11 at 8:18
    
Mark, thanks for your reply. As google.com/support/a/bin/answer.py?answer=178723 shows you are correct. My include was from reading an earlier version of the document which is apparently now deprecated. –  adamo Mar 12 '11 at 11:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.