diff --git a/README.md b/README.md index 2f74dc5..83dbdbd 100644 --- a/README.md +++ b/README.md @@ -2,24 +2,27 @@ NodeJS SMTP Server that dumps all received mails ## Install +After cloning the repository + npm install ## Use + node smtp-dump.js -smtp-dump.js will output all received E-Mails into the "ouput" folder while running. +smtp-dump.js will output all received E-Mails into the output folder (default _"output"_) while running. ### Arguments -Specify the logging destination by passing a path to _--output_ (Default is _output_). -Creates the directory if it does not exist +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 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 diff --git a/package.json b/package.json index ab4e660..2fdf4d9 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,10 @@ { "name": "smtp-dump", - "version": "0.0.1", + "version": "0.0.2", "description": "SMTP Server that outputs all receiving mails", "main": "smtp-dump.js", "scripts": { + "start": "node smtp-dump.js", "test": "echo \"Error: no test specified\" && exit 1" }, "author": "Tim Steufmehl ", diff --git a/smtp-dump.js b/smtp-dump.js index b1eacf2..8d2fd8a 100644 --- a/smtp-dump.js +++ b/smtp-dump.js @@ -7,8 +7,8 @@ var argv = require('minimist')(process.argv.slice(2)), // default values var config = { output: 'output', - logger: false, - port: 25 + port: 25, + logger: false }; // overwrite default config values with arguments @@ -31,10 +31,10 @@ var server = new SMTPServer({ } } - // filename will consist of DateTime ... + // filename will consist of current DateTime ... var filename = dateFormat(new Date(), 'yyyy-mm-dd HH-MM-ss'); if(session.envelope.rcptTo.length >= 1) { - // ... and first recipient if existent + // ... and first recipient E-Mail-Adress if existent filename += ' ' + session.envelope.rcptTo[0].address; }