⚡️ The Extensible ESMTP Server
$ npm install --save xmtp-core
Two options:
- Use Node.js v7+ with
--harmony-async-await
flag. - Use Node.js with Babel using
es2017
preset.
const app = require('xmtp-core')();
app.set('me', 'mail.host.com');
app.set('greeting', 'My Server Name');
app.plugin('auth', { ...options });
app.plugin('starttls', { ...options });
app.use('rcpt', async (next, rcpt) => {
if (rcpt.host === 'host.com') {
// Allow any @host.com recipient
return true;
}
return await next();
});
app.use('queue', async (next, conn) => {
// email = { headers, html, text, calendars, attachments }
const email = conn.transaction.email;
// Do something with the email (ie. relay, lmtp, save to db, etc...)
});
app.listen(25); // May require sudo privileges.
Guides and the API reference are located in the docs directory.
Supported Commands | Supported/Planned Extensions | No Planned Support |
---|---|---|
|
|
ATRN |
|
|
CHECKPOINT |
|
ENHANGEDSTATUSCODES [sic] | |
|
|
ETRN |
|
|
EXPN |
|
|
SAML, SEND, SOML |
|
|
TIME |
|
|
TURN |
|
|
VERB |
|
|
X-EXPS |
|
X-LINK2STATE | |
|
X-RCPTLIMIT | |
|
X-TURNME | |
XEXCH50 | ||
XUSER | ||
XSHADOW |
*wip = work in progress