
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
@upyo/smtp
Advanced tools
SMTP transport implementation for the Upyo email library.
npm add @upyo/core @upyo/smtp
pnpm add @upyo/core @upyo/smtp
yarn add @upyo/core @upyo/smtp
deno add --jsr @upyo/core @upyo/smtp
bun add @upyo/core @upyo/smtp
import { createMessage } from "@upyo/core";
import { SmtpTransport } from "@upyo/smtp";
const transport = new SmtpTransport({
host: "smtp.example.com",
port: 587,
secure: false,
auth: {
user: "username",
pass: "password",
},
});
const message = createMessage({
from: "sender@example.com",
to: "recipient@example.net",
subject: "Hello from Upyo!",
content: { text: "This is a test email." },
});
const receipt = await transport.send(message);
if (receipt.successful) {
console.log("Message sent with ID:", receipt.messageId);
} else {
console.error("Send failed:", receipt.errorMessages.join(", "));
}
const messages = [message1, message2, message3];
for await (const receipt of transport.sendMany(messages)) {
if (receipt.successful) {
console.log(`Email sent with ID: ${receipt.messageId}`);
} else {
console.error(`Email failed: ${receipt.errorMessages.join(", ")}`);
}
}
SmtpConfig| Option | Type | Default | Description |
|---|---|---|---|
host | string | SMTP server hostname | |
port | number | 587 | SMTP server port |
secure | boolean | true | Use TLS/SSL connection |
auth | SmtpAuth | Authentication configuration | |
tls | SmtpTlsOptions | TLS configuration | |
connectionTimeout | number | 60000 | Connection timeout (ms) |
socketTimeout | number | 60000 | Socket timeout (ms) |
localName | string | "localhost" | Local hostname for HELO/EHLO |
pool | boolean | true | Enable connection pooling |
poolSize | number | 5 | Maximum pool connections |
dkim | DkimConfig | DKIM signing configuration |
SmtpAuth| Option | Type | Default | Description |
|---|---|---|---|
user | string | Username | |
pass | string | Password | |
method | "plain" | "login" | "cram-md5" | "plain" | Auth method |
DKIM (DomainKeys Identified Mail) signing is supported for improved email deliverability and authentication:
import { createMessage } from "@upyo/core";
import { SmtpTransport } from "@upyo/smtp";
import { readFileSync } from "node:fs";
const transport = new SmtpTransport({
host: "smtp.example.com",
port: 587,
secure: false,
auth: { user: "user@example.com", pass: "password" },
dkim: {
signatures: [{
signingDomain: "example.com",
selector: "mail",
privateKey: readFileSync("./dkim-private.pem", "utf8"),
}],
},
});
DkimConfig| Option | Type | Default | Description |
|---|---|---|---|
signatures | DkimSignature[] | Array of DKIM signature configs | |
onSigningFailure | "throw" | "send-unsigned" | "throw" | Action when signing fails |
DkimSignature| Option | Type | Default | Description |
|---|---|---|---|
signingDomain | string | Domain for DKIM key (d= tag) | |
selector | string | DKIM selector (s= tag) | |
privateKey | string | CryptoKey | Private key (PEM string or CryptoKey) | |
algorithm | "rsa-sha256" | "ed25519-sha256" | "rsa-sha256" | Signing algorithm |
canonicalization | string | "relaxed/relaxed" | Header/body canonicalization |
headerFields | string[] | From, To, ... | Headers to sign |
For unit testing, use the included mock SMTP server:
import { MockSmtpServer, SmtpTransport } from "@upyo/smtp";
const server = new MockSmtpServer();
const port = await server.start();
const transport = new SmtpTransport({
host: "localhost",
port,
secure: false,
auth: { user: "test", pass: "test" },
});
// Send test email
await transport.send(message);
// Check received messages
const received = server.getReceivedMessages();
console.log(received[0].data); // Raw email content
await server.stop();
FAQs
SMTP transport for Upyo email library
We found that @upyo/smtp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.