@upyo/smtp 0.6.0-dev.306 → 0.6.0-dev.309

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/README.md CHANGED
@@ -107,23 +107,25 @@ Configuration options
107
107
 
108
108
  ### `SmtpConfig`
109
109
 
110
- | Option | Type | Default | Description |
111
- | ------------------- | ---------------- | ------------- | -------------------------------- |
112
- | `host` | `string` | | SMTP server hostname |
113
- | `port` | `number` | `587` | SMTP server port |
114
- | `secure` | `boolean` | `true` | Use TLS/SSL connection |
115
- | `requireTls` | `boolean` | `false` | Require a STARTTLS upgrade |
116
- | `auth` | `SmtpAuth` | | Authentication configuration |
117
- | `tls` | `SmtpTlsOptions` | | TLS configuration |
118
- | `connectionTimeout` | `number` | `60000` | Connection timeout (ms) |
119
- | `socketTimeout` | `number` | `60000` | Socket timeout (ms) |
120
- | `localName` | `string` | `"localhost"` | Local hostname for `HELO`/`EHLO` |
121
- | `pool` | `boolean` | `true` | Enable connection pooling |
122
- | `poolSize` | `number` | `5` | Maximum pool connections |
123
- | `dkim` | `DkimConfig` | | DKIM signing configuration |
110
+ | Option | Type | Default | Description |
111
+ | ------------------- | ---------------- | -------------- | -------------------------------- |
112
+ | `host` | `string` | | SMTP server hostname |
113
+ | `port` | `number` | `587` | SMTP server port |
114
+ | `secure` | `boolean` | Port-dependent | Use implicit TLS from the start |
115
+ | `requireTls` | `boolean` | `false` | Require a STARTTLS upgrade |
116
+ | `auth` | `SmtpAuth` | | Authentication configuration |
117
+ | `tls` | `SmtpTlsOptions` | | TLS configuration |
118
+ | `connectionTimeout` | `number` | `60000` | Connection timeout (ms) |
119
+ | `socketTimeout` | `number` | `60000` | Socket timeout (ms) |
120
+ | `localName` | `string` | `"localhost"` | Local hostname for `HELO`/`EHLO` |
121
+ | `pool` | `boolean` | `true` | Enable connection pooling |
122
+ | `poolSize` | `number` | `5` | Maximum pool connections |
123
+ | `dkim` | `DkimConfig` | | DKIM signing configuration |
124
124
 
125
125
  Set `requireTls: true` with `secure: false` to issue `STARTTLS` even when the
126
126
  server does not advertise it and fail delivery unless the upgrade succeeds.
127
+ When `secure` is omitted, it defaults to `true` on port 465 and `false` on all
128
+ other ports.
127
129
  Regardless of this option, SMTP authentication to non-loopback hosts requires
128
130
  either an implicit TLS connection or a successful STARTTLS upgrade. Cleartext
129
131
  authentication to loopback hosts remains available for local development.
package/dist/index.cjs CHANGED
@@ -148,10 +148,11 @@ function assertParameterLength(parameter, maximum, name) {
148
148
  * @internal
149
149
  */
150
150
  function createSmtpConfig(config) {
151
+ const port = config.port ?? 587;
151
152
  return {
152
153
  host: config.host,
153
- port: config.port ?? 587,
154
- secure: config.secure ?? true,
154
+ port,
155
+ secure: config.secure ?? port === 465,
155
156
  requireTls: config.requireTls ?? false,
156
157
  auth: config.auth,
157
158
  tls: config.tls,
package/dist/index.d.cts CHANGED
@@ -136,8 +136,8 @@ interface SmtpConfig {
136
136
  */
137
137
  readonly port?: number;
138
138
  /**
139
- * Whether to use secure connection (TLS/SSL).
140
- * @default true
139
+ * Whether to use implicit TLS from the start of the connection.
140
+ * @default `true` on port 465; otherwise `false`
141
141
  */
142
142
  readonly secure?: boolean;
143
143
  /**
package/dist/index.d.ts CHANGED
@@ -136,8 +136,8 @@ interface SmtpConfig {
136
136
  */
137
137
  readonly port?: number;
138
138
  /**
139
- * Whether to use secure connection (TLS/SSL).
140
- * @default true
139
+ * Whether to use implicit TLS from the start of the connection.
140
+ * @default `true` on port 465; otherwise `false`
141
141
  */
142
142
  readonly secure?: boolean;
143
143
  /**
package/dist/index.js CHANGED
@@ -125,10 +125,11 @@ function assertParameterLength(parameter, maximum, name) {
125
125
  * @internal
126
126
  */
127
127
  function createSmtpConfig(config) {
128
+ const port = config.port ?? 587;
128
129
  return {
129
130
  host: config.host,
130
- port: config.port ?? 587,
131
- secure: config.secure ?? true,
131
+ port,
132
+ secure: config.secure ?? port === 465,
132
133
  requireTls: config.requireTls ?? false,
133
134
  auth: config.auth,
134
135
  tls: config.tls,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@upyo/smtp",
3
- "version": "0.6.0-dev.306",
3
+ "version": "0.6.0-dev.309",
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.306+6bd78f36"
56
+ "@upyo/core": "0.6.0-dev.309+0e4d9155"
57
57
  },
58
58
  "devDependencies": {
59
59
  "tsdown": "^0.12.7",