Long long ago... nearly a lifetime away...

The department was in the process of sending out marketing updates (using an email address that is actually monitored, ie, someone's mailbox), and noticed there were bounced emails.

Eventually, I was called upon to investigate why there were so many bounced emails coming through as I was originally the one who coded the email marketing module. A quick look into the bounced back emails showed the following:

From MAILER-DAEMON Thu Aug 24 04:18:20 1996
Received: from localhost (localhost)
by localhost (8.10.1/8.10.1) id e8OBIKJ31412;
Thu, 24 Aug 1996 04:18:20 +0800
Date: Thu, 24 Aug 1996 04:18:20 +0800
From: Mail Delivery Subsystem <MAILER-DAEMON>
Message-Id: <199608241118.e8OBIKJ31412@mycompany.com.sg>
To: postmaster
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;boundary="e8OBIKJ31412.967115901/mycompany.com.sg"
Subject: Postmaster notify: see transcript for details
Auto-Submitted: auto-generated (postmaster-notification)

This is a MIME-encapsulated message

--e8OBIKJ31412.967115900/mycompany.com.sg

The original message was received at Thu, 24 Aug 1996 04:18:20 +0800
from localhost
with id e8OBIKI31412

----- The following addresses had permanent fatal errors -----
<someuser@singnet.com.sg >
(reason: 550 5.7.1 Unable to relay for someuser@singnet.com.sg )

----- Transcript of session follows -----
... while talking to singnet.com.sg :
>>> RCPT To:<someuser@singnet.com.sg >
<<< 550 5.7.1 Unable to relay for someuser@singnet.com.sg
550 5.1.1 <someuser@singnet.com.sg >... User unknown

It was the same year that I had came across the famous TCP/IP book - Internetworking with TCP/IP Vol.1: Principles, Protocols, and Architecture (Nth Edition).

A careful examination of the bounced email showed that there was an extra space after the end of the domain name. The extra space was causing the domain name not to be recognized. What is a valid email address? For this purpose, an email address is a valid user name, separated by @ followed by a domain name. The domain name is like a country name. No where else in the world will you have a duplicated domain name. The user name is like a unique street name in that country. Each street name in a particular country, is unique, like the user name.

Subsequent examinations of some of the bounced emails revealed the same thing as well. So, I traced the error, and looked into the database, and discovered the same errors were there as well. Having read the TCP/IP book, I realized there were methods of verifying if an email address is correct. The first method, is to perform the SMTP VRFY command, which in short, tells you if an email address is correct by checking with the email server responsible for the domain and asking if the user existed. The second method, is by performing a MX record lookup and comparing the domain name in the email address. The second way assumes that the user name as entered by the user, is correct.

Unfortunately, by then, antispamming techniques have been invented, following this recommendation (RFC 2505) which recommended that email servers disable the VRFY response/command, and so, I couldn't use the first method.

I could quickly code up a script that validates the email addresses. I did so, and validated the email addresses in the database. In addition, I quickly wrote a module that prevented users from entering invalid email addresses. After users have entered their email addresses, the first step to checking if their email address are correct is to check the domain name by performing a MX record lookup.

For some strange reason that I don't remember, we didn't send users email directly after they have entered their email addresses.

After implementing my work, invalid email addresses were reduced, and as such, there were fewer email bounce backs as well!