travispessetto / OrigamiSMTP

A TLS Enabled Fake SMTP Server for Development
https://travispessetto.github.io/OrigamiSMTP
MIT License
17 stars 14 forks source link

Create accounts with username and password. #3

Closed javydreamercsw closed 5 years ago

javydreamercsw commented 6 years ago

It would be useful to be able to create accounts you can send emails too and retrieve them later. This is part of the functionality I'm looking for not provided yet.

travispessetto commented 6 years ago

I have thought about a couple of things:

  1. Create an inbox per to address received which will be able to be accessed in the GUI
  2. Have a search filter for the to addresses

Please provide more information of what exactly you are looking for.

javydreamercsw commented 6 years ago

Basically I'm looking into this for unit tests. I would like to:

  1. Set up the server.
  2. Create one or more accounts (email, username, password).
  3. From the email source (i.e. application being tested) send emails.
  4. Retrieve emails from the user's inbox in order to check outcome (acceptance criteria of the unit test).
travispessetto commented 6 years ago

This is interesting and I need to think about it some more. In order to make a more informed decision I need to know if you will be looking for bounced email messages. The current setup is designed to be catch all and I anticipated keeping it that way.

There is plans for IMAP support that should allow more applications to be unit tested. While it is a pain in the butt you could probably get some unit testing from the system if you are using Java. You would need a copy of the jar file, a RunListener, and a few threads (similar to how the GUI works).

javydreamercsw commented 6 years ago

Right now I'm not looking for bounced emails. I just want to make sure the email my system sent was received on the different formats, plain SMTP, TLS, SSL, etc.

travispessetto commented 6 years ago

Are you just looking for Java or are you looking for compatibility with a range of languages?

javydreamercsw commented 6 years ago

I'm only interested in Java right now.

travispessetto commented 6 years ago

Alright, I will try writing a Java library that wraps Origami SMTP for testing. I am not sure when I will have enough time to write it but will try to get it done within the next couple of weeks.

travispessetto commented 6 years ago

While it is not the best I implemented a basic library that will let you get the newest message from the server and compare any of its fields with the value you are expecting. See this test for an example.

travispessetto commented 6 years ago

I made the basic test API a little easier to use. See this test for an example.

travispessetto commented 5 years ago

At this time separate user accounts are not in the goal of this project.