From d2d3aafe435b45c97f416c21526bef2e479d3711 Mon Sep 17 00:00:00 2001 From: Florent Galland Date: Mon, 13 Apr 2015 14:37:25 +0200 Subject: [PATCH] Update doc. Closes #36. --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 071f997..d0e7186 100644 --- a/README.md +++ b/README.md @@ -127,8 +127,7 @@ The webhook payload is a multipart form with a ```mailinMsg``` fields always pre * ```error: listen EADDRINUSE```: the current port is already used by something. Most likely, you are trying to use port 25 and your machine's [mail transport agent](http://en.wikipedia.org/wiki/Message_transfer_agent) is already running. Stop it with something like ```sudo service exim4 stop``` or ```sudo service postfix stop``` before using Mailin. * ```error: Unable to compute spam score ECONNREFUSED```: it is likely that spamassassin is not enabled on your machine, check the ```/etc/default/spamassassin``` file. * ```node: command not found```: most likely, your system does not have node installed or it is installed with a different name. For instance on Debian/Ubuntu, the node interpreter is called nodejs. The quick fix is making a symlink: ```ln -s $(which nodejs) /usr/bin/node``` to make the node command available. -* ```Uncaught SenderError: Mail from command failed - 450 4.1.8 : Sender address rejected: Domain not found -``` +* ```Uncaught SenderError: Mail from command failed - 450 4.1.8 : Sender address rejected: Domain not found```: The smtpOption `disableDNSValidation` is set to `false` and an email was sent from an invalid domain. ####Embedded inside a node application @@ -151,7 +150,10 @@ var mailin = require('mailin'); * logFile: '/some/local/path', * logLevel: 'warn', // One of silly, info, debug, warn, error * smtpOptions: { // Set of options directly passed to simplesmtp.createServer(smtpOptions) - * SMTPBanner: 'Hi from a custom Mailin instance' + * SMTPBanner: 'Hi from a custom Mailin instance', + * // By default, the DNS validation of the sender and recipient domains is disabled so. + * // You can enable it as follows: + * disableDNSValidation: false * } * }; * Here disable the webhook posting so that you can do what you want with the @@ -197,7 +199,9 @@ mailin.on('message', function (connection, data, content) { * **dataReady** *(connection, callback)* - Client has finished passing e-mail data. `callback` returns the queue id to the client. * **authorizeUser** *(connection, username, password, callback)* - Emitted if `requireAuthentication` option is set to true. `callback` has two parameters *(err, success)* where `success` is a Boolean and should be true, if user is authenticated successfully. * **validateSender** *(connection, email, callback)* - Emitted if `validateSender` listener is set up. + * **senderValidationFailed** *(connection, email, callback)* - Emitted if a sender DNS validation failed. * **validateRecipient** *(connection, email, callback)* - Emitted if `validateRecipients` listener is set up. + * **recipientValidationFailed** *(connection, email, callback)* - Emitted if a recipient DNS validation failed. * **close** *(connection)* - Emitted when the connection to a client is closed. * **startMessage** *(connection)* - Connection with the Mailin smtp server is initiated. * **message** *(connection, data, content)* - Message was received and parsed.