# smtptest



## rpert (Jun 2, 2015)

I see references made in an old thread 42624 about a script named `smtptest` for testing SMTP over `telnet`.

I can't find it in ports or by searching in Freshports.org. It's on github at: github.com/RayViljoen/smtp-test

Does anyone know which port includes this `smtptest` program, or if it has been ported?


----------



## rpert (Jun 2, 2015)

I did find another utility in ports mail/swaks which has similar functionality.

Is mail/swaks the best tool for testing?


----------



## ShelLuser (Jun 2, 2015)

Why rely on a script anyway? Its extremely easy to set this up from mind. The less you need to rely on pre-made stuff, the easier any troubleshooting will be:


```
macron:/home/peter $ telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 macron.intranet.lan ESMTP Postfix
helo localhost
250 macron.intranet.lan
mail from: peter@intranet.lan
250 2.1.0 Ok
rcpt to: peter@intranet.lan
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
Subject: Hello Peter!
Hello :)
.
250 2.0.0 Ok: queued as 3F396808D
quit
221 2.0.0 Bye
Connection closed by foreign host.
```

So just remember helo, mail from, rcpt to and data. Optionally followed by the Subject keyword, and end with a mere . to indicate the end of your SMPT sequence.


----------



## rpert (Jun 3, 2015)

ShelLuser said:


> Why rely on a script anyway? Its extremely easy to set this up from mind. The less you need to rely on pre-made stuff, the easier any troubleshooting will be:



True, however using`telnet` by hand gets tedious using TLS with SASL authentication. AFAIK it's impossible over ipv6 as `openssl s_client -connect` doesn't support it yet. I too prefer to do as much as possible manually it's just that mail/swaks supports IPv6 and TLS and handles the base64 encoding of passwords.


----------

