m0603va 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/Laba6/file1.js +23 -0
  2. package/Laba6/file2.js +23 -0
  3. package/Laba6/index.html +63 -0
  4. package/Laba6/m0603.js +29 -0
  5. package/Laba6/node_modules/.package-lock.json +83 -0
  6. package/Laba6/node_modules/httpntlm/.jshintrc +4 -0
  7. package/Laba6/node_modules/httpntlm/LICENSE +20 -0
  8. package/Laba6/node_modules/httpntlm/README.md +148 -0
  9. package/Laba6/node_modules/httpntlm/httpntlm.js +104 -0
  10. package/Laba6/node_modules/httpntlm/ntlm.js +390 -0
  11. package/Laba6/node_modules/httpntlm/package.json +33 -0
  12. package/Laba6/node_modules/httpreq/LICENSE +19 -0
  13. package/Laba6/node_modules/httpreq/README.md +383 -0
  14. package/Laba6/node_modules/httpreq/contributors.md +26 -0
  15. package/Laba6/node_modules/httpreq/lib/httpreq.js +681 -0
  16. package/Laba6/node_modules/httpreq/package.json +102 -0
  17. package/Laba6/node_modules/m0603sol/m0603.js +29 -0
  18. package/Laba6/node_modules/m0603sol/package.json +12 -0
  19. package/Laba6/node_modules/nodemailer/.gitattributes +6 -0
  20. package/Laba6/node_modules/nodemailer/.prettierrc.js +8 -0
  21. package/Laba6/node_modules/nodemailer/CHANGELOG.md +725 -0
  22. package/Laba6/node_modules/nodemailer/CODE_OF_CONDUCT.md +76 -0
  23. package/Laba6/node_modules/nodemailer/CONTRIBUTING.md +67 -0
  24. package/Laba6/node_modules/nodemailer/LICENSE +16 -0
  25. package/Laba6/node_modules/nodemailer/README.md +97 -0
  26. package/Laba6/node_modules/nodemailer/SECURITY.txt +22 -0
  27. package/Laba6/node_modules/nodemailer/lib/addressparser/index.js +313 -0
  28. package/Laba6/node_modules/nodemailer/lib/base64/index.js +142 -0
  29. package/Laba6/node_modules/nodemailer/lib/dkim/index.js +251 -0
  30. package/Laba6/node_modules/nodemailer/lib/dkim/message-parser.js +155 -0
  31. package/Laba6/node_modules/nodemailer/lib/dkim/relaxed-body.js +154 -0
  32. package/Laba6/node_modules/nodemailer/lib/dkim/sign.js +117 -0
  33. package/Laba6/node_modules/nodemailer/lib/fetch/cookies.js +281 -0
  34. package/Laba6/node_modules/nodemailer/lib/fetch/index.js +274 -0
  35. package/Laba6/node_modules/nodemailer/lib/json-transport/index.js +82 -0
  36. package/Laba6/node_modules/nodemailer/lib/mail-composer/index.js +558 -0
  37. package/Laba6/node_modules/nodemailer/lib/mailer/index.js +427 -0
  38. package/Laba6/node_modules/nodemailer/lib/mailer/mail-message.js +315 -0
  39. package/Laba6/node_modules/nodemailer/lib/mime-funcs/index.js +625 -0
  40. package/Laba6/node_modules/nodemailer/lib/mime-funcs/mime-types.js +2102 -0
  41. package/Laba6/node_modules/nodemailer/lib/mime-node/index.js +1290 -0
  42. package/Laba6/node_modules/nodemailer/lib/mime-node/last-newline.js +33 -0
  43. package/Laba6/node_modules/nodemailer/lib/mime-node/le-unix.js +43 -0
  44. package/Laba6/node_modules/nodemailer/lib/mime-node/le-windows.js +52 -0
  45. package/Laba6/node_modules/nodemailer/lib/nodemailer.js +143 -0
  46. package/Laba6/node_modules/nodemailer/lib/qp/index.js +219 -0
  47. package/Laba6/node_modules/nodemailer/lib/sendmail-transport/index.js +210 -0
  48. package/Laba6/node_modules/nodemailer/lib/ses-transport/index.js +349 -0
  49. package/Laba6/node_modules/nodemailer/lib/shared/index.js +638 -0
  50. package/Laba6/node_modules/nodemailer/lib/smtp-connection/data-stream.js +108 -0
  51. package/Laba6/node_modules/nodemailer/lib/smtp-connection/http-proxy-client.js +143 -0
  52. package/Laba6/node_modules/nodemailer/lib/smtp-connection/index.js +1796 -0
  53. package/Laba6/node_modules/nodemailer/lib/smtp-pool/index.js +648 -0
  54. package/Laba6/node_modules/nodemailer/lib/smtp-pool/pool-resource.js +253 -0
  55. package/Laba6/node_modules/nodemailer/lib/smtp-transport/index.js +416 -0
  56. package/Laba6/node_modules/nodemailer/lib/stream-transport/index.js +135 -0
  57. package/Laba6/node_modules/nodemailer/lib/well-known/index.js +47 -0
  58. package/Laba6/node_modules/nodemailer/lib/well-known/services.json +286 -0
  59. package/Laba6/node_modules/nodemailer/lib/xoauth2/index.js +376 -0
  60. package/Laba6/node_modules/nodemailer/package.json +46 -0
  61. package/Laba6/node_modules/nodemailer/postinstall.js +101 -0
  62. package/Laba6/node_modules/nodemailer-fetch/.eslintrc.js +56 -0
  63. package/Laba6/node_modules/nodemailer-fetch/.travis.yml +19 -0
  64. package/Laba6/node_modules/nodemailer-fetch/CHANGELOG.md +30 -0
  65. package/Laba6/node_modules/nodemailer-fetch/Gruntfile.js +27 -0
  66. package/Laba6/node_modules/nodemailer-fetch/LICENSE +16 -0
  67. package/Laba6/node_modules/nodemailer-fetch/README.md +55 -0
  68. package/Laba6/node_modules/nodemailer-fetch/lib/cookies.js +275 -0
  69. package/Laba6/node_modules/nodemailer-fetch/lib/fetch.js +224 -0
  70. package/Laba6/node_modules/nodemailer-fetch/package.json +30 -0
  71. package/Laba6/node_modules/nodemailer-fetch/test/cookies-test.js +391 -0
  72. package/Laba6/node_modules/nodemailer-fetch/test/fetch-test.js +486 -0
  73. package/Laba6/node_modules/nodemailer-shared/.eslintrc.js +59 -0
  74. package/Laba6/node_modules/nodemailer-shared/.travis.yml +18 -0
  75. package/Laba6/node_modules/nodemailer-shared/Gruntfile.js +27 -0
  76. package/Laba6/node_modules/nodemailer-shared/LICENSE +16 -0
  77. package/Laba6/node_modules/nodemailer-shared/README.md +14 -0
  78. package/Laba6/node_modules/nodemailer-shared/lib/shared.js +282 -0
  79. package/Laba6/node_modules/nodemailer-shared/package.json +36 -0
  80. package/Laba6/node_modules/nodemailer-shared/test/fixtures/message.html +1 -0
  81. package/Laba6/node_modules/nodemailer-shared/test/shared-test.js +291 -0
  82. package/Laba6/node_modules/nodemailer-smtp-transport/.eslintrc.js +59 -0
  83. package/Laba6/node_modules/nodemailer-smtp-transport/Gruntfile.js +27 -0
  84. package/Laba6/node_modules/nodemailer-smtp-transport/LICENSE +19 -0
  85. package/Laba6/node_modules/nodemailer-smtp-transport/README.md +7 -0
  86. package/Laba6/node_modules/nodemailer-smtp-transport/lib/smtp-transport.js +281 -0
  87. package/Laba6/node_modules/nodemailer-smtp-transport/package.json +37 -0
  88. package/Laba6/node_modules/nodemailer-wellknown/.travis.yml +17 -0
  89. package/Laba6/node_modules/nodemailer-wellknown/LICENSE +19 -0
  90. package/Laba6/node_modules/nodemailer-wellknown/README.md +80 -0
  91. package/Laba6/node_modules/nodemailer-wellknown/index.js +47 -0
  92. package/Laba6/node_modules/nodemailer-wellknown/package.json +26 -0
  93. package/Laba6/node_modules/nodemailer-wellknown/services.json +255 -0
  94. package/Laba6/node_modules/nodemailer-wellknown/test.js +23 -0
  95. package/Laba6/node_modules/smtp-connection/.eslintrc.js +56 -0
  96. package/Laba6/node_modules/smtp-connection/CHANGELOG.md +164 -0
  97. package/Laba6/node_modules/smtp-connection/Gruntfile.js +27 -0
  98. package/Laba6/node_modules/smtp-connection/LICENSE +19 -0
  99. package/Laba6/node_modules/smtp-connection/README.md +200 -0
  100. package/Laba6/node_modules/smtp-connection/lib/data-stream.js +111 -0
  101. package/Laba6/node_modules/smtp-connection/lib/smtp-connection.js +1443 -0
  102. package/Laba6/node_modules/smtp-connection/package.json +41 -0
  103. package/Laba6/node_modules/underscore/LICENSE +23 -0
  104. package/Laba6/node_modules/underscore/README.md +22 -0
  105. package/Laba6/node_modules/underscore/package.json +41 -0
  106. package/Laba6/node_modules/underscore/underscore-min.js +6 -0
  107. package/Laba6/node_modules/underscore/underscore.js +1415 -0
  108. package/Laba6/package-lock.json +94 -0
  109. package/Laba6/package.json +17 -0
  110. package/Laba6.txt +31 -0
  111. package/file1.js +23 -0
  112. package/file2.js +23 -0
  113. package/index.html +63 -0
  114. package/m0603.js +29 -0
  115. package/m0603Sol/m0603.js +29 -0
  116. package/m0603Sol/package.json +12 -0
  117. package/package.json +17 -0
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2014-2016 Andris Reinman
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
@@ -0,0 +1,7 @@
1
+ # nodemailer-smtp-transport
2
+
3
+ ![Nodemailer](https://raw.githubusercontent.com/nodemailer/nodemailer/master/assets/nm_logo_200x136.png)
4
+
5
+ SMTP module with for Nodemailer.
6
+
7
+ See [Nodemailer homepage](https://nodemailer.com/smtp/) for documentation and terms of using SMTP.
@@ -0,0 +1,281 @@
1
+ 'use strict';
2
+
3
+ var SMTPConnection = require('smtp-connection');
4
+ var packageData = require('../package.json');
5
+ var wellknown = require('nodemailer-wellknown');
6
+ var shared = require('nodemailer-shared');
7
+
8
+ var EventEmitter = require('events').EventEmitter;
9
+ var util = require('util');
10
+
11
+ // expose to the world
12
+ module.exports = function (options) {
13
+ return new SMTPTransport(options);
14
+ };
15
+
16
+ /**
17
+ * Creates a SMTP transport object for Nodemailer
18
+ *
19
+ * @constructor
20
+ * @param {Object} options Connection options
21
+ */
22
+ function SMTPTransport(options) {
23
+ EventEmitter.call(this);
24
+
25
+ options = options || {};
26
+ if (typeof options === 'string') {
27
+ options = {
28
+ url: options
29
+ };
30
+ }
31
+
32
+ var urlData;
33
+ var service = options.service;
34
+
35
+ if (typeof options.getSocket === 'function') {
36
+ this.getSocket = options.getSocket;
37
+ }
38
+
39
+ if (options.url) {
40
+ urlData = shared.parseConnectionUrl(options.url);
41
+ service = service || urlData.service;
42
+ }
43
+
44
+ this.options = assign(
45
+ false, // create new object
46
+ options, // regular options
47
+ urlData, // url options
48
+ service && wellknown(service) // wellknown options
49
+ );
50
+
51
+ this.logger = shared.getLogger(this.options);
52
+
53
+ // temporary object
54
+ var connection = new SMTPConnection(this.options);
55
+
56
+ this.name = 'SMTP';
57
+ this.version = packageData.version + '[client:' + connection.version + ']';
58
+ }
59
+ util.inherits(SMTPTransport, EventEmitter);
60
+
61
+ /**
62
+ * Placeholder function for creating proxy sockets. This method immediatelly returns
63
+ * without a socket
64
+ *
65
+ * @param {Object} options Connection options
66
+ * @param {Function} callback Callback function to run with the socket keys
67
+ */
68
+ SMTPTransport.prototype.getSocket = function (options, callback) {
69
+ // return immediatelly
70
+ return callback(null, false);
71
+ };
72
+
73
+ /**
74
+ * Sends an e-mail using the selected settings
75
+ *
76
+ * @param {Object} mail Mail object
77
+ * @param {Function} callback Callback function
78
+ */
79
+ SMTPTransport.prototype.send = function (mail, callback) {
80
+
81
+ this.getSocket(this.options, function (err, socketOptions) {
82
+ if (err) {
83
+ return callback(err);
84
+ }
85
+
86
+ var options = this.options;
87
+ if (socketOptions && socketOptions.connection) {
88
+ this.logger.info('Using proxied socket from %s:%s to %s:%s', socketOptions.connection.remoteAddress, socketOptions.connection.remotePort, options.host || '', options.port || '');
89
+ // only copy options if we need to modify it
90
+ options = assign(false, options);
91
+ Object.keys(socketOptions).forEach(function (key) {
92
+ options[key] = socketOptions[key];
93
+ });
94
+ }
95
+
96
+ var connection = new SMTPConnection(options);
97
+ var returned = false;
98
+
99
+ connection.once('error', function (err) {
100
+ if (returned) {
101
+ return;
102
+ }
103
+ returned = true;
104
+ connection.close();
105
+ return callback(err);
106
+ });
107
+
108
+ connection.once('end', function () {
109
+ if (returned) {
110
+ return;
111
+ }
112
+ returned = true;
113
+ return callback(new Error('Connection closed'));
114
+ });
115
+
116
+ var sendMessage = function () {
117
+ var envelope = mail.message.getEnvelope();
118
+ var messageId = (mail.message.getHeader('message-id') || '').replace(/[<>\s]/g, '');
119
+ var recipients = [].concat(envelope.to || []);
120
+ if (recipients.length > 3) {
121
+ recipients.push('...and ' + recipients.splice(2).length + ' more');
122
+ }
123
+
124
+ this.logger.info('Sending message <%s> to <%s>', messageId, recipients.join(', '));
125
+
126
+ connection.send(envelope, mail.message.createReadStream(), function (err, info) {
127
+ if (returned) {
128
+ return;
129
+ }
130
+ returned = true;
131
+
132
+ connection.close();
133
+ if (err) {
134
+ return callback(err);
135
+ }
136
+ info.envelope = {
137
+ from: envelope.from,
138
+ to: envelope.to
139
+ };
140
+ info.messageId = messageId;
141
+ return callback(null, info);
142
+ });
143
+ }.bind(this);
144
+
145
+ connection.connect(function () {
146
+ if (returned) {
147
+ return;
148
+ }
149
+
150
+ if (this.options.auth) {
151
+ connection.login(this.options.auth, function (err) {
152
+ if (returned) {
153
+ return;
154
+ }
155
+
156
+ if (err) {
157
+ returned = true;
158
+ connection.close();
159
+ return callback(err);
160
+ }
161
+
162
+ sendMessage();
163
+ });
164
+ } else {
165
+ sendMessage();
166
+ }
167
+ }.bind(this));
168
+ }.bind(this));
169
+ };
170
+
171
+ /**
172
+ * Verifies SMTP configuration
173
+ *
174
+ * @param {Function} callback Callback function
175
+ */
176
+ SMTPTransport.prototype.verify = function (callback) {
177
+ var promise;
178
+
179
+ if (!callback && typeof Promise === 'function') {
180
+ promise = new Promise(function (resolve, reject) {
181
+ callback = shared.callbackPromise(resolve, reject);
182
+ });
183
+ }
184
+
185
+ this.getSocket(this.options, function (err, socketOptions) {
186
+ if (err) {
187
+ return callback(err);
188
+ }
189
+
190
+ var options = this.options;
191
+ if (socketOptions && socketOptions.connection) {
192
+ this.logger.info('Using proxied socket from %s:%s', socketOptions.connection.remoteAddress, socketOptions.connection.remotePort);
193
+ options = assign(false, options);
194
+ Object.keys(socketOptions).forEach(function (key) {
195
+ options[key] = socketOptions[key];
196
+ });
197
+ }
198
+
199
+ var connection = new SMTPConnection(options);
200
+ var returned = false;
201
+
202
+ connection.once('error', function (err) {
203
+ if (returned) {
204
+ return;
205
+ }
206
+ returned = true;
207
+ connection.close();
208
+ return callback(err);
209
+ });
210
+
211
+ connection.once('end', function () {
212
+ if (returned) {
213
+ return;
214
+ }
215
+ returned = true;
216
+ return callback(new Error('Connection closed'));
217
+ });
218
+
219
+ var finalize = function () {
220
+ if (returned) {
221
+ return;
222
+ }
223
+ returned = true;
224
+ connection.quit();
225
+ return callback(null, true);
226
+ };
227
+
228
+ connection.connect(function () {
229
+ if (returned) {
230
+ return;
231
+ }
232
+
233
+ if (this.options.auth) {
234
+ connection.login(this.options.auth, function (err) {
235
+ if (returned) {
236
+ return;
237
+ }
238
+
239
+ if (err) {
240
+ returned = true;
241
+ connection.close();
242
+ return callback(err);
243
+ }
244
+
245
+ finalize();
246
+ });
247
+ } else {
248
+ finalize();
249
+ }
250
+ }.bind(this));
251
+ }.bind(this));
252
+
253
+ return promise;
254
+ };
255
+
256
+ /**
257
+ * Copies properties from source objects to target objects
258
+ */
259
+ function assign( /* target, ... sources */ ) {
260
+ var args = Array.prototype.slice.call(arguments);
261
+ var target = args.shift() || {};
262
+
263
+ args.forEach(function (source) {
264
+ Object.keys(source || {}).forEach(function (key) {
265
+ if (['tls', 'auth'].indexOf(key) >= 0 && source[key] && typeof source[key] === 'object') {
266
+ // tls and auth are special keys that need to be enumerated separately
267
+ // other objects are passed as is
268
+ if (!target[key]) {
269
+ // esnure that target has this key
270
+ target[key] = {};
271
+ }
272
+ Object.keys(source[key]).forEach(function (subKey) {
273
+ target[key][subKey] = source[key][subKey];
274
+ });
275
+ } else {
276
+ target[key] = source[key];
277
+ }
278
+ });
279
+ });
280
+ return target;
281
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "nodemailer-smtp-transport",
3
+ "version": "2.7.4",
4
+ "description": "SMTP transport for Nodemailer",
5
+ "main": "lib/smtp-transport.js",
6
+ "scripts": {
7
+ "test": "grunt mochaTest"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git://github.com/andris9/nodemailer-smtp-transport.git"
12
+ },
13
+ "keywords": [
14
+ "SMTP",
15
+ "Nodemailer"
16
+ ],
17
+ "author": "Andris Reinman",
18
+ "license": "MIT",
19
+ "bugs": {
20
+ "url": "https://github.com/andris9/nodemailer-smtp-transport/issues"
21
+ },
22
+ "homepage": "http://github.com/andris9/nodemailer-smtp-transport",
23
+ "dependencies": {
24
+ "nodemailer-shared": "1.1.0",
25
+ "nodemailer-wellknown": "0.1.10",
26
+ "smtp-connection": "2.12.0"
27
+ },
28
+ "devDependencies": {
29
+ "chai": "^3.5.0",
30
+ "grunt": "^1.0.1",
31
+ "grunt-cli": "^1.2.0",
32
+ "grunt-eslint": "^19.0.0",
33
+ "grunt-mocha-test": "^0.12.7",
34
+ "mocha": "^3.0.2",
35
+ "smtp-server": "^1.14.2"
36
+ }
37
+ }
@@ -0,0 +1,17 @@
1
+ language: node_js
2
+ sudo: false
3
+ node_js:
4
+ - "0.10"
5
+ - 0.12
6
+ - iojs
7
+ - 4
8
+ - 5
9
+ notifications:
10
+ email:
11
+ - andris@kreata.ee
12
+ webhooks:
13
+ urls:
14
+ - https://webhooks.gitter.im/e/0ed18fd9b3e529b3c2cc
15
+ on_success: change # options: [always|never|change] default: always
16
+ on_failure: always # options: [always|never|change] default: always
17
+ on_start: false # default: false
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2014-2016 Andris Reinman
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
@@ -0,0 +1,80 @@
1
+ # Nodemailer Well-Known Services
2
+
3
+ Returns SMTP configuration for well-known services
4
+
5
+ ## Usage
6
+
7
+ Install with npm
8
+
9
+ npm install nodemailer-wellknown
10
+
11
+ Require in your script
12
+
13
+ ```javascript
14
+ var wellknown = require('nodemailer-wellknown');
15
+ ```
16
+
17
+ Resolve SMTP settings
18
+
19
+ ```javascript
20
+ var config = wellknown('Gmail');
21
+ // { host: 'smtp.gmail.com',
22
+ // port: 465,
23
+ // secure: true }
24
+ ```
25
+
26
+ ## Supported services
27
+
28
+ Service names are case insensitive
29
+
30
+ * **'1und1'**
31
+ * **'AOL'**
32
+ * **'DebugMail.io'**
33
+ * **'DynectEmail'**
34
+ * **'FastMail'**
35
+ * **'GandiMail'**
36
+ * **'Gmail'**
37
+ * **'Godaddy'**
38
+ * **'GodaddyAsia'**
39
+ * **'GodaddyEurope'**
40
+ * **'hot.ee'**
41
+ * **'Hotmail'**
42
+ * **'iCloud'**
43
+ * **'mail.ee'**
44
+ * **'Mail.ru'**
45
+ * **'Mailgun'**
46
+ * **'Mailjet'**
47
+ * **'Mandrill'**
48
+ * **'Naver'**
49
+ * **'OpenMailBox'**
50
+ * **'Postmark'**
51
+ * **'QQ'**
52
+ * **'QQex'**
53
+ * **'SendCloud'**
54
+ * **'SendGrid'**
55
+ * **'SES'**
56
+ * **'SES-US-EAST-1'**
57
+ * **'SES-US-WEST-2'**
58
+ * **'SES-EU-WEST-1'**
59
+ * **'Sparkpost'**
60
+ * **'Yahoo'**
61
+ * **'Yandex'**
62
+ * **'Zoho'**
63
+
64
+ ### Example usage with Nodemailer
65
+
66
+ > **NB!** This repo might be updated more often than Nodemailer itself, so in case
67
+ > a wellknown host is not working, check that you have the latest version of
68
+ > nodemailer-wellknown installed in your node_modules. Otherwise the data you try
69
+ > to use might be still missing.
70
+
71
+ ```javascript
72
+ var transporter = nodemailer.createTransport({
73
+ service: 'postmark' // <- resolved as 'Postmark' from the wellknown info
74
+ auth: {...}
75
+ });
76
+ ```
77
+
78
+ ## License
79
+
80
+ **MIT**
@@ -0,0 +1,47 @@
1
+ 'use strict';
2
+
3
+ var services = require('./services.json');
4
+ var normalized = {};
5
+
6
+ Object.keys(services).forEach(function(key) {
7
+ var service = services[key];
8
+
9
+ normalized[normalizeKey(key)] = normalizeService(service);
10
+
11
+ [].concat(service.aliases || []).forEach(function(alias) {
12
+ normalized[normalizeKey(alias)] = normalizeService(service);
13
+ });
14
+
15
+ [].concat(service.domains || []).forEach(function(domain) {
16
+ normalized[normalizeKey(domain)] = normalizeService(service);
17
+ });
18
+ });
19
+
20
+ function normalizeKey(key) {
21
+ return key.replace(/[^a-zA-Z0-9.\-]/g, '').toLowerCase();
22
+ }
23
+
24
+ function normalizeService(service) {
25
+ var filter = ['domains', 'aliases'];
26
+ var response = {};
27
+
28
+ Object.keys(service).forEach(function(key) {
29
+ if (filter.indexOf(key) < 0) {
30
+ response[key] = service[key];
31
+ }
32
+ });
33
+
34
+ return response;
35
+ }
36
+
37
+ /**
38
+ * Resolves SMTP config for given key. Key can be a name (like 'Gmail'), alias (like 'Google Mail') or
39
+ * an email address (like 'test@googlemail.com').
40
+ *
41
+ * @param {String} key [description]
42
+ * @returns {Object} SMTP config or false if not found
43
+ */
44
+ module.exports = function(key) {
45
+ key = normalizeKey(key.split('@').pop());
46
+ return normalized[key] || false;
47
+ };
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "nodemailer-wellknown",
3
+ "version": "0.1.10",
4
+ "description": "Well known SMTP services",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "nodeunit test.js"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git://github.com/andris9/nodemailer-wellknown.git"
12
+ },
13
+ "keywords": [
14
+ "SMTP",
15
+ "Nodemailer"
16
+ ],
17
+ "author": "Andris Reinman",
18
+ "license": "MIT",
19
+ "bugs": {
20
+ "url": "https://github.com/andris9/nodemailer-wellknown/issues"
21
+ },
22
+ "homepage": "https://github.com/andris9/nodemailer-wellknown",
23
+ "devDependencies": {
24
+ "nodeunit": "^0.9.1"
25
+ }
26
+ }