Clearing Your Address List
page 5 of 10
by John Alessi
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 42956/ 66

Step 2. Add custom data to bounced messages...

This step requires that your mail server is capable of being configured to use a wildcard address.  In other words, it needs to be able to route all mail to bounce*@yourdomain.com to one specific account such as bounce@yourdomain.com.  If your mail server does not support wildcard addresses, you can accomplish the same thing by using a "catch-all" box and a dedicated domain.

You can then append custom data to the end of the account name portion of the return-path and it will still be delivered to the bounce@yourdomain.com account.  For example, suppose each e-mail address in your database is identified by a unique numerical id.  You can then encode this id into your bounce address.  For example, suppose that the recipient address is jane.recipient@domain.com, and the id of this address in your database is 1063.  You could then build an address such as bounce_1063@yourdomain.com. 

You can then send a message to jane.recipient@domain.com and specify bounce_1063@yourdomain.com as the reverse-path by passing that address to the SMTP server with the MAIL FROM command.  i.e. MAIL FROM:<bounce_1063@yourdomain.com>.  To provide a friendly "from" name or address for Jane's mail reader to display, you can add a From: header to the message.  i.e. From: "Joe Sender" <joe.sender@domain.com>.

The sample at the end of this article shows how easily this can be done.

If the message is delivered successfully, Jane's mail reader will display it as coming from Joe Sender.  If for some reason the message is undeliverable, a "undeliverable mail" notification message will be sent to bounce_1063@yourdomain.com.  Since your mail server has been instructed to deliver all messages for bounce*@yourdomain.com to bounce@yourdomain.com, this returned messages should now land in your bounce box.

Additionally, since returned messages are returned to the address specified by its reverse-path, each of these messages should have your custom bounce address in the To: header.  In other words, each of the messages in the bounce box will be addressed to bounce_<id>@yourdomain.com, where <id> represents the id of the e-mail address in your database which is related to the bounce.  Our testing has indicated however that some mail servers use the From: address of the original message as the To: address of its resulting bounce.  This is not what should be going on according to the RFC, but we have a fix for that too.  If the To: header address does not begin with bounce_, you can scan the message's "Received" headers and find your bounce address there.  The sample code shows you how this is done.

Following these rules, you can now easily match bounced messages up to your database, as you will see...


View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-19 10:45:57 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search