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 email@example.com but message will come to firstname.lastname@example.org. 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 email@example.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 firstname.lastname@example.org, and the id of this address in your database is 10. Using this information you can build an address such as email@example.com.
You can send a message to firstname.lastname@example.org and set email@example.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 firstname.lastname@example.org 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 email@example.com. This message should be delivered to your bounce box, because you have set your mail server to deliver all messages for firstname.lastname@example.org to email@example.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 firstname.lastname@example.org. 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.