Jump to content

Email Error Detection


S Murder

Recommended Posts

Where I work they have a problem where they sent out 3,000 emails and 2,000 bounced back. I need to write a program that will examine the bounce back emails and removed the non-existent addresses from the mailing list. Problem is, I don't see any server response codes when I look at email headers; if there were I could just check for 550 and delete the intended recipient's address from the list. Any idea of how I'd go about this?

Link to comment
Share on other sites

You may have to search for text in the body of the email, like "recipient not found", "user does not exist", etc. Mail servers sort of give their own messages, and if you can't find a response code then a text search would probably be the only way.

Link to comment
Share on other sites

OK, I ended up writing a Java program that basically attempts to telnet into the mail exchange servers and see if the provided email gives an error code. Problem is, the servers won't let me connect on port 25 (for SMTP), and I can't connect to most servers using Putty or the telnet command on Windows either. Any ideas?

Link to comment
Share on other sites

Surely a mail server would allow connections on port 25, it would not be able to function otherwise. At my house my ISP blocks all traffic on port 25 unless it is to their own server, so you might have to try running it on a business network if the ISP is blocking connection attempts.

Link to comment
Share on other sites

It sounds like the port is blocked, can you connect to SMTP at all, with any program?
I can connect to the one that was running on the localhost.What other programs could I use?
Link to comment
Share on other sites

Quick Question:Do you connect to the SMTP server you're sending mail to, or do you connect to your SMTP server, which communicates with the server you're sending to?

Link to comment
Share on other sites

You would need to communicate with the destination server, because that is the server that has the account information that you are looking for. If you worked with your server, then that would be the same thing as sending an email and watching for it to be bounced back. Testing on localhost would not tell you whether the ports are blocked, when you are connecting to localhost you aren't using the same network routing that you are using when you connect to a server on another network. You'll want to test and see if you can set up a mail client to send mail using some other server, but you would need an email account to do that. You can probably just put in a dummy name and password and try to connect, and even if the server says the name and password was wrong you would know that the connection to the server succeeded. Look up the MX records for something like Google or Yahoo and set up a mail client to try and connect.

Link to comment
Share on other sites

You would need to communicate with the destination server, because that is the server that has the account information that you are looking for. If you worked with your server, then that would be the same thing as sending an email and watching for it to be bounced back. Testing on localhost would not tell you whether the ports are blocked, when you are connecting to localhost you aren't using the same network routing that you are using when you connect to a server on another network. You'll want to test and see if you can set up a mail client to send mail using some other server, but you would need an email account to do that. You can probably just put in a dummy name and password and try to connect, and even if the server says the name and password was wrong you would know that the connection to the server succeeded. Look up the MX records for something like Google or Yahoo and set up a mail client to try and connect.
OK, I downloaded Thunderbird and was able to successfully send and receive messages from my Gmail account.I noticed that Gmail setup required a secure connection. Could using an ordinary Java Socket be the problem? Do you know of any SSL or TSL command line clients I could use to test this?
Link to comment
Share on other sites

Hmm, I would just use Putty, but I think you've already tried that. You can just telnet to port 25 though, wouldn't that work? If port 25 is open, it should work. Try typing this in a command line:

telnet 69.93.253.165 25

If it works, you should see the headers for blazecast6.rdns6.net. If it doesn't work, then port 25 is blocked.

Link to comment
Share on other sites

Hmm, I would just use Putty, but I think you've already tried that. You can just telnet to port 25 though, wouldn't that work? If port 25 is open, it should work. Try typing this in a command line:
telnet 69.93.253.165 25

If it works, you should see the headers for blazecast6.rdns6.net. If it doesn't work, then port 25 is blocked.

Thanks. It turns out the port is being blocked.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...