/** * Mock Mail Service for UX Debug Mode * Provides sample emails without requiring IMAP/SMTP connections */ const Mail = require('../../domain/mail') const EventEmitter = require('events') const path = require('path') const fs = require('fs') // Clara's PGP Public Key const CLARA_PGP_KEY = `-----BEGIN PGP PUBLIC KEY BLOCK----- mQENBGb92JcBCADNMGkl6x2e//Prbbyvlb3EE6BwfOdKpSa+70bJ8fsudlkas5VN Iyuq6Kmuk8V9LD5qBL3e0SMe2x3K5xb+j0Wim/n0OIHkbdnAOtLqEbYMSAzL3keo mqw5qbV47js3rxht9BZ2HYZm5GqOqLz4XuIomSS/EsDcuQDKVtKveE2nRkJUIORr C+DNFcjgJc3yrF1bKE3KQz2ii7qNRH/ChKRXB+OS/7ZviQOSTlFVPGhjIxaI2sRI Uw8U8pWPYyQzh+dpiA3OmzbF1/BB2AQOx98p975KTI4wmalF5PtsKnkFFZ1NPKC6 E6G0IIbDkEE1HBpEO4qmIuWd/tFyIP03EwL3ABEBAAG0G0NsYXJhIEsgPGNsYXJh QGNyYXp5Y28ueHl6PokBSgQQAQgAHQUCZv3YlwQLCQcIAxUICgQWAAIBAhkBAhsD Ah4BACEJEAGLYq6lsVaPFiEEmKN22IQaxMpTgI1sAYtirqWxVo8IOAf9HJglE8hQ bqGtbCISKGOkeIq8TFr9A2MRaevNVQtf4o9TnzMi+9nFGfi6yniiceBz9oUWoXvt ZkhEzc0Hn6PAX/sOW3r6wPu5gSaGjUJfd339aDasyZvdOoQ4cukcErIaFnAG7KmP 0Q7lyRp5K7dUmuc9b9dg5ngf+M8306dj/djHWCPtsaLJc7ExrfeT1lNA7MeY7DlE 9jdvm4hfwQZND16nXKKLZn/RZUkR5Zoo1LE+GSL0/GCFZeH1PnEt5kcI3QKyx9wn +DlMcAZCVs2X5JzTbJQKr9Cwv1syOlaZmVeUTuKiTfAB71wINQkFHdmONIg0h9wp ThTjXOlDsQvnP7kBDQRm/diXAQgAg8BaBpL//o62UrrbQ79WbVzVTH+2f+xVD8bE tyEL1QjllFfPdc5oT9nQ5RPfN6IJpbN0/p688pQa10gFgjEN0WtI51Vda/PQ1FQ8 q1xXbH6zJXP3FAPEPTId4Rw7Gb+vaUaBo3O0ZyKpAxzEy2gIvXz2ChfL6ENn5QZ/ 1DsBeQQE3YbgG+jXAL//JGjINoppOTCfnEMlKaZYdkLvA2KiJKqtD+JDTVFkdk02 1Jext8Td6wkd72i0+DQI9RaJJr5oDXlxAN0iX4OMSdo35e2Mj4AktjvO8JzRvZjU uPCGYH9DpVoB0OCNRmD/2CeUyQgiehk8NHXLxf8h1duTGZYYRQARAQABiQE2BBgB CAAJBQJm/diXAhsMACEJEAGLYq6lsVaPFiEEmKN22IQaxMpTgI1sAYtirqWxVo/R cQgAmJ0taRUkOmoepQR6JNJejF1JiITQy5eSvZzXDBoEWip4fcl4FRAy5yz6s/sC NtweWyWMg3+lu+s7qh3r1Qw5EN7ukgUy+fvk6xY3TBxcJ1aC/KvKbaeTrZt0Bt6U sQipNDI/cPkL2ILzqt/shEgj9g/EWARe1X5SQ0nEhCYLi7xZV9lBe3dU+EUlmwSe gmxppMfACd9hyVV4SbO6l5NKmXgkYWNMzFzjfg3pxAPuJjaaYN85XETqpKwdfPRt KUPuyh+UdOt8GPRBcFxjRJQrBRw2nBJxCCEJOJAJJ2ySpHQBwpaXsK0WW2SGkaxF ggOCb56KkepgTvU3Xdv5opRZAg== =HEe7 -----END PGP PUBLIC KEY BLOCK-----` class MockMailService extends EventEmitter { constructor(config) { super() this.config = config this.mockEmails = this._generateMockEmails() this.logoAttachment = this._getLogoAttachment() } _getLogoAttachment() { // Try to read the service logo const logoPath = path.join(__dirname, '../infrastructure/web/public/images/logo.png') if (fs.existsSync(logoPath)) { return { filename: '48hr-email-logo.png', content: fs.readFileSync(logoPath), contentType: 'image/png' } } return null } _generateMockEmails() { const domain = this.config.email.domains[0] const now = new Date() const earlier = new Date(now.getTime() - 3600000) // 1 hour ago return [{ mail: Mail.create( [`demo@${domain}`], [{ name: 'Clara K', address: 'clara@crazyco.xyz' }], earlier.toISOString(), 'Welcome to 48hr.email - Plain Text Demo', 1 ), fullMail: { text: `Hello from 48hr.email! This is a plain text demonstration email for UX debugging purposes. 48hr.email is your favorite open-source temporary email service, created by ClaraCrazy. Features: - Disposable email addresses - No registration required - Auto-delete after configured time - Open source (GPL-3.0) - Self-hostable For more information, visit: https://48hr.email GitHub: https://github.com/Crazyco-xyz/48hr.email Discord: https://discord.gg/crazyco --- Clara's PGP Public Key: ${CLARA_PGP_KEY} --- This is a mock email generated for UX debug mode. No actual IMAP or SMTP connections were used.`, textAsHtml: `
Hello from 48hr.email!
This is a plain text demonstration email for UX debugging purposes.
48hr.email is your favorite open-source temporary email service, created by ClaraCrazy.
Features:
- Disposable email addresses
- No registration required
- Auto-delete after configured time
- Open source (GPL-3.0)
- Self-hostable
For more information, visit: https://48hr.email
GitHub: https://github.com/Crazyco-xyz/48hr.email
Discord: https://discord.gg/crazyco
---
Clara's PGP Public Key:
${CLARA_PGP_KEY}
---
This is a mock email generated for UX debug mode.
No actual IMAP or SMTP connections were used.
Temporary inbox, no registration
Open-source temporary email service. Create disposable addresses instantly and receive emails without registration. Emails auto-delete after the configured purge time.