script to test mail server

Posted by WebDude on Server Fault See other posts from Server Fault or by WebDude
Published on 2010-05-26T17:13:33Z Indexed on 2010/05/26 17:21 UTC
Read the original article Hit count: 204

Filed under:
|
|

Ever since a windows update that took down my IIS6 mail server a few weeks back, I've been really paranoid about my mail server working.

So every time I run a windows update I fire up command prompt and send myself a quick test mail.

Like so:

> telnet localhost 25
> helo domain.com
> mail from: [email protected]
> rcpt to: [email protected]
> data
some random body to mail myself
.

This is a realy great way to test my mail server, but it's a pain in the neck to do quickly. Is there anyway i can run this in a batch script or something as a quick test?

I've tried a bat file but this just waits after i call telnet I've also explored if telnet accepts any input files and it does not seem to.

What's the best way to do this?

© Server Fault or respective owner

Related posts about emailserver

Related posts about sendmail