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 [email protected].

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


2 Answers 2


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.


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:


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...).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .