Skip to content

Commit

Permalink
extended documentation (readme)
Browse files Browse the repository at this point in the history
  • Loading branch information
snsttr committed Feb 16, 2017
1 parent cfd6faf commit 8826180
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 10 deletions.
73 changes: 64 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,86 @@
# smtp-dump
NodeJS SMTP Server that dumps all received mails
This tool provides a Node.js SMTP Server that dumps all received mails to disk. It can be used to test SMTP Clients or
simulate SMTP Servers for Development reasons.

## Install
## Installation
After cloning the repository

npm install

## Use
## Usage

node smtp-dump.js

smtp-dump.js will output all received E-Mails into the output folder (default _"output"_) while running.
smtp-dump.js will write out all E-Mails into the specified output folder (default `./output`) while running.
The SMTP Server does not require a username and/or a password. Also secure connections are not possible, yet.

### Arguments
### optional Arguments

Specify the logging destination by passing a path to _--output_ (default directory is _"output"_).
Specify the logging destination by passing a path to `--output` (default directory is `output`).
Creates the directory if it does not exist.

node smtp-dump.js --output=dump
node smtp-dump.js --output=/home/smtp-dump
node smtp-dump.js --output=C:\smtp-dump


Specify the port for the SMTP Server by passing a number (1 - 65536) to _--port_ (default Port is _25_)
Specify the port for the SMTP Server by passing a number (1 - 65536) to `--port` (default Port is `25`)

node smtp-dump.js --port=dump

Debugging ouput (console) is enabled if you use _--logger_
Debugging ouput (console) is enabled if you use `--logger` (default is disabled).

node smtp-dump.js --logger
node smtp-dump.js --logger

# Example

Start smtp-dump.js with output directory `./dump`, port `10025` and logging activated.

node smtp-dump.js --output=dump --port=10025 --logger
Now enter the settings to your SMTP Server in your SMTP Client Application (usually on `localhost`). As soon as the client
tries to send an E-Mail using the specified SMTP Server the smtp-dump.js writes the Mail as a txt-File into the specified
output directory:

Message-ID: <[email protected]>
Date: Thu, 29 Dec 2016 15:54:13 +0100
Subject: Test E-Mail
From: Test Client <[email protected]>
To: [email protected]
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

This is a Test Message

Since we used `--logger` the smtp-dump.js outputs some information to the command line:

[2017-02-16 14:34:54] INFO: SMTP Server listening on [::]:10025
[2017-02-16 14:35:46] INFO: [82Suh8w7238+O] Connection from [127.0.0.1]
[2017-02-16 14:35:46] DEBUG: [82Suh8w7238+O] S: 220 localhost ESMTP
[2017-02-16 14:35:46] DEBUG: [82Suh8w7238+O] C: EHLO example.com
[2017-02-16 14:35:46] DEBUG: [82Suh8w7238+O] S: 250-localhost Nice to meet you, [127.0.0.1]
250-PIPELINING
250-8BITMIME
250-SMTPUTF8
250-AUTH LOGIN PLAIN
250 STARTTLS
[2017-02-16 14:35:46] DEBUG: [82Suh8w7238+O] C: MAIL FROM: <[email protected]>
[2017-02-16 14:35:46] DEBUG: [82Suh8w7238+O] S: 250 Accepted
[2017-02-16 14:35:46] DEBUG: [82Suh8w7238+O] C: RCPT TO: <[email protected]>
[2017-02-16 14:35:46] DEBUG: [82Suh8w7238+O] S: 250 Accepted
[2017-02-16 14:35:46] DEBUG: [82Suh8w7238+O] C: DATA
[2017-02-16 14:35:46] DEBUG: [82Suh8w7238+O] S: 354 End data with <CR><LF>.<CR><LF>
[2017-02-16 14:35:46] DEBUG: [82Suh8w7238+O] C: <701 bytes of DATA>
[2017-02-16 14:35:46] DEBUG: [82Suh8w7238+O] S: 250 OK: message queued
[2017-02-16 14:35:46] DEBUG: [82Suh8w7238+O] C: MAIL FROM: <[email protected]>
[2017-02-16 14:35:46] DEBUG: [82Suh8w7238+O] S: 250 Accepted
[2017-02-16 14:35:46] DEBUG: [82Suh8w7238+O] C: RCPT TO: <[email protected]>
[2017-02-16 14:35:46] DEBUG: [82Suh8w7238+O] S: 250 Accepted
[2017-02-16 14:35:46] DEBUG: [82Suh8w7238+O] C: DATA
[2017-02-16 14:35:46] DEBUG: [82Suh8w7238+O] S: 354 End data with <CR><LF>.<CR><LF>
[2017-02-16 14:35:46] DEBUG: [82Suh8w7238+O] C: <706 bytes of DATA>
[2017-02-16 14:35:46] DEBUG: [82Suh8w7238+O] S: 250 OK: message queued
[2017-02-16 14:35:46] DEBUG: [82Suh8w7238+O] C: QUIT
[2017-02-16 14:35:46] DEBUG: [82Suh8w7238+O] S: 221 Bye
[2017-02-16 14:35:46] INFO: [82Suh8w7238+O] Connection closed to [127.0.0.1]
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "smtp-dump",
"version": "0.0.2",
"description": "SMTP Server that outputs all receiving mails",
"description": "SMTP Server that dumps all receiving mails to disk",
"main": "smtp-dump.js",
"scripts": {
"start": "node smtp-dump.js",
Expand Down

0 comments on commit 8826180

Please sign in to comment.