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,200 @@
1
+ # smtp-connection
2
+
3
+ SMTP client module. Connect to SMTP servers and send mail with it.
4
+
5
+ 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).
6
+
7
+ [![Build Status](https://secure.travis-ci.org/nodemailer/smtp-connection.svg)](http://travis-ci.org/nodemailer/smtp-connection) [![npm version](https://badge.fury.io/js/smtp-connection.svg)](http://badge.fury.io/js/smtp-connection)
8
+
9
+ ## Usage
10
+
11
+ Install with npm
12
+
13
+ ```
14
+ npm install smtp-connection
15
+ ```
16
+
17
+ Require in your script
18
+
19
+ ```
20
+ var SMTPConnection = require('smtp-connection');
21
+ ```
22
+
23
+ ### Create SMTPConnection instance
24
+
25
+ ```javascript
26
+ var connection = new SMTPConnection(options);
27
+ ```
28
+
29
+ Where
30
+
31
+ - **options** defines connection data
32
+
33
+ - **options.port** is the port to connect to (defaults to 25 or 465)
34
+ - **options.host** is the hostname or IP address to connect to (defaults to 'localhost')
35
+ - **options.secure** defines if the connection should use SSL (if `true`) or not (if `false`)
36
+ - **options.ignoreTLS** turns off STARTTLS support if true
37
+ - **options.requireTLS** forces the client to use STARTTLS. Returns an error if upgrading the connection is not possible or fails.
38
+ - **options.opportunisticTLS** tries to use STARTTLS and continues normally if it fails
39
+ - **options.name** optional hostname of the client, used for identifying to the server
40
+ - **options.localAddress** is the local interface to bind to for network connections
41
+ - **options.connectionTimeout** how many milliseconds to wait for the connection to establish
42
+ - **options.greetingTimeout** how many milliseconds to wait for the greeting after connection is established
43
+ - **options.socketTimeout** how many milliseconds of inactivity to allow
44
+ - **options.logger** optional [bunyan](https://github.com/trentm/node-bunyan) compatible logger instance. If set to `true` then logs to console. If value is not set or is `false` then nothing is logged
45
+ - **options.debug** if set to true, then logs SMTP traffic, otherwise logs only transaction events
46
+ - **options.authMethod** defines preferred authentication method, e.g. 'PLAIN'
47
+ - **options.tls** defines additional options to be passed to the socket constructor, e.g. _{rejectUnauthorized: true}_
48
+ - **options.socket** - initialized socket to use instead of creating a new one
49
+ - **options.connection** - connected socket to use instead of creating and connecting a new one. If `secure` option is true, then socket is upgraded from plaintext to ciphertext
50
+
51
+ ### Events
52
+
53
+ SMTPConnection instances are event emitters with the following events
54
+
55
+ - **'error'** _(err)_ emitted when an error occurs. Connection is closed automatically in this case.
56
+ - **'connect'** emitted when the connection is established
57
+ - **'end'** when the instance is destroyed
58
+
59
+ ### connect
60
+
61
+ Establish the connection
62
+
63
+ ```javascript
64
+ connection.connect(callback)
65
+ ```
66
+
67
+ Where
68
+
69
+ - **callback** is the function to run once the connection is established. The function is added as a listener to the 'connect' event.
70
+
71
+ After the connect event the `connection` has the following properties:
72
+
73
+ - **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
74
+
75
+ ### login
76
+
77
+ If the server requires authentication you can login with
78
+
79
+ ```javascript
80
+ connection.login(auth, callback)
81
+ ```
82
+
83
+ Where
84
+
85
+ - **auth** is the authentication object
86
+
87
+ - **auth.user** is the username
88
+ - **auth.pass** is the password for the user
89
+ - **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.
90
+
91
+ - **callback** is the callback to run once the authentication is finished. Callback has the following arguments
92
+
93
+ - **err** and error object if authentication failed
94
+
95
+ 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.
96
+
97
+ **XOAuth2 Example**
98
+
99
+ ```javascript
100
+ var generator = require('xoauth2').createXOAuth2Generator({
101
+ user: '{username}',
102
+ clientId: '{Client ID}',
103
+ clientSecret: '{Client Secret}',
104
+ refreshToken: '{refresh-token}'
105
+ });
106
+
107
+ // listen for token updates
108
+ // you probably want to store these to a db
109
+ generator.on('token', function(token){
110
+ console.log('New token for %s: %s', token.user, token.accessToken);
111
+ });
112
+
113
+ // login
114
+ connection.login({
115
+ xoauth2: generator
116
+ }, callback);
117
+ ```
118
+
119
+ ### Login using NTLM
120
+
121
+ `smtp-connection` has experimental support for NTLM authentication. You can try it out like this:
122
+
123
+ ```javascript
124
+ connection.login({
125
+ domain: 'windows-domain',
126
+ workstation: 'windows-workstation',
127
+ user: 'user@somedomain.com',
128
+ pass: 'pass'
129
+ }, callback);
130
+ ```
131
+
132
+ I do not have access to an actual server that supports NTLM authentication so this feature is untested and should be used carefully.
133
+
134
+ ### send
135
+
136
+ Once the connection is authenticated (or just after connection is established if authentication is not required), you can send mail with
137
+
138
+ ```javascript
139
+ connection.send(envelope, message, callback)
140
+ ```
141
+
142
+ Where
143
+
144
+ - **envelope** is the envelope object to use
145
+
146
+ - **envelope.from** is the sender address
147
+ - **envelope.to** is the recipient address or an array of addresses
148
+ - **envelope.size** is an optional value of the predicted size of the message in bytes. This value is used if the server supports the SIZE extension (RFC1870)
149
+ - **envelope.use8BitMime** if `true` then inform the server that this message might contain bytes outside 7bit ascii range
150
+ - **envelope.dsn** is the dsn options
151
+
152
+ - **envelope.dsn.ret** return either the full message 'FULL' or only headers 'HDRS'
153
+ - **envelope.dsn.envid** sender's 'envelope identifier' for tracking
154
+ - **envelope.dsn.notify** when to send a DSN. Multiple options are OK - array or comma delimited. NEVER must appear by itself. Available options: 'NEVER', 'SUCCESS', 'FAILURE', 'DELAY'
155
+ - **envelope.dsn.orcpt** original recipient
156
+
157
+ - **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.
158
+
159
+ - **callback** is the callback to run once the sending is finished or failed. Callback has the following arguments
160
+
161
+ - **err** and error object if sending failed
162
+
163
+ - **code** string code identifying the error, for example 'EAUTH' is returned when authentication fails
164
+ - **response** is the last response received from the server (if the error is caused by an error response from the server)
165
+ - **responseCode** is the numeric response code of the `response` string (if available)
166
+
167
+ - **info** information object about accepted and rejected recipients
168
+
169
+ - **accepted** an array of accepted recipient addresses. Normally this array should contain at least one address except when in LMTP mode. In this case the message itself might have succeeded but all recipients were rejected after sending the message.
170
+ - **rejected** an array of rejected recipient addresses. This array includes both the addresses that were rejected before sending the message and addresses rejected after sending it if using LMTP
171
+ - **rejectedErrors** if some recipients were rejected then this property holds an array of error objects for the rejected recipients
172
+ - **response** is the last response received from the server
173
+
174
+ ### quit
175
+
176
+ Use it for graceful disconnect
177
+
178
+ ```javascript
179
+ connection.quit();
180
+ ```
181
+
182
+ ### close
183
+
184
+ Use it for less graceful disconnect
185
+
186
+ ```javascript
187
+ connection.close();
188
+ ```
189
+
190
+ ### reset
191
+
192
+ Use it to reset current session (invokes RSET command)
193
+
194
+ ```javascript
195
+ connection.reset(callback);
196
+ ```
197
+
198
+ ## License
199
+
200
+ **MIT**
@@ -0,0 +1,111 @@
1
+ 'use strict';
2
+
3
+ var stream = require('stream');
4
+ var Transform = stream.Transform;
5
+ var util = require('util');
6
+
7
+ module.exports = DataStream;
8
+
9
+ /**
10
+ * Escapes dots in the beginning of lines. Ends the stream with <CR><LF>.<CR><LF>
11
+ * Also makes sure that only <CR><LF> sequences are used for linebreaks
12
+ *
13
+ * @param {Object} options Stream options
14
+ */
15
+ function DataStream(options) {
16
+ // init Transform
17
+ this.options = options || {};
18
+ this._curLine = '';
19
+
20
+ this.inByteCount = 0;
21
+ this.outByteCount = 0;
22
+ this.lastByte = false;
23
+
24
+ Transform.call(this, this.options);
25
+ }
26
+ util.inherits(DataStream, Transform);
27
+
28
+ /**
29
+ * Escapes dots
30
+ */
31
+ DataStream.prototype._transform = function (chunk, encoding, done) {
32
+ var chunks = [];
33
+ var chunklen = 0;
34
+ var i, len, lastPos = 0;
35
+ var buf;
36
+
37
+ if (!chunk || !chunk.length) {
38
+ return done();
39
+ }
40
+
41
+ if (typeof chunk === 'string') {
42
+ chunk = new Buffer(chunk);
43
+ }
44
+
45
+ this.inByteCount += chunk.length;
46
+
47
+ for (i = 0, len = chunk.length; i < len; i++) {
48
+ if (chunk[i] === 0x2E) { // .
49
+ if (
50
+ (i && chunk[i - 1] === 0x0A) ||
51
+ (!i && (!this.lastByte || this.lastByte === 0x0A))
52
+ ) {
53
+ buf = chunk.slice(lastPos, i + 1);
54
+ chunks.push(buf);
55
+ chunks.push(new Buffer('.'));
56
+ chunklen += buf.length + 1;
57
+ lastPos = i + 1;
58
+ }
59
+ } else if (chunk[i] === 0x0A) { // .
60
+ if (
61
+ (i && chunk[i - 1] !== 0x0D) ||
62
+ (!i && this.lastByte !== 0x0D)
63
+ ) {
64
+ if (i > lastPos) {
65
+ buf = chunk.slice(lastPos, i);
66
+ chunks.push(buf);
67
+ chunklen += buf.length + 2;
68
+ } else {
69
+ chunklen += 2;
70
+ }
71
+ chunks.push(new Buffer('\r\n'));
72
+ lastPos = i + 1;
73
+ }
74
+ }
75
+ }
76
+
77
+ if (chunklen) {
78
+ // add last piece
79
+ if (lastPos < chunk.length) {
80
+ buf = chunk.slice(lastPos);
81
+ chunks.push(buf);
82
+ chunklen += buf.length;
83
+ }
84
+
85
+ this.outByteCount += chunklen;
86
+ this.push(Buffer.concat(chunks, chunklen));
87
+ } else {
88
+ this.outByteCount += chunk.length;
89
+ this.push(chunk);
90
+ }
91
+
92
+ this.lastByte = chunk[chunk.length - 1];
93
+ done();
94
+ };
95
+
96
+ /**
97
+ * Finalizes the stream with a dot on a single line
98
+ */
99
+ DataStream.prototype._flush = function (done) {
100
+ var buf;
101
+ if (this.lastByte === 0x0A) {
102
+ buf = new Buffer('.\r\n');
103
+ } else if (this.lastByte === 0x0D) {
104
+ buf = new Buffer('\n.\r\n');
105
+ } else {
106
+ buf = new Buffer('\r\n.\r\n');
107
+ }
108
+ this.outByteCount += buf.length;
109
+ this.push(buf);
110
+ done();
111
+ };