mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-12 02:42:48 +00:00
updated bunch of file paths and changed the way posts are loaded
This commit is contained in:
20
node_modules/smtp-connection/.jshintrc
generated
vendored
Normal file
20
node_modules/smtp-connection/.jshintrc
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"indent": 4,
|
||||
"node": true,
|
||||
"globalstrict": true,
|
||||
"evil": true,
|
||||
"unused": true,
|
||||
"undef": true,
|
||||
"newcap": true,
|
||||
"esnext": true,
|
||||
"curly": true,
|
||||
"eqeqeq": true,
|
||||
"expr": true,
|
||||
|
||||
"predef": [
|
||||
"describe",
|
||||
"it",
|
||||
"beforeEach",
|
||||
"afterEach"
|
||||
]
|
||||
}
|
||||
3
node_modules/smtp-connection/.npmignore
generated
vendored
Normal file
3
node_modules/smtp-connection/.npmignore
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
.travis.yml
|
||||
test
|
||||
examples
|
||||
48
node_modules/smtp-connection/CHANGELOG.md
generated
vendored
Normal file
48
node_modules/smtp-connection/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
# Changelog
|
||||
|
||||
## v1.3.8 2015-12-29
|
||||
|
||||
* Do not use strict isEmail function, just check that there are no newlines in addresses. Fixes a regression with lax e-mail addresses.
|
||||
|
||||
## v1.3.7 2015-12-22
|
||||
|
||||
* Fixed an issue with Node v0.10 where too many events were cleared
|
||||
|
||||
## v1.3.6 2015-12-19
|
||||
|
||||
* Updated isemail configuration to only allow SMTP compatible e-mail addresses for the envelope (otherwise valid addresses might include symbols that don't play well with SMTP, eg. line folding inside quoted strings)
|
||||
|
||||
## v1.3.5 2015-12-19
|
||||
|
||||
* Validate to and from address to be valid e-mail addresses
|
||||
|
||||
## v1.3.2 2015-12-16
|
||||
|
||||
* Added missing 'close' and 'end' event handlers for a STARTTLS-upgraded socket
|
||||
|
||||
## v1.3.1 2015-06-30
|
||||
|
||||
* Added partial support for LMTP protocol. Works only with single recipient (does not support multiple responses for DATA command)
|
||||
|
||||
## v1.2.0 2015-03-09
|
||||
|
||||
* Connection object has a new property `secure` that indicates if the current connection is using a secure TLS socket or not
|
||||
* Fixed `requireTLS` where the connection was established insecurely if STARTTLS failed, now it returns an error as it should if STARTTLS fails
|
||||
|
||||
## v1.1.0 2014-11-11
|
||||
|
||||
* Added additional constructor option `requireTLS` to ensure that the connection is upgraded before any credentials are passed to the server
|
||||
* Added additional constructor option `socket` to use an existing socket instead of creating new one (bantu)
|
||||
|
||||
## v1.0.2 2014-10-15
|
||||
|
||||
* Removed CleartextStream.pair.encrypted error handler. Does not seem to be supported by Node v0.11
|
||||
|
||||
## v1.0.1 2014-10-15
|
||||
|
||||
* Added 'error' handler for CleartextStream.pair.encrypted object when connecting to TLS.
|
||||
|
||||
## v1.0.0 2014-09-26
|
||||
|
||||
* Changed version scheme from 0.x to 1.x.
|
||||
* Improved error handling for timeout on creating a connection. Caused issues with `once('error')` handler as an error might have been emitted twice
|
||||
30
node_modules/smtp-connection/Gruntfile.js
generated
vendored
Normal file
30
node_modules/smtp-connection/Gruntfile.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function(grunt) {
|
||||
|
||||
// Project configuration.
|
||||
grunt.initConfig({
|
||||
jshint: {
|
||||
all: ['src/*.js', 'test/*.js'],
|
||||
options: {
|
||||
jshintrc: '.jshintrc'
|
||||
}
|
||||
},
|
||||
|
||||
mochaTest: {
|
||||
all: {
|
||||
options: {
|
||||
reporter: 'spec'
|
||||
},
|
||||
src: ['test/*-test.js']
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Load the plugin(s)
|
||||
grunt.loadNpmTasks('grunt-contrib-jshint');
|
||||
grunt.loadNpmTasks('grunt-mocha-test');
|
||||
|
||||
// Tasks
|
||||
grunt.registerTask('default', ['jshint', 'mochaTest']);
|
||||
};
|
||||
19
node_modules/smtp-connection/LICENSE
generated
vendored
Normal file
19
node_modules/smtp-connection/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
Copyright (c) 2014-2015 Andris Reinman
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
153
node_modules/smtp-connection/README.md
generated
vendored
Normal file
153
node_modules/smtp-connection/README.md
generated
vendored
Normal file
@@ -0,0 +1,153 @@
|
||||
# smtp-connection
|
||||
|
||||
SMTP client module. Connect to SMTP servers and send mail with it.
|
||||
|
||||
This module is the successor for the client part of the (now deprecated) SMTP module [simplesmtp](https://www.npmjs.com/package/simplesmtp). For matching SMTP server see [smtp-server](https://www.npmjs.com/package/smtp-server).
|
||||
|
||||
[](http://travis-ci.org/andris9/Nodemailer)
|
||||
[](http://badge.fury.io/js/smtp-connection)
|
||||
|
||||
## Usage
|
||||
|
||||
Install with npm
|
||||
|
||||
npm install smtp-connection
|
||||
|
||||
Require in your script
|
||||
|
||||
var SMTPConnection = require('smtp-connection');
|
||||
|
||||
### Create SMTPConnection instance
|
||||
|
||||
```javascript
|
||||
var connection = new SMTPConnection(options);
|
||||
```
|
||||
|
||||
Where
|
||||
|
||||
* **options** defines connection data
|
||||
* **options.port** is the port to connect to (defaults to 25 or 465)
|
||||
* **options.host** is the hostname or IP address to connect to (defaults to 'localhost')
|
||||
* **options.secure** defines if the connection should use SSL (if `true`) or not (if `false`)
|
||||
* **options.ignoreTLS** turns off STARTTLS support if true
|
||||
* **options.requireTLS** forces the client to use STARTTLS. Returns an error if upgrading the connection is not possible or fails.
|
||||
* **options.name** optional hostname of the client, used for identifying to the server
|
||||
* **options.localAddress** is the local interface to bind to for network connections
|
||||
* **options.connectionTimeout** how many milliseconds to wait for the connection to establish
|
||||
* **options.greetingTimeout** how many milliseconds to wait for the greeting after connection is established
|
||||
* **options.socketTimeout** how many milliseconds of inactivity to allow
|
||||
* **options.debug** if true, the connection emits all traffic between client and server as 'log' events
|
||||
* **options.lmtp** if true, uses LMTP instead of SMTP to talk to the server. Partial support, does not work well with multiple recipients
|
||||
* **options.authMethod** defines preferred authentication method, e.g. 'PLAIN'
|
||||
* **options.tls** defines additional options to be passed to the socket constructor, e.g. *{rejectUnauthorized: true}*
|
||||
* **options.socket** - existing socket to use instead of creating a new one
|
||||
|
||||
### Events
|
||||
|
||||
SMTPConnection instances are event emitters with the following events
|
||||
|
||||
* **'error'** *(err)* emitted when an error occurs. Connection is closed automatically in this case.
|
||||
* **'connect'** emitted when the connection is established
|
||||
* **'end'** when the instance is destroyed
|
||||
* **'log'** *(data)* emitted for all traffic when debug option is set to true
|
||||
|
||||
### connect
|
||||
|
||||
Establish the connection
|
||||
|
||||
```javascript
|
||||
connection.connect(callback)
|
||||
```
|
||||
|
||||
Where
|
||||
|
||||
* **callback** is the function to run once the connection is established. The function is added as a listener to the 'connect' event.
|
||||
|
||||
After the connect event the `connection` has the following properties:
|
||||
|
||||
* **connection.secure** - if `true` then the connection uses a TLS socket, otherwise it is using a cleartext socket. Connection can start out as cleartext but if available (or `requireTLS` is set to true) connection upgrade is tried
|
||||
|
||||
### login
|
||||
|
||||
If the server requires authentication you can login with
|
||||
|
||||
```javascript
|
||||
connection.login(auth, callback)
|
||||
```
|
||||
|
||||
Where
|
||||
|
||||
* **auth** is the authentication object
|
||||
* **auth.user** is the username
|
||||
* **auth.pass** is the password for the user
|
||||
* **auth.xoauth2** is the OAuth2 access token (preferred if both `pass` and `xoauth2` values are set) or an [XOAuth2](https://github.com/andris9/xoauth2) token generator object.
|
||||
* **callback** is the callback to run once the authentication is finished. Callback has the following arguments
|
||||
* **err** and error object if authentication failed
|
||||
|
||||
If a [XOAuth2](https://github.com/andris9/xoauth2) token generator is used as the value for `auth.xoauth2` then you do not need to set `auth.user`. XOAuth2 generator generates required accessToken itself if it is missing or expired. In this case if the authentication fails, a new token is requeested and the authentication is retried. If it still fails, an error is returned.
|
||||
|
||||
**XOAuth2 Example**
|
||||
|
||||
```javascript
|
||||
var generator = require('xoauth2').createXOAuth2Generator({
|
||||
user: '{username}',
|
||||
clientId: '{Client ID}',
|
||||
clientSecret: '{Client Secret}',
|
||||
refreshToken: '{refresh-token}'
|
||||
});
|
||||
|
||||
// listen for token updates
|
||||
// you probably want to store these to a db
|
||||
generator.on('token', function(token){
|
||||
console.log('New token for %s: %s', token.user, token.accessToken);
|
||||
});
|
||||
|
||||
// login
|
||||
connection.login({
|
||||
xoauth2: generator
|
||||
}, callback);
|
||||
```
|
||||
|
||||
### send
|
||||
|
||||
Once the connection is authenticated (or just after connection is established if authentication is not required), you can send mail with
|
||||
|
||||
```javascript
|
||||
connection.send(envelope, message, callback)
|
||||
```
|
||||
|
||||
Where
|
||||
|
||||
* **envelope** is the envelope object to use
|
||||
* **envelope.from** is the sender address
|
||||
* **envelope.to** is the recipient address or an array of addresses
|
||||
* **message** is either a String, Buffer or a Stream. All newlines are converted to \r\n and all dots are escaped automatically, no need to convert anything before.
|
||||
* **callback** is the callback to run once the sending is finished or failed. Callback has the following arguments
|
||||
* **err** and error object if sending failed
|
||||
* **code** string code identifying the error, for example 'EAUTH' is returned when authentication fails
|
||||
* **response** is the last response received from the server (if the error is caused by an error response from the server)
|
||||
* **responseCode** is the numeric response code of the `response` string (if available)
|
||||
* **info** information object about accepted and rejected recipients
|
||||
* **accepted** and array of accepted recipient addresses
|
||||
* **rejected** and array of rejected recipient addresses
|
||||
* **response** is the last response received from the server
|
||||
|
||||
### quit
|
||||
|
||||
Use it for graceful disconnect
|
||||
|
||||
```javascript
|
||||
connection.quit();
|
||||
```
|
||||
|
||||
### close
|
||||
|
||||
Use it for less graceful disconnect
|
||||
|
||||
```javascript
|
||||
connection.close();
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
**MIT**
|
||||
86
node_modules/smtp-connection/package.json
generated
vendored
Normal file
86
node_modules/smtp-connection/package.json
generated
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"smtp-connection@^1.3.1",
|
||||
"/home/mitchell/Desktop/test-mywebsite/mywebsite/node_modules/nodemailer-direct-transport"
|
||||
]
|
||||
],
|
||||
"_from": "smtp-connection@>=1.3.1 <2.0.0",
|
||||
"_id": "smtp-connection@1.3.8",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/smtp-connection",
|
||||
"_nodeVersion": "5.3.0",
|
||||
"_npmUser": {
|
||||
"email": "andris@kreata.ee",
|
||||
"name": "andris"
|
||||
},
|
||||
"_npmVersion": "3.3.12",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "smtp-connection",
|
||||
"raw": "smtp-connection@^1.3.1",
|
||||
"rawSpec": "^1.3.1",
|
||||
"scope": null,
|
||||
"spec": ">=1.3.1 <2.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/nodemailer-direct-transport",
|
||||
"/nodemailer-smtp-transport"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/smtp-connection/-/smtp-connection-1.3.8.tgz",
|
||||
"_shasum": "55832c2160cfb3086e1dcd87fd1c19fa61b7f536",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "smtp-connection@^1.3.1",
|
||||
"_where": "/home/mitchell/Desktop/test-mywebsite/mywebsite/node_modules/nodemailer-direct-transport",
|
||||
"author": {
|
||||
"name": "Andris Reinman"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/andris9/smtp-connection/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "Connect to SMTP servers",
|
||||
"devDependencies": {
|
||||
"chai": "^3.4.1",
|
||||
"grunt": "^0.4.5",
|
||||
"grunt-contrib-jshint": "^0.11.3",
|
||||
"grunt-mocha-test": "^0.12.7",
|
||||
"mocha": "^2.3.4",
|
||||
"sinon": "^1.17.2",
|
||||
"smtp-server": "^1.7.1",
|
||||
"xoauth2": "^1.1.0"
|
||||
},
|
||||
"directories": {
|
||||
"test": "test"
|
||||
},
|
||||
"dist": {
|
||||
"shasum": "55832c2160cfb3086e1dcd87fd1c19fa61b7f536",
|
||||
"tarball": "http://registry.npmjs.org/smtp-connection/-/smtp-connection-1.3.8.tgz"
|
||||
},
|
||||
"gitHead": "e4f8d186c90435e58147d022a5185db46c8255c2",
|
||||
"homepage": "https://github.com/andris9/smtp-connection",
|
||||
"keywords": [
|
||||
"SMTP"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "src/smtp-connection.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "andris",
|
||||
"email": "andris@node.ee"
|
||||
}
|
||||
],
|
||||
"name": "smtp-connection",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/andris9/smtp-connection.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "grunt"
|
||||
},
|
||||
"version": "1.3.8"
|
||||
}
|
||||
104
node_modules/smtp-connection/src/data-stream.js
generated
vendored
Normal file
104
node_modules/smtp-connection/src/data-stream.js
generated
vendored
Normal file
@@ -0,0 +1,104 @@
|
||||
'use strict';
|
||||
|
||||
var stream = require('stream');
|
||||
var Transform = stream.Transform;
|
||||
var util = require('util');
|
||||
|
||||
module.exports = DataStream;
|
||||
|
||||
/**
|
||||
* Escapes dots in the beginning of lines. Ends the stream with <CR><LF>.<CR><LF>
|
||||
* Also makes sure that only <CR><LF> sequences are used for linebreaks
|
||||
*
|
||||
* @param {Object} options Stream options
|
||||
*/
|
||||
function DataStream(options) {
|
||||
// init Transform
|
||||
this.options = options || {};
|
||||
this._curLine = '';
|
||||
|
||||
this.lastByte = false;
|
||||
|
||||
Transform.call(this, this.options);
|
||||
}
|
||||
util.inherits(DataStream, Transform);
|
||||
|
||||
/**
|
||||
* Escapes dots
|
||||
*/
|
||||
DataStream.prototype._transform = function(chunk, encoding, done) {
|
||||
var chunks = [];
|
||||
var chunklen = 0;
|
||||
var i, len, lastPos = 0;
|
||||
var buf;
|
||||
|
||||
if (!chunk || !chunk.length) {
|
||||
return done();
|
||||
}
|
||||
|
||||
if (typeof chunk === 'string') {
|
||||
chunk = new Buffer(chunk);
|
||||
}
|
||||
|
||||
for (i = 0, len = chunk.length; i < len; i++) {
|
||||
if (chunk[i] === 0x2E) { // .
|
||||
if (
|
||||
(i && chunk[i - 1] === 0x0A) ||
|
||||
(!i && (!this.lastByte || this.lastByte === 0x0A))
|
||||
) {
|
||||
buf = chunk.slice(lastPos, i + 1);
|
||||
chunks.push(buf);
|
||||
chunks.push(new Buffer('.'));
|
||||
chunklen += buf.length + 1;
|
||||
lastPos = i + 1;
|
||||
}
|
||||
} else if (chunk[i] === 0x0A) { // .
|
||||
if (
|
||||
(i && chunk[i - 1] !== 0x0D) ||
|
||||
(!i && this.lastByte !== 0x0D)
|
||||
) {
|
||||
if (i > lastPos) {
|
||||
buf = chunk.slice(lastPos, i);
|
||||
chunks.push(buf);
|
||||
chunklen += buf.length + 2;
|
||||
} else {
|
||||
chunklen += 2;
|
||||
}
|
||||
chunks.push(new Buffer('\r\n'));
|
||||
lastPos = i + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (chunklen) {
|
||||
// add last piece
|
||||
if (lastPos < chunk.length) {
|
||||
buf = chunk.slice(lastPos);
|
||||
chunks.push(buf);
|
||||
chunklen += buf.length;
|
||||
}
|
||||
|
||||
this.push(Buffer.concat(chunks, chunklen));
|
||||
} else {
|
||||
this.push(chunk);
|
||||
}
|
||||
|
||||
this.lastByte = chunk[chunk.length - 1];
|
||||
done();
|
||||
};
|
||||
|
||||
/**
|
||||
* Finalizes the stream with a dot on a single line
|
||||
*/
|
||||
DataStream.prototype._flush = function(done) {
|
||||
var buf;
|
||||
if (this.lastByte === 0x0A) {
|
||||
buf = new Buffer('.\r\n');
|
||||
} else if (this.lastByte === 0x0D) {
|
||||
buf = new Buffer('\n.\r\n');
|
||||
} else {
|
||||
buf = new Buffer('\r\n.\r\n');
|
||||
}
|
||||
this.push(buf);
|
||||
done();
|
||||
};
|
||||
1019
node_modules/smtp-connection/src/smtp-connection.js
generated
vendored
Normal file
1019
node_modules/smtp-connection/src/smtp-connection.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user