@upyo/smtp 0.6.0-dev.301 → 0.6.0-dev.305
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.
- package/dist/index.cjs +4 -4
- package/dist/index.js +4 -4
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -897,11 +897,11 @@ var SmtpConnection = class {
|
|
|
897
897
|
const response = await this.sendCommand(`EHLO ${this.config.localName}`, signal);
|
|
898
898
|
if (response.code === 500 || response.code === 502) {
|
|
899
899
|
const heloResponse = await this.sendCommand(`HELO ${this.config.localName}`, signal);
|
|
900
|
-
if (heloResponse.code !== 250) throw new
|
|
900
|
+
if (heloResponse.code !== 250) throw new SmtpResponseError(`HELO failed: ${heloResponse.message}`, heloResponse.code, "HELO", heloResponse.message);
|
|
901
901
|
this.capabilities = [];
|
|
902
902
|
return;
|
|
903
903
|
}
|
|
904
|
-
if (response.code !== 250) throw new
|
|
904
|
+
if (response.code !== 250) throw new SmtpResponseError(`EHLO failed: ${response.message}`, response.code, "EHLO", response.message);
|
|
905
905
|
this.capabilities = response.raw.split("\r\n").filter((line) => line.startsWith("250-") || line.startsWith("250 ")).slice(1).map((line) => line.substring(4)).filter((line) => line.length > 0);
|
|
906
906
|
}
|
|
907
907
|
async starttls(signal) {
|
|
@@ -909,7 +909,7 @@ var SmtpConnection = class {
|
|
|
909
909
|
if (this.socket instanceof node_tls.TLSSocket) throw new Error("Connection is already using TLS");
|
|
910
910
|
signal?.throwIfAborted();
|
|
911
911
|
const response = await this.sendCommand("STARTTLS", signal);
|
|
912
|
-
if (response.code !== 220) throw new
|
|
912
|
+
if (response.code !== 220) throw new SmtpResponseError(`STARTTLS failed: ${response.message}`, response.code, "STARTTLS", response.message);
|
|
913
913
|
signal?.throwIfAborted();
|
|
914
914
|
return new Promise((resolve, reject) => {
|
|
915
915
|
const timeout = setTimeout(() => {
|
|
@@ -1983,7 +1983,7 @@ var SmtpTransport = class {
|
|
|
1983
1983
|
await connection.connect(signal);
|
|
1984
1984
|
signal?.throwIfAborted();
|
|
1985
1985
|
const greeting = await connection.greeting(signal);
|
|
1986
|
-
if (greeting.code !== 220) throw new
|
|
1986
|
+
if (greeting.code !== 220) throw new SmtpResponseError(`Server greeting failed: ${greeting.message}`, greeting.code, "GREETING", greeting.message);
|
|
1987
1987
|
signal?.throwIfAborted();
|
|
1988
1988
|
await connection.ehlo(signal);
|
|
1989
1989
|
signal?.throwIfAborted();
|
package/dist/index.js
CHANGED
|
@@ -874,11 +874,11 @@ var SmtpConnection = class {
|
|
|
874
874
|
const response = await this.sendCommand(`EHLO ${this.config.localName}`, signal);
|
|
875
875
|
if (response.code === 500 || response.code === 502) {
|
|
876
876
|
const heloResponse = await this.sendCommand(`HELO ${this.config.localName}`, signal);
|
|
877
|
-
if (heloResponse.code !== 250) throw new
|
|
877
|
+
if (heloResponse.code !== 250) throw new SmtpResponseError(`HELO failed: ${heloResponse.message}`, heloResponse.code, "HELO", heloResponse.message);
|
|
878
878
|
this.capabilities = [];
|
|
879
879
|
return;
|
|
880
880
|
}
|
|
881
|
-
if (response.code !== 250) throw new
|
|
881
|
+
if (response.code !== 250) throw new SmtpResponseError(`EHLO failed: ${response.message}`, response.code, "EHLO", response.message);
|
|
882
882
|
this.capabilities = response.raw.split("\r\n").filter((line) => line.startsWith("250-") || line.startsWith("250 ")).slice(1).map((line) => line.substring(4)).filter((line) => line.length > 0);
|
|
883
883
|
}
|
|
884
884
|
async starttls(signal) {
|
|
@@ -886,7 +886,7 @@ var SmtpConnection = class {
|
|
|
886
886
|
if (this.socket instanceof TLSSocket) throw new Error("Connection is already using TLS");
|
|
887
887
|
signal?.throwIfAborted();
|
|
888
888
|
const response = await this.sendCommand("STARTTLS", signal);
|
|
889
|
-
if (response.code !== 220) throw new
|
|
889
|
+
if (response.code !== 220) throw new SmtpResponseError(`STARTTLS failed: ${response.message}`, response.code, "STARTTLS", response.message);
|
|
890
890
|
signal?.throwIfAborted();
|
|
891
891
|
return new Promise((resolve, reject) => {
|
|
892
892
|
const timeout = setTimeout(() => {
|
|
@@ -1960,7 +1960,7 @@ var SmtpTransport = class {
|
|
|
1960
1960
|
await connection.connect(signal);
|
|
1961
1961
|
signal?.throwIfAborted();
|
|
1962
1962
|
const greeting = await connection.greeting(signal);
|
|
1963
|
-
if (greeting.code !== 220) throw new
|
|
1963
|
+
if (greeting.code !== 220) throw new SmtpResponseError(`Server greeting failed: ${greeting.message}`, greeting.code, "GREETING", greeting.message);
|
|
1964
1964
|
signal?.throwIfAborted();
|
|
1965
1965
|
await connection.ehlo(signal);
|
|
1966
1966
|
signal?.throwIfAborted();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@upyo/smtp",
|
|
3
|
-
"version": "0.6.0-dev.
|
|
3
|
+
"version": "0.6.0-dev.305",
|
|
4
4
|
"description": "SMTP transport for Upyo email library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"email",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
},
|
|
54
54
|
"sideEffects": false,
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@upyo/core": "0.6.0-dev.
|
|
56
|
+
"@upyo/core": "0.6.0-dev.305+7db15a6d"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"tsdown": "^0.12.7",
|