GithubHelp home page GithubHelp logo

val100 / pochta-val Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jtalks-org/pochta

0.0 0.0 0.0 703 KB

Fake Mail Server (Mail Stub) that is useful when testing your applications.

License: GNU Affero General Public License v3.0

Shell 4.94% JavaScript 2.58% Kotlin 91.39% CSS 1.09%

pochta-val's Introduction

JTalks Pochta

Fake Mail Server (Mail Stub) that is useful when testing your applications. It's like Russian Post Office (Pochta) - things get in, but they never get delivered. Cases when you may need it:

  • You write System tests against the app that sends mails to its users. You'd like to intercept those message to test them or to go through the workflow in automated manner.
  • You have a PROD database with all its users, you're eager to test your new version of the app on this DB but you're afraid mails will be delivered to real users.

####Installation

Note, that during the first startup a folder ~/.pochta is created with the default configuration. You can change the configuration to match your needs: http/smtp ports, mailboxes and passwords.

####Usage Now, imagine your app sends mail to its users using Pochta SMTP Server: SUT --> Pochta --> [email protected]. After the mail was sent to Pochta it doesn't actually deliver the message to the end user, but rather Pochta stores it. Now in tests you can get the list of mails with the content e.g. by following: localhost:9000/inboxes/user?token=secret and the returned content may look like this:

[
  {
    "server_id": 1,
    "sender_ip": "\/127.0.0.1:54642",
    "mail_body": "From: [email protected]\r\nTo: [email protected]\r\nMessage-ID: <1722681408.0.1398714670448.JavaMail.sbashkyrtsev@sbashkyrtsev-nb.local>\r\nSubject: This is the long  long long long long long long longSubject Line!\r\nMIME-Version: 1.0\r\nContent-Type: text\/plain; charset=us-ascii\r\nContent-Transfer-Encoding: 7bit\r\n\r\nThis is actual message\r\n",
    "envelope_from": "[email protected]",
    "delivery_date": "Mon Apr 28 23:51:10 MSK 2014",
    "envelope_recipients": ["[email protected]"]
  }
]

You can create new mailboxes in config file, while configuring them you should specify both mailbox and the password. When trying to use Pochta as SMTP Server, specify these credentials. Afterwards when you try to retreive stored data from Pochta, pass the password as a ?secret=password. Well, you should see self explanatory errors if you're doing something wrong.

pochta-val's People

Contributors

jk1 avatar ctapobep avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.