-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
65 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters