From: Phil Howard on
I'm looking for an SMTP testing tool I can use to do tests of configuration
changes to Postfix. To do the proper tests I need to carry out the actual
SMTP protocol from this program (as opposed to just putting mail in the
queue), with TLS, STARTTLS, and login/authentication support, do it from a
command line or shell script, and be able to bypass terminal prompts for
authentication passwords. Interactive mail clients are just too clumsy to
do these tests with (mostly because I need to do tests with a large variety
of configurations generated at test-run time).

Anyone ever heard of such a thing? Ironically, it may well be spamware that
can do better tests than anything I have seen so far, and that would be a
shame. Open source highly preferred, of course (even better if in my
favorite languages ... C, Pike, Python).

I'm putting together a suite of regression tests. Some will run daily under
cron. Some will be run when configuration changes are made. The objective
is to verify that every aspect of sending mail is working (or not working as
the case may be, such as rejecting attempts to open relay) as intended
whenever changes are made.
From: Phil Howard on
On Tue, May 18, 2010 at 12:59, Wietse Venema <wietse(a)porcupine.org> wrote:

> This sounds like a job for Expect and "openssl s_client".
> Expect is at http://expect.nist.gov/
>

Ah, yeah ... that ... or pexpect for Python (just used pexpect last month to
extract stats from our Cisco routers).
From: mouss on
Phil Howard a �crit :
> I'm looking for an SMTP testing tool I can use to do tests of
> configuration changes to Postfix. To do the proper tests I need to
> carry out the actual SMTP protocol from this program (as opposed to just
> putting mail in the queue), with TLS, STARTTLS, and login/authentication
> support, do it from a command line or shell script, and be able to
> bypass terminal prompts for authentication passwords. Interactive mail
> clients are just too clumsy to do these tests with (mostly because I
> need to do tests with a large variety of configurations generated at
> test-run time).
>
> Anyone ever heard of such a thing? Ironically, it may well be spamware
> that can do better tests than anything I have seen so far, and that
> would be a shame. Open source highly preferred, of course (even better
> if in my favorite languages ... C, Pike, Python).

if perl is acceptable for you, then it's easy to do what you want using
available perl modules, or you can just use:

http://www.logix.cz/michal/devel/smtp-cli/smtp-cli


>
> I'm putting together a suite of regression tests. Some will run daily
> under cron. Some will be run when configuration changes are made. The
> objective is to verify that every aspect of sending mail is working (or
> not working as the case may be, such as rejecting attempts to open
> relay) as intended whenever changes are made.

From: Phil Howard on
On Tue, May 18, 2010 at 15:15, mouss <mouss(a)ml.netoyen.net> wrote:

> if perl is acceptable for you, then it's easy to do what you want using
> available perl modules, or you can just use:
>
> http://www.logix.cz/michal/devel/smtp-cli/smtp-cli
>

I think Wietse was on the right track. I'll probably just use pexpect +
openssl s_client (or telnet for the non-TLS cases). I know some Python,
enough to get by with things like pexpect. I know no Perl and don't have
the time for it. I do know C but it would be more of a chore to do all the
expect-ish things unless I run across an expect-lib for C (looked for that a
few months ago for another project and didn't find it ... that's when I
found pexpect).
From: Stefan Foerster on
* Phil Howard <ttiphil(a)gmail.com>:
> I'm looking for an SMTP testing tool I can use to do tests of configuration
> changes to Postfix. To do the proper tests I need to carry out the actual
> SMTP protocol from this program (as opposed to just putting mail in the
> queue), with TLS, STARTTLS, and login/authentication support, do it from a
> command line or shell script, and be able to bypass terminal prompts for
> authentication passwords. Interactive mail clients are just too clumsy to
> do these tests with (mostly because I need to do tests with a large variety
> of configurations generated at test-run time).

Perhaps "swaks" is the right tool for you:

http://jetmore.org/john/code/swaks/


Stefan