MailBee. NET Objects Tutorials

Bounced messages: Wildcard bounce box method

The advanced way to manage bounce messages is to use the wildcard addresses. Let us explain what it is. A wildcard box allows you to send mail to bounce*@domain.com but message will come to bounce@domain.com. Thus, you can append custom data to the end of the account name of the return-path and it will still be delivered to the bounce@domain.com account. It can be very helpful if you are working with a big database (mailing list) and each e-mail address in the database has a unique id. You can use this id to operate with bounce emails. For example, suppose that the recipient address is bill@domain2.com, and the id of this address in your database is 10. Using this information you can build an address such as bounce_10@domain.com.

You can send a message to bill@domain2.com and set bounce_10@domain.com as a return-path. Of course, you can fill in the "From" field with your address of a sender, for example let us use jdoe@domain.com address. If the message is delivered successfully, Bill will think that Joe is the real sender, but if the message is undeliverable for some reason, the bounce message will be sent to bounce_10@domain.com. This message should be delivered to your bounce box, because you have set your mail server to deliver all messages for bounce*@domain.com to bounce@domain.com. After that, you can easily find which address is bad. Each bounce message should have custom bounce address in the "To" header. If there were some problems with Bill's address, the "To" field of the bounce message would look like bounce_10@domain.com. 10 is the id of the e-mail address in your database which is related to the bounce. Thus, you do not have to search for bad email in the text of the message. Of course, if your mail server does not support wildcard addresses, you can use a single bounce box and scan messages for bad addresses.

Note: Some mail servers use the "From" address of the original message as the "To" address of its resulting bounce. You can scan the message "From" header and find your bounce address there.