To test if our email server is working correctly we can use the following logic 🙂
1 – If we do now have sure of what is our email server address we can check it easily using nslookp.
Normally has any website our email server has to have a name associated to a ip address. If we want to confirm if the name is resolving to the correct ip address we will need to do a nslookup query.
Use the following syntax to confirm if the server has the correct address.
- set type=mx
- write the name of our domain e.g.: hjfr-info.com
- the return will be the name of the email server e.g.: mail.hjfr-info.com
After this we can use this name to connect via telnet or resolve the name to a ip address.
now to start a telnet connection to the server we only need to write this on the command line:
1 – telnet mail.hjfr-info.com 25
if the connection is successfully established you should see something like this:
Now it is possible to begin sending a email.
- greet the server with a: Helo
- Identify yourself: MAIL FROM: firstname.lastname@example.org
- Identify the destination: RCPT TO:email@example.com
- Identify the Data that you want to send: DATA and write the data
- end with a . (point and enter)
The telnet also can be used to verify other things on the SMTP server.
For example we have the commands VRFY and EXPN that might be used to identify valid users.
VRFY = This command will request that the receiving SMTP server verify that a given email username is valid. The SMTP server will reply with the login name of the user.
ESPN = is similar to VRFY, except that when used with a distribution list, it will list all users on that list. This can be a bigger problem than the “VRFY” command since sites often have an alias such as “all”.