landing.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. <!doctype html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <meta name="description" content="MailHub — self-hosted transactional email with API, SMTP, DNS and webhooks." />
  7. <title>MailHub</title>
  8. </head>
  9. <body>
  10. <div class="page">
  11. <header class="site-header">
  12. <a class="brand" href="#top">
  13. <span class="brand-mark">MH</span>
  14. <span class="brand-name">MailHub</span>
  15. </a>
  16. <nav class="nav-links" aria-label="Primary">
  17. <a href="#features" data-i18n="nav.features">Features</a>
  18. <a href="#quickstart" data-i18n="nav.quickstart">Quick start</a>
  19. <a href="#api" data-i18n="nav.api">API</a>
  20. <a href="#mailboxes" data-i18n="nav.mailboxes">Mailboxes</a>
  21. <a href="#domains" data-i18n="nav.domains">Domain setup</a>
  22. <a href="#smtp" data-i18n="nav.smtp">SMTP</a>
  23. <a href="#webhooks" data-i18n="nav.webhooks">Webhooks</a>
  24. </nav>
  25. <div class="header-actions">
  26. <div class="lang-switch" role="group" aria-label="Language">
  27. <button type="button" data-locale="zh-CN" class="lang-btn">中文</button>
  28. <button type="button" data-locale="en-US" class="lang-btn">EN</button>
  29. </div>
  30. <a
  31. class="btn btn-ghost"
  32. href="https://github.com/chendeben/MailHub"
  33. target="_blank"
  34. rel="noopener noreferrer"
  35. data-i18n="cta.github"
  36. >GitHub</a>
  37. <a class="btn btn-ghost" href="/login" data-i18n="cta.login">Log in</a>
  38. <a class="btn btn-primary" href="/register" data-i18n="cta.signup">Get started</a>
  39. </div>
  40. </header>
  41. <main id="top">
  42. <section class="hero">
  43. <div class="hero-copy">
  44. <p class="eyebrow" data-i18n="hero.eyebrow">Transactional email platform</p>
  45. <h1 data-i18n="hero.title">Send reliable email via API &amp; SMTP</h1>
  46. <p class="lede" data-i18n="hero.lede">
  47. Self-hosted MailHub gives you domain DNS guidance, DKIM signing, delivery logs, and signed webhooks — without locking you into a black-box SaaS.
  48. </p>
  49. <div class="hero-cta">
  50. <a class="btn btn-primary btn-lg" href="/register" data-i18n="cta.signup">Get started</a>
  51. <a class="btn btn-ghost btn-lg" href="#api" data-i18n="cta.viewApi">View API sample</a>
  52. </div>
  53. <ul class="trust-strip">
  54. <li data-i18n="trust.selfHosted">Self-hosted</li>
  55. <li>DKIM</li>
  56. <li>SPF</li>
  57. <li>DMARC</li>
  58. <li data-i18n="trust.webhooks">Delivery webhooks</li>
  59. </ul>
  60. </div>
  61. <div class="hero-code" aria-hidden="false">
  62. <div class="code-card">
  63. <div class="code-card-bar">
  64. <span>curl</span>
  65. <button type="button" class="copy-btn" data-copy-target="hero-curl" data-i18n="common.copy">Copy</button>
  66. </div>
  67. <pre id="hero-curl"><code data-i18n-html="hero.curl"></code></pre>
  68. </div>
  69. </div>
  70. </section>
  71. <section id="features" class="section">
  72. <div class="section-head">
  73. <h2 data-i18n="features.title">Built for production senders</h2>
  74. <p data-i18n="features.sub">Everything you need to authenticate domains and observe delivery.</p>
  75. </div>
  76. <div class="feature-grid">
  77. <article class="card"><h3 data-i18n="features.dns.title">Domains &amp; DNS</h3><p data-i18n="features.dns.body">Guided SPF, DKIM, DMARC, and one-click DNS provider writes.</p></article>
  78. <article class="card"><h3 data-i18n="features.smtp.title">SMTP Submission</h3><p data-i18n="features.smtp.body">App-friendly SMTP listeners with credentials you control.</p></article>
  79. <article class="card"><h3 data-i18n="features.api.title">HTTP Send API</h3><p data-i18n="features.api.body">Bearer tokens and a simple JSON send endpoint for apps and services.</p></article>
  80. <article class="card"><h3 data-i18n="features.mailboxes.title">Mailboxes &amp; receiving</h3><p data-i18n="features.mailboxes.body">Create persistent or expiring inboxes with IMAP, POP3, forwarding, and catch-all routing.</p></article>
  81. <article class="card"><h3 data-i18n="features.logs.title">Delivery logs</h3><p data-i18n="features.logs.body">Track queue and MTA outcomes with searchable send history.</p></article>
  82. <article class="card"><h3 data-i18n="features.hooks.title">Webhooks</h3><p data-i18n="features.hooks.body">Signed callbacks for sent, bounced, and failed terminal events.</p></article>
  83. <article class="card"><h3 data-i18n="features.multi.title">Multi-user isolation</h3><p data-i18n="features.multi.body">Domains, tokens, and logs stay scoped to each account.</p></article>
  84. </div>
  85. </section>
  86. <section id="quickstart" class="section section-alt">
  87. <div class="section-head">
  88. <h2 data-i18n="quickstart.title">Start in four steps</h2>
  89. <p data-i18n="quickstart.sub">The console keeps domain, token, mailbox, and delivery configuration in one place.</p>
  90. </div>
  91. <div class="steps-grid">
  92. <article class="card">
  93. <span class="step-number">1</span>
  94. <h3 data-i18n="quickstart.domain.title">Add a domain</h3>
  95. <p data-i18n="quickstart.domain.body">Add your sending domain and publish the DNS records shown by MailHub.</p>
  96. <a class="text-link" href="#domains" data-i18n="quickstart.domain.link">Review domain setup →</a>
  97. </article>
  98. <article class="card">
  99. <span class="step-number">2</span>
  100. <h3 data-i18n="quickstart.token.title">Create a scoped token</h3>
  101. <p data-i18n="quickstart.token.body">Give each integration only the send or mailbox permissions it needs.</p>
  102. <a class="text-link" href="#api" data-i18n="quickstart.token.link">Review API access →</a>
  103. </article>
  104. <article class="card">
  105. <span class="step-number">3</span>
  106. <h3 data-i18n="quickstart.mailbox.title">Provision mailboxes</h3>
  107. <p data-i18n="quickstart.mailbox.body">Create persistent mailboxes in the console or create persistent and temporary mailboxes by API.</p>
  108. <a class="text-link" href="#mailboxes" data-i18n="quickstart.mailbox.link">Review mailbox API →</a>
  109. </article>
  110. <article class="card">
  111. <span class="step-number">4</span>
  112. <h3 data-i18n="quickstart.client.title">Connect your client</h3>
  113. <p data-i18n="quickstart.client.body">Use SMTP to send and IMAP or POP3 to receive with the mailbox's full address and password.</p>
  114. <a class="text-link" href="#smtp" data-i18n="quickstart.client.link">Review protocol settings →</a>
  115. </article>
  116. </div>
  117. </section>
  118. <section id="api" class="section">
  119. <div class="section-head">
  120. <h2 data-i18n="api.title">Send API</h2>
  121. <p data-i18n="api.sub">Minimal JSON contract. Hostnames below are placeholders — replace with your MailHub host.</p>
  122. </div>
  123. <div class="code-card">
  124. <div class="code-card-bar">
  125. <span>POST /api/send</span>
  126. <button type="button" class="copy-btn" data-copy-target="api-curl" data-i18n="common.copy">Copy</button>
  127. </div>
  128. <pre id="api-curl"><code data-i18n-html="api.curl"></code></pre>
  129. </div>
  130. <ul class="field-list">
  131. <li><code>from</code> — <span data-i18n="api.field.from">sender address on a verified domain</span></li>
  132. <li><code>to</code> — <span data-i18n="api.field.to">recipient string or array</span></li>
  133. <li><code>subject</code> — <span data-i18n="api.field.subject">message subject</span></li>
  134. <li><code>text</code> / <code>html</code> — <span data-i18n="api.field.body">message body</span></li>
  135. </ul>
  136. </section>
  137. <section id="mailboxes" class="section section-alt">
  138. <div class="section-head">
  139. <h2 data-i18n="mailboxes.title">Mailbox API and clients</h2>
  140. <p data-i18n="mailboxes.sub">Create a persistent address for ongoing work, or an expiring address for a short-lived workflow.</p>
  141. </div>
  142. <div class="doc-grid">
  143. <article class="card">
  144. <h3 data-i18n="mailboxes.api.title">Create a mailbox</h3>
  145. <p data-i18n="mailboxes.api.body">POST to /api/mailboxes with a token holding mailboxes:write. The target domain must belong to that account.</p>
  146. <ul class="field-list compact-list">
  147. <li><code>mode</code> — <span data-i18n="mailboxes.api.mode">permanent or temporary</span></li>
  148. <li><code>address</code> / <code>domain</code> — <span data-i18n="mailboxes.api.address">use a full address, or let a temporary mailbox generate one from domain</span></li>
  149. <li><code>expiresInMinutes</code> — <span data-i18n="mailboxes.api.expires">required for temporary mailboxes; 5 minutes to 30 days</span></li>
  150. <li><code>password</code> — <span data-i18n="mailboxes.api.password">optional; a secure password is returned once when omitted</span></li>
  151. </ul>
  152. </article>
  153. <article class="card">
  154. <h3 data-i18n="mailboxes.client.title">Use the returned configuration</h3>
  155. <p data-i18n="mailboxes.client.body">Creation returns the address, password, expiration, and ready-to-use IMAP, POP3, and SMTP settings.</p>
  156. <ul class="field-list compact-list">
  157. <li><strong>IMAP</strong> — <span data-i18n="mailboxes.client.imap">recommended for synchronized folders and sent mail</span></li>
  158. <li><strong>POP3</strong> — <span data-i18n="mailboxes.client.pop3">for download-oriented clients</span></li>
  159. <li><strong>SMTP</strong> — <span data-i18n="mailboxes.client.smtp">use the same full mailbox address and password to send</span></li>
  160. </ul>
  161. </article>
  162. </div>
  163. <div class="code-card doc-code-card">
  164. <div class="code-card-bar">
  165. <span>POST /api/mailboxes</span>
  166. <button type="button" class="copy-btn" data-copy-target="mailbox-curl" data-i18n="common.copy">Copy</button>
  167. </div>
  168. <pre id="mailbox-curl"><code data-i18n-html="mailboxes.curl"></code></pre>
  169. </div>
  170. <p class="note" data-i18n="mailboxes.note">Use GET /api/mailboxes with mailboxes:read to list the account's mailboxes. A temporary mailbox stops accepting mail and authenticating at its expiration time.</p>
  171. </section>
  172. <section id="domains" class="section">
  173. <div class="section-head">
  174. <h2 data-i18n="domainsDoc.title">Domain configuration</h2>
  175. <p data-i18n="domainsDoc.sub">Create the domain in MailHub first. Its DNS panel is the source of truth for your exact verification, DKIM, SPF, DMARC, and sender-host values.</p>
  176. </div>
  177. <div class="table-wrap">
  178. <table>
  179. <thead>
  180. <tr>
  181. <th data-i18n="domainsDoc.col.purpose">Purpose</th>
  182. <th data-i18n="domainsDoc.col.record">Record</th>
  183. <th data-i18n="domainsDoc.col.requirement">Requirement</th>
  184. </tr>
  185. </thead>
  186. <tbody>
  187. <tr><td data-i18n="domainsDoc.row.verify">Domain ownership</td><td><code>TXT _mailhub.&lt;domain&gt;</code></td><td data-i18n="domainsDoc.row.verifyValue">Publish the verification value generated in the console.</td></tr>
  188. <tr><td>DKIM</td><td><code>TXT &lt;selector&gt;._domainkey.&lt;domain&gt;</code></td><td data-i18n="domainsDoc.row.dkim">Publish the public key generated for this domain.</td></tr>
  189. <tr><td>SPF</td><td><code>TXT &lt;domain&gt;</code></td><td data-i18n="domainsDoc.row.spf">Keep one SPF record and include the sender IP/host required by MailHub.</td></tr>
  190. <tr><td>DMARC</td><td><code>TXT _dmarc.&lt;domain&gt;</code></td><td data-i18n="domainsDoc.row.dmarc">Start with monitoring, then strengthen the policy after alignment is verified.</td></tr>
  191. <tr><td data-i18n="domainsDoc.row.mx">Inbound mail</td><td><code>MX &lt;domain&gt;</code></td><td data-i18n="domainsDoc.row.mxValue">Point MX to the MailHub receiving host and ensure that host has an A/AAAA record.</td></tr>
  192. </tbody>
  193. </table>
  194. </div>
  195. <p class="note" data-i18n="domainsDoc.note">For reliable delivery, also configure the sending IP's PTR to match the MailHub sending hostname and allow the documented SMTP, IMAP, and POP3 ports through your firewall.</p>
  196. </section>
  197. <section id="smtp" class="section section-alt">
  198. <div class="section-head">
  199. <h2 data-i18n="smtp.title">SMTP submission</h2>
  200. <p data-i18n="smtp.sub">Default listener ports (override in your deployment):</p>
  201. </div>
  202. <div class="port-grid">
  203. <div class="card mono"><strong>25</strong><span>smtp</span></div>
  204. <div class="card mono"><strong>587</strong><span>smtp / STARTTLS</span></div>
  205. <div class="card mono"><strong>465</strong><span>smtps</span></div>
  206. <div class="card mono"><strong>2525</strong><span>smtp</span></div>
  207. </div>
  208. <p class="note" data-i18n="smtp.note">Use a mailbox's full address and password for SMTP, IMAP, and POP3. Prefer TLS ports 465, 993, and 995; use STARTTLS/STLS on the plain ports when needed.</p>
  209. </section>
  210. <section id="webhooks" class="section">
  211. <div class="section-head">
  212. <h2 data-i18n="webhooks.title">Delivery webhooks</h2>
  213. <p data-i18n="webhooks.sub">Terminal events only — signed HTTPS callbacks to your systems.</p>
  214. </div>
  215. <div class="table-wrap">
  216. <table>
  217. <thead>
  218. <tr>
  219. <th data-i18n="webhooks.col.status">Status</th>
  220. <th data-i18n="webhooks.col.type">type</th>
  221. </tr>
  222. </thead>
  223. <tbody>
  224. <tr><td><code>sent</code></td><td><code>email.sent</code></td></tr>
  225. <tr><td><code>bounced</code></td><td><code>email.bounced</code></td></tr>
  226. <tr><td><code>failed</code></td><td><code>email.failed</code></td></tr>
  227. </tbody>
  228. </table>
  229. </div>
  230. <p class="note"><span data-i18n="webhooks.sig">Signature header:</span> <code>X-MailHub-Signature: t=&lt;unix&gt;,v1=&lt;hmac&gt;</code></p>
  231. </section>
  232. <section class="section cta-band">
  233. <h2 data-i18n="ctaBand.title">Ready to send?</h2>
  234. <p data-i18n="ctaBand.sub">Create an account, add a domain, and ship your first message in minutes.</p>
  235. <div class="hero-cta">
  236. <a class="btn btn-primary btn-lg" href="/register" data-i18n="cta.signup">Get started</a>
  237. <a class="btn btn-ghost btn-lg" href="/login" data-i18n="cta.login">Log in</a>
  238. </div>
  239. </section>
  240. </main>
  241. <footer class="site-footer">
  242. <div>
  243. <strong>MailHub</strong>
  244. <span data-i18n="footer.tag">Self-hosted email delivery control plane</span>
  245. </div>
  246. <div class="footer-links">
  247. <a
  248. href="https://github.com/chendeben/MailHub"
  249. target="_blank"
  250. rel="noopener noreferrer"
  251. data-i18n="cta.github"
  252. >GitHub</a>
  253. <a href="/login" data-i18n="cta.login">Log in</a>
  254. <a href="/register" data-i18n="cta.signup">Get started</a>
  255. </div>
  256. </footer>
  257. </div>
  258. <script type="module" src="/src/frontend/landing/main.ts"></script>
  259. </body>
  260. </html>