mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-15 06:48:25 +08:00
31 lines
770 B
TypeScript
31 lines
770 B
TypeScript
|
|
import simplesmtp = require("simplesmtp");
|
|
|
|
let server: simplesmtp.SimpleServer;
|
|
|
|
server = simplesmtp.createSimpleServer({
|
|
disableDNSValidation: true,
|
|
enableAuthentication: true,
|
|
requireAuthentication: false,
|
|
name: "localhost",
|
|
secureConnection: false,
|
|
SMTPBanner: "Hoi dit is de test server",
|
|
timeout: this.timeout,
|
|
ignoreTLS: true
|
|
}, (req: simplesmtp.SimpleServerConnection) => {
|
|
req.on("data", (chunk: Buffer): void => {
|
|
//
|
|
});
|
|
req.on("end", (): void => {
|
|
//
|
|
});
|
|
req.accept("12");
|
|
});
|
|
this._server.server.on("authorizeUser",
|
|
(envelope: any, username: string|Buffer, password: string, callback: (error: Error, success: boolean) => void
|
|
): void => {
|
|
callback(null, true);
|
|
});
|
|
this._server.listen(this.port, "0.0.0.0", (error?: Error): void => {
|
|
});
|