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.

We're sending e-mail from our ASP.NET application (we'll call it @example.com). We use Google Apps for Business to send and receive e-mail sent to xxxx@example.com.

Problem is, Delivery Status Notification messages and other failure messages are received at our Google Apps for Business accounts. If I could get these messages (and only these) to deliver instead to our servers' SMTP /badmail/ folder, I could process them from there to take the appropriate action (notify the sender, remove e-mail from our database, etc).

Is there something I can do with DNS / MX records to send the bounce messages back to the server rather than going to Google / Gmail? Or perhaps filter messages received at Gmail and send them to the server by IP address?

Our MX records look like this right now:

example.com 1800    MX  priority: 20    alt1.aspmx.l.google.com
example.com 1800    MX  priority: 20    alt2.aspmx.l.google.com
example.com 1800    MX  priority: 10    aspmx.l.google.com
example.com 1800    MX  priority: 30    aspmx2.googlemail.com
example.com 1800    MX  priority: 30    aspmx3.googlemail.com
example.com 1800    MX  priority: 30    aspmx4.googlemail.com
example.com 1800    MX  priority: 30    aspmx5.googlemail.com

Thanks!

share|improve this question

2 Answers 2

up vote 0 down vote accepted

You could set up a rule in the Gmail account that receives these emails to automatically forward them on to your server.

It would probably be easier to use an IMAP client and have your server open the mailbox and periodically check for bounce messages though.

share|improve this answer

You probably only need to change the 'Mail From' header to point to an address hosted on your server, so bounces will go back to you instead of gmail. Check:

http://en.wikipedia.org/wiki/Bounce_address

Be sure to check if email authentication still works properly (in special DKIM - I don't think gmail includes the Mail From in the list of headers used by DKIM, but double check...).

share|improve this answer

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.