bun-smtp
v0.3.0
Published
A fast SMTP/LMTP server library for Bun
Maintainers
Readme
A fast SMTP/LMTP server library built natively on Bun.
import { SMTPServer } from "bun-smtp";
const server = new SMTPServer({
authOptional: true,
onData(stream, session, callback) {
async function drain() {
const chunks: Uint8Array[] = [];
for await (const chunk of stream) {
chunks.push(chunk);
}
callback(null);
}
drain().catch(callback);
},
});
await server.listen(2525);Quick Start
bun add bun-smtpFeatures
Bun-native 🚀 - Uses
Bun.listen(),socket.upgradeTLS(), andBun.CryptoHasher. No Node.js compat layer.Drop-in replacement 🔄 - Same constructor options, callbacks, and event names as
smtp-server. Minimal migration effort.Full SMTP support 📨 - HELO, EHLO, MAIL FROM, RCPT TO, DATA, STARTTLS, LMTP, and more.
SASL auth 🔐 - PLAIN, LOGIN, CRAM-MD5, and XOAUTH2 out of the box.
TypeScript first 🟦 - Fully typed API with strong types throughout.
Documentation
Contributing
Contributions welcome.
- Open an issue to propose a feature or report a bug.
- Open a pull request to fix a bug or improve docs.
Authors
Sabin Puiu https://github.com/puiusabin
License
Distributed under the MIT License. See LICENSE for more information.
