Compare commits

..
2 Commits
Author SHA1 Message Date
thuttuandCopilot 43be32b162 Add creating IMAP folders from the app
Bump version to 0.2.0

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-07 10:03:15 +03:00
thuttuandCopilot 47ec7bdb80 Warn about suspicious mail senders and links
Bump version to 0.1.21

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-07 01:53:01 +03:00
17 changed files with 550 additions and 17 deletions
+2 -2
View File
@@ -4,7 +4,7 @@ An Eternity Project mail client with **Eternity Daylight**, **Wasteland**, and E
## Desktop app
The Electron app runs in its own window. With Node.js installed, run `npm install` and then `npm start`. Open **Mail account settings** to connect an IMAP/SMTP account. Each account can have its own outgoing signature, new-mail notification toggle, periodic sync interval (2–60 minutes; IDLE remains event-driven), and mail rules. Rules match incoming Inbox messages by sender and/or subject; the first matching rule archives, moves to Inbox/Archive/Trash, applies a label, or flags the message. Settings, cached recent messages, offline drafts, and queued mail operations are stored with the encrypted account credentials. Search supports text, sender, subject, date range, attachment, and folder filters; a filtered online search scans up to the newest 5,000 messages in the selected folder. When offline, the app can read cached messages, save drafts, and queue supported message actions and sends for retry on the next successful sync. The app uses required STARTTLS for IMAP port 143 and SMTP port 587. Before preparing a new release, bump the version once with `npm run bump:build`; then build all platform targets for that same version. To package it on Windows, run `npm run dist:win`; the installer and portable `.exe` are written to `release/`. To package on Linux, run `npm install` and `npm run dist:linux` on a Linux machine; this produces AppImage and Debian packages in `release/`.
The Electron app runs in its own window. With Node.js installed, run `npm install` and then `npm start`. Open **Mail account settings** to connect an IMAP/SMTP account. Each account can have its own outgoing signature, new-mail notification toggle, periodic sync interval (2–60 minutes; IDLE remains event-driven), and mail rules. Rules match incoming Inbox messages by sender and/or subject; the first matching rule archives, moves to Inbox/Archive/Trash, applies a label, or flags the message. Sender/domain and extracted message-link checks highlight selected phishing warning signs. Message links are shown separately from the body and require explicit confirmation before opening in a browser; the app never renders remote message HTML. Settings, cached recent messages, offline drafts, and queued mail operations are stored with the encrypted account credentials. Search supports text, sender, subject, date range, attachment, and folder filters; a filtered online search scans up to the newest 5,000 messages in the selected folder. When offline, the app can read cached messages, save drafts, and queue supported message actions and sends for retry on the next successful sync. The app uses required STARTTLS for IMAP port 143 and SMTP port 587. Before preparing a new release, bump the version once with `npm run bump:build`; then build all platform targets for that same version. To package it on Windows, run `npm run dist:win`; the installer and portable `.exe` are written to `release/`. To package on Linux, run `npm install` and `npm run dist:linux` on a Linux machine; this produces AppImage and Debian packages in `release/`.
The `.github/workflows/desktop-build.yml` workflow builds both Windows and Linux artifacts on their native GitHub-hosted runners when manually started from the Actions tab. Snoozed messages return to their original mailbox with a reminder; desktop reminders are checked while the app is running, and Android uses its periodic background worker.
@@ -31,4 +31,4 @@ On Windows, `py -m http.server 8000` is also available on many Python installati
## Current scope
Mail supports multiple IMAP/SMTP accounts, switching between them, and saving message attachments. CalDAV and CardDAV servers can be added from the Calendar and Contacts views; credentials are kept in the OS-encrypted credential store, and events and contacts can sync and be edited on the server. Local contacts and events remain available without a DAV connection. Your display name is saved locally and appears in the greeting.
Mail supports multiple IMAP/SMTP accounts, switching between them, and saving message attachments. CalDAV and CardDAV servers can be added from the Calendar and Contacts views; credentials are kept in the OS-encrypted credential store, and events and contacts can sync and be edited on the server. Local contacts and events remain available without a DAV connection. Your display name is saved locally and appears in the greeting. Use the **+** beside **Folders** in the sidebar to create IMAP folders on the server; your custom folders appear in the sidebar and can be opened like any other folder.
+3 -2
View File
@@ -4,7 +4,7 @@
- [x] Rename the program to **ep-mail** across the app UI, package metadata, desktop builds, and documentation.
- [x] Replace the temporary sun/asterisk app mark with the Git and webmail logo, using the EP Daylight and EP Wasteland color variants.
- [ ] Add Android support for the mail app.
- [x] Add Android support for the mail app.
- [ ] Add macOS support: configure macOS release targets and build the app on a Mac or hosted macOS runner; sign and notarize releases for distribution.
- [x] Show the app version after **ep-mail** in the window title.
@@ -17,9 +17,10 @@
- [ ] Group related messages into conversations, with controls to expand or collapse threads.
- [ ] Add attachment previews and a dedicated view to find and manage attachments across mailboxes.
- [ ] Add configurable keyboard shortcuts for common actions such as compose, archive, reply, and search.
- [ ] Add warnings for suspicious sender addresses and links before opening potentially unsafe content.
- [x] Warn about suspicious sender addresses and links; require confirmation before opening external links.
- [x] Add per-account rules to sort, archive, label, or flag new incoming messages by sender and/or subject.
- [x] Add per-account signatures, notification preferences, and sync settings.
- [x] Add the ability to create IMAP folders from the app.
- [ ] Block remote images by default and let users load them per message.
## Mail security
@@ -528,7 +528,8 @@ internal object AndroidMailService {
val subject = decode(message.subject).ifBlank { "(no subject)" }
val body = ArrayList<String>()
val attachments = JSONArray()
collectParts(message, body, attachments)
val links = linkedSetOf<String>()
collectParts(message, body, attachments, links)
val bodyText = body.joinToString("\n\n").trim().take(8000)
val snippet = (bodyText.ifBlank { subject }).replace(Regex("\\s+"), " ").take(180)
val date = message.receivedDate ?: message.sentDate ?: Date()
@@ -567,6 +568,7 @@ internal object AndroidMailService {
val paragraphs = bodyText.split(Regex("\\n\\s*\\n")).map(String::trim).filter(String::isNotEmpty).take(40)
if (paragraphs.isEmpty()) put("This message has no plain-text body.") else paragraphs.forEach(::put)
})
.put("links", JSONArray().apply { links.take(30).forEach(::put) })
.put("attachments", attachments)
.put("attachment", files.firstOrNull()?.optString("filename") ?: JSONObject.NULL)
.put("size", files.firstOrNull()?.optString("size") ?: "")
@@ -575,7 +577,7 @@ internal object AndroidMailService {
private fun attachmentList(attachments: JSONArray): List<JSONObject> =
(0 until attachments.length()).map { attachments.getJSONObject(it) }
private fun collectParts(part: javax.mail.Part, body: MutableList<String>, attachments: JSONArray) {
private fun collectParts(part: javax.mail.Part, body: MutableList<String>, attachments: JSONArray, links: MutableSet<String>) {
val filename = decode(part.fileName)
if (filename.isNotBlank() || part.disposition.equals(javax.mail.Part.ATTACHMENT, true)) {
val name = filename.ifBlank { "attachment" }
@@ -587,13 +589,18 @@ internal object AndroidMailService {
when (content) {
is String -> if (part.isMimeType("text/plain")) {
body.add(content.replace("\r", "").trim())
} else if (part.isMimeType("text/html") && body.isEmpty()) {
body.add(Html.fromHtml(content, Html.FROM_HTML_MODE_LEGACY).toString().trim())
} else if (part.isMimeType("text/html")) {
Regex("""<a\b[^>]*\bhref\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))""", RegexOption.IGNORE_CASE)
.findAll(content)
.mapNotNull { match -> (match.groups[1]?.value ?: match.groups[2]?.value ?: match.groups[3]?.value)?.replace("&amp;", "&") }
.take(30)
.forEach(links::add)
if (body.isEmpty()) body.add(Html.fromHtml(content, Html.FROM_HTML_MODE_LEGACY).toString().trim())
}
is Multipart -> for (index in 0 until content.count) {
collectParts(content.getBodyPart(index), body, attachments)
collectParts(content.getBodyPart(index), body, attachments, links)
}
is javax.mail.BodyPart -> collectParts(content, body, attachments)
is javax.mail.BodyPart -> collectParts(content, body, attachments, links)
}
}
@@ -632,7 +639,57 @@ internal object AndroidMailService {
return JSONObject().put("saved", true).put("path", file.absolutePath).put("filename", filename)
}
private const val CUSTOM_FOLDER_PREFIX = "Folder:"
private val reservedFolderNames = setOf(
"inbox", "sent", "drafts", "archive", "trash", "starred", "snoozed", "junk", "spam",
"sent items", "sent mail", "sent messages", "archives", "all mail", "deleted items", "deleted messages"
)
fun isCustomFolder(name: String) = name.startsWith(CUSTOM_FOLDER_PREFIX)
private fun customFolders(store: Store): JSONArray {
val systemAttributes = setOf("\\sent", "\\archive", "\\trash", "\\drafts", "\\junk", "\\all", "\\flagged")
val result = JSONArray()
val folders = try { store.defaultFolder.list("*") } catch (_: Exception) { emptyArray() }
folders.filter { folder ->
val attributes = (folder as? IMAPFolder)?.attributes?.map { it.lowercase(Locale.ROOT) } ?: emptyList()
folder.fullName.uppercase(Locale.ROOT) != "INBOX" &&
(folder.type and Folder.HOLDS_MESSAGES) != 0 &&
attributes.none { it in systemAttributes } &&
folder.fullName.lowercase(Locale.ROOT).split(Regex("[./]")).last() !in reservedFolderNames
}.sortedBy { it.fullName }.forEach { folder ->
result.put(JSONObject().put("name", folder.name).put("path", folder.fullName)
.put("id", CUSTOM_FOLDER_PREFIX + folder.fullName))
}
return result
}
fun listFolders(account: JSONObject): JSONObject =
withStore(account) { _, store -> JSONObject().put("folders", customFolders(store)) }
fun createFolder(account: JSONObject, rawName: String): JSONObject {
val name = rawName.trim()
require(name.isNotEmpty() && name.length <= 100) { "Enter a folder name of up to 100 characters." }
require(!Regex("[\\\\/.*%#&\\u0000-\\u001f]").containsMatchIn(name)) {
"Folder names cannot contain / \\ . * % # & or control characters."
}
require(name.lowercase(Locale.ROOT) !in reservedFolderNames) { "That folder name is reserved." }
return withStore(account) { _, store ->
val folder = store.getFolder(name)
check(!folder.exists()) { "A folder with that name already exists." }
check(folder.create(Folder.HOLDS_MESSAGES)) { "The mail server could not create that folder." }
try { folder.isSubscribed = true } catch (_: Exception) {}
JSONObject().put("ok", true)
.put("folder", JSONObject().put("name", name).put("path", folder.fullName)
.put("id", CUSTOM_FOLDER_PREFIX + folder.fullName))
.put("folders", customFolders(store))
}
}
private fun resolveFolder(store: Store, requested: String): Folder? {
if (requested.startsWith(CUSTOM_FOLDER_PREFIX)) {
return store.getFolder(requested.removePrefix(CUSTOM_FOLDER_PREFIX)).takeIf { it.exists() }
}
if (requested == "Inbox" || requested == "Starred" || requested == "Snoozed") {
return store.getFolder("INBOX")
}
@@ -4,7 +4,9 @@ import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.net.Uri
import android.os.Build
import android.app.AlertDialog
import com.getcapacitor.JSObject
import com.getcapacitor.Plugin
import com.getcapacitor.PluginCall
@@ -134,6 +136,28 @@ class EpMailPlugin : Plugin() {
}
}
@PluginMethod
fun listFolders(call: PluginCall) {
try {
val account = AndroidAccountVault.account()
?: throw IllegalStateException("Add a mail account before listing folders.")
call.resolve(AndroidMailService.listFolders(account).toJSObject())
} catch (error: Exception) {
call.resolve(JSObject().put("folders", org.json.JSONArray()).put("offline", true))
}
}
@PluginMethod
fun createFolder(call: PluginCall) {
try {
val account = AndroidAccountVault.account()
?: throw IllegalStateException("Add a mail account before creating folders.")
call.resolve(AndroidMailService.createFolder(account, call.getString("name") ?: "").toJSObject())
} catch (error: Exception) {
call.reject(error.message ?: "Could not create the folder.")
}
}
@PluginMethod
fun syncFolder(call: PluginCall) {
try {
@@ -143,7 +167,7 @@ class EpMailPlugin : Plugin() {
val filters = call.getObject("filters") ?: JSObject()
val filterFolder = filters.getString("folder")
val selected = filterFolder?.takeIf { it in setOf("Inbox", "Sent", "Archive", "Trash", "Starred") } ?: requested
val folder = if (selected in setOf("Inbox", "Sent", "Archive", "Trash", "Starred", "Snoozed")) selected else "Inbox"
val folder = if (selected in setOf("Inbox", "Sent", "Archive", "Trash", "Starred", "Snoozed") || AndroidMailService.isCustomFolder(selected)) selected else "Inbox"
val offset = (call.getInt("offset") ?: 0).coerceAtLeast(0)
AndroidMailService.flushOutbox(account)
call.resolve(AndroidMailService.sync(account, folder, offset, JSONObject(filters.toString())).toJSObject())
@@ -224,6 +248,34 @@ class EpMailPlugin : Plugin() {
}
}
@PluginMethod
fun openExternal(call: PluginCall) {
val raw = call.getString("url").orEmpty()
val uri = runCatching { Uri.parse(raw) }.getOrNull()
if (uri == null || uri.scheme?.lowercase(Locale.ROOT) !in setOf("http", "https") ||
uri.host.isNullOrBlank() || uri.userInfo != null) {
call.reject("Only standard web links can be opened from mail.")
return
}
AlertDialog.Builder(activity)
.setTitle("Open external link?")
.setMessage("Email links can lead to fake sign-in pages or harmful content.\n\nCheck the full address before continuing:\n${uri}")
.setNegativeButton("Cancel") { _, _ -> call.resolve(JSObject().put("opened", false)) }
.setPositiveButton("Open link") { _, _ ->
try {
val intent = Intent(Intent.ACTION_VIEW, uri)
activity.startActivity(intent)
call.resolve(JSObject().put("opened", true))
} catch (_: android.content.ActivityNotFoundException) {
call.reject("No browser is available to open this link.")
} catch (error: Exception) {
call.reject(error.message ?: "Could not open the link.")
}
}
.setOnCancelListener { call.resolve(JSObject().put("opened", false)) }
.show()
}
@PluginMethod
fun send(call: PluginCall) {
val input = JSONObject(call.data.toString()).apply {
+100 -3
View File
@@ -404,6 +404,28 @@ async function findSentMailbox(client, createIfMissing = false) {
return findSpecialMailbox(client, '\\Sent', ['sent', 'sent items', 'sent mail', 'sent messages'], createIfMissing ? 'Sent' : null);
}
const CUSTOM_FOLDER_PREFIX = 'Folder:';
const RESERVED_FOLDER_NAMES = new Set(['inbox', 'sent', 'drafts', 'archive', 'trash', 'starred', 'snoozed', 'junk', 'spam']);
async function listCustomFolders(client) {
return (await client.list())
.filter(mailbox => !mailbox.flags?.has('\\Noselect') && !mailbox.specialUse &&
mailbox.path.toUpperCase() !== 'INBOX' &&
!RESERVED_FOLDER_NAMES.has(mailbox.path.toLowerCase().split(/[./]/).pop()) &&
!['sent items', 'sent mail', 'sent messages', 'archives', 'all mail', 'deleted items', 'deleted messages']
.includes(mailbox.path.toLowerCase().split(/[./]/).pop()))
.map(mailbox => ({ name: mailbox.name, path: mailbox.path, id: CUSTOM_FOLDER_PREFIX + mailbox.path }))
.sort((a, b) => a.path.localeCompare(b.path));
}
function validFolderName(input) {
const name = String(input || '').trim();
if (!name || name.length > 100) throw new Error('Enter a folder name of up to 100 characters.');
if (/[\\/.*%#&\u0000-\u001f]/.test(name)) throw new Error('Folder names cannot contain / \\ . * % # & or control characters.');
if (RESERVED_FOLDER_NAMES.has(name.toLowerCase())) throw new Error('That folder name is reserved.');
return name;
}
async function folderPath(client, folder, createIfMissing = false) {
if (folder === 'Inbox' || folder === 'Starred' || folder === 'Snoozed') return 'INBOX';
const definitions = {
@@ -412,6 +434,12 @@ async function folderPath(client, folder, createIfMissing = false) {
Trash: ['\\Trash', ['trash', 'deleted items', 'deleted messages'], 'Trash']
};
const definition = definitions[folder];
if (!definition && typeof folder === 'string' && folder.startsWith(CUSTOM_FOLDER_PREFIX)) {
const path = folder.slice(CUSTOM_FOLDER_PREFIX.length);
const match = (await client.list()).find(mailbox => mailbox.path === path);
if (!match || match.flags?.has('\\Noselect')) throw new Error('This folder is not available on the mail server.');
return match.path;
}
if (!definition) throw new Error('This folder is not available on the mail server.');
return findSpecialMailbox(client, ...definition.slice(0, 2), createIfMissing ? definition[2] : null);
}
@@ -513,6 +541,11 @@ async function toUiMessage(item, folder) {
const bodyText = String(parsed.text || '').replace(/\r/g, '').trim().slice(0, 20000);
const body = bodyText ? bodyText.split(/\n\s*\n/).map(part => part.trim()).filter(Boolean).slice(0, 40) : ['This message has no plain-text body.'];
const date = parsed.date || item.internalDate || new Date();
const html = Array.isArray(parsed.html) ? parsed.html.join('') : String(parsed.html || '');
const links = [...html.matchAll(/<a\b[^>]*\bhref\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/gi)]
.map(match => (match[1] || match[2] || match[3] || '').replace(/&amp;/gi, '&').replace(/&#x2f;/gi, '/'))
.filter(Boolean)
.slice(0, 30);
return {
id: Number(item.uid),
initials: (sender?.name || sender?.address || '?').split(/[\s@]+/).filter(Boolean).map(word => word[0]).join('').slice(0, 2).toUpperCase(),
@@ -532,6 +565,7 @@ async function toUiMessage(item, folder) {
deleted: folder === 'Trash',
sourceFolder: folder,
body,
links,
uid: Number(item.uid),
attachments: (parsed.attachments || []).map(file => ({ filename: file.filename || 'attachment', size: file.size || 0 })),
attachment: parsed.attachments?.[0]?.filename || null,
@@ -863,7 +897,8 @@ ipcMain.handle('mail:sync-folder', async (_event, requestedFolder, offset = 0, f
if (!account) throw new Error('Add a mail account before syncing.');
const allowedFolders = new Set(['Inbox', 'Sent', 'Archive', 'Trash', 'Starred', 'Snoozed']);
const selectedFolder = allowedFolders.has(filters.folder) ? filters.folder : requestedFolder;
const folder = allowedFolders.has(selectedFolder) ? selectedFolder : 'Inbox';
const folder = allowedFolders.has(selectedFolder) || String(selectedFolder).startsWith(CUSTOM_FOLDER_PREFIX)
? selectedFolder : 'Inbox';
const { folder: _filterFolder, ...criteria } = filters;
try {
await flushMailOutbox(account);
@@ -876,6 +911,43 @@ ipcMain.handle('mail:sync-folder', async (_event, requestedFolder, offset = 0, f
}
});
ipcMain.handle('mail:list-folders', async () => {
const account = await readAccount();
if (!account) throw new Error('Add a mail account before listing folders.');
const client = imapClient(account);
try {
await client.connect();
return { folders: await listCustomFolders(client) };
} catch (error) {
if (isConnectivityFailure(error)) return { folders: [], offline: true };
throw error;
} finally {
if (client.usable) await client.logout().catch(() => {});
}
});
ipcMain.handle('mail:create-folder', async (_event, input) => {
const account = await readAccount();
if (!account) throw new Error('Add a mail account before creating folders.');
const name = validFolderName(input?.name);
const client = imapClient(account);
try {
await client.connect();
const existing = await client.list();
if (existing.some(mailbox => mailbox.path.toLowerCase() === name.toLowerCase())) {
throw new Error('A folder with that name already exists.');
}
const created = await client.mailboxCreate(name);
await client.mailboxSubscribe(created.path).catch(() => {});
return { ok: true, folder: { name, path: created.path, id: CUSTOM_FOLDER_PREFIX + created.path }, folders: await listCustomFolders(client) };
} catch (error) {
if (error.message === 'A folder with that name already exists.') throw error;
throw new Error(`Could not create the folder: ${error.message}`);
} finally {
if (client.usable) await client.logout().catch(() => {});
}
});
ipcMain.handle('mail:list-drafts', async () => {
const account = await readAccount();
if (!account) throw new Error('Add a mail account before opening drafts.');
@@ -1097,6 +1169,32 @@ ipcMain.handle('mail:save-attachment', async (event, input) => {
}
});
ipcMain.handle('mail:open-external', async (event, rawUrl) => {
let target;
try {
target = new URL(String(rawUrl || ''));
} catch {
throw new Error('This link is not a valid web address.');
}
if (!['http:', 'https:'].includes(target.protocol) || target.username || target.password) {
throw new Error('Only standard web links can be opened from mail.');
}
const parent = BrowserWindow.fromWebContents(event.sender);
const confirmation = await dialog.showMessageBox(parent, {
type: 'warning',
title: 'Open external link?',
message: 'Email links can lead to fake sign-in pages or harmful content.',
detail: `Check the full address before continuing:\n${target.href}`,
buttons: ['Cancel', 'Open link'],
defaultId: 0,
cancelId: 0,
noLink: true
});
if (confirmation.response !== 1) return { opened: false };
await shell.openExternal(target.href);
return { opened: true };
});
ipcMain.handle('mail:sync-inbox', async () => {
const account = await readAccount();
if (!account) throw new Error('Add a mail account before syncing.');
@@ -1356,8 +1454,7 @@ function createWindow() {
window.once('ready-to-show', () => window.show());
window.loadFile(path.join(__dirname, '..', 'index.html'));
window.webContents.setWindowOpenHandler(({ url }) => {
if (url.startsWith('https://') || url.startsWith('mailto:')) shell.openExternal(url);
window.webContents.setWindowOpenHandler(() => {
return { action: 'deny' };
});
window.webContents.on('will-navigate', (event, url) => {
+3
View File
@@ -9,6 +9,8 @@ contextBridge.exposeInMainWorld('daybreakMail', {
connect: details => ipcRenderer.invoke('mail:connect', details),
updateAccount: (id, details) => ipcRenderer.invoke('mail:update-account', id, details),
syncFolder: (folder, offset, filters) => ipcRenderer.invoke('mail:sync-folder', folder, offset, filters),
listFolders: () => ipcRenderer.invoke('mail:list-folders'),
createFolder: name => ipcRenderer.invoke('mail:create-folder', { name }),
listDrafts: () => ipcRenderer.invoke('mail:list-drafts'),
saveDraft: draft => ipcRenderer.invoke('mail:save-draft', draft),
deleteDraft: id => ipcRenderer.invoke('mail:delete-draft', id),
@@ -17,6 +19,7 @@ contextBridge.exposeInMainWorld('daybreakMail', {
updateMessage: details => ipcRenderer.invoke('mail:update-message', details),
setSnooze: details => ipcRenderer.invoke('mail:set-snooze', details),
saveAttachment: details => ipcRenderer.invoke('mail:save-attachment', details),
openExternal: url => ipcRenderer.invoke('mail:open-external', url),
send: message => ipcRenderer.invoke('mail:send', message),
disconnect: id => ipcRenderer.invoke('mail:disconnect', id),
davList: () => ipcRenderer.invoke('dav:list'),
+2
View File
@@ -33,6 +33,8 @@
<button class="folder" data-folder="Archive"><span class="nav-glyph">▱</span><span>Archive</span></button>
<button class="folder" data-folder="Trash"><span class="nav-glyph">⌫</span><span>Trash</span></button>
</nav>
<div class="section-label"><span>FOLDERS</span><button class="folder-add" id="add-folder" aria-label="Create folder">+</button></div>
<div id="custom-folders" class="folder-nav"></div>
<div class="sidebar-divider"></div>
<div class="section-label"><span>LABELS</span><button class="tiny-plus" id="add-label" aria-label="Add label">+</button></div>
<button class="label-link" data-label="Design"><i class="label-dot dot-amber"></i>Design</button>
+150
View File
@@ -6,6 +6,154 @@ let mailboxSyncQueued = false;
let mailboxRefreshPending = false;
let folderBeforeSearch = null;
const senderBrandDomains = {
amazon: ['amazon.com', 'amazon.co.uk'],
apple: ['apple.com', 'icloud.com'],
google: ['google.com', 'gmail.com'],
microsoft: ['microsoft.com', 'outlook.com', 'live.com'],
paypal: ['paypal.com']
};
function suspiciousSenderReasons(message) {
const email = String(message.email || '').trim().toLowerCase();
const domain = email.split('@').pop() || '';
if (!domain) return [];
const reasons = [];
if (domain.includes('xn--')) reasons.push('The sender address uses an internationalized domain that may imitate another domain.');
const name = String(message.sender || '').toLowerCase();
for (const [brand, domains] of Object.entries(senderBrandDomains)) {
const brandName = new RegExp(`^(?:the\\s+)?${brand}(?:\\s+(?:customer\\s+service|support|security|account|billing|team|payments?|services?))*$`, 'i');
if (brandName.test(name) && !domains.some(allowed => domain === allowed || domain.endsWith(`.${allowed}`))) {
reasons.push(`The display name mentions ${brand}, but the sender domain is ${domain}.`);
}
}
if (/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(name) && name.split('@').pop() !== domain) {
reasons.push('The address-like display name does not match the actual sender domain.');
}
return [...new Set(reasons)];
}
function inspectMailLink(raw) {
const cleaned = String(raw).replace(/[.,!?;:)\]}>"']+$/g, '');
let parsed;
try { parsed = new URL(cleaned); } catch { return null; }
if (!['http:', 'https:'].includes(parsed.protocol) || parsed.username || parsed.password) return null;
const host = parsed.hostname.toLowerCase();
const reasons = [];
if (parsed.protocol === 'http:') reasons.push('unencrypted HTTP connection');
if (host.includes('xn--')) reasons.push('internationalized domain that may imitate another address');
if (/^(?:\d{1,3}\.){3}\d{1,3}$/.test(host) || host.startsWith('[')) reasons.push('IP-address destination instead of a named website');
if (['bit.ly', 't.co', 'tinyurl.com', 'is.gd', 'lnkd.in'].includes(host)) reasons.push('shortened link hides its final destination');
for (const [brand, domains] of Object.entries(senderBrandDomains)) {
const mentionsBrand = new RegExp(`(^|[.-])${brand.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')}([.-]|$)`, 'i').test(host);
if (mentionsBrand && !domains.some(domain => host === domain || host.endsWith(`.${domain}`))) {
reasons.push(`hostname mentions ${brand} without using its usual domain`);
}
}
return { url: parsed.href, host, reasons };
}
function messageLinks(message) {
const bodyLinks = (message.body || []).join('\n').match(/https?:\/\/[^\s<>"']+/gi) || [];
const declaredLinks = Array.isArray(message.links) ? message.links : [];
return [...new Set([...bodyLinks, ...declaredLinks])]
.map(inspectMailLink)
.filter(Boolean)
.slice(0, 30);
}
const originalOpenMessage = openMessage;
openMessage = function (id) {
originalOpenMessage(id);
const message = messages.find(item => item.id === id);
if (!message) return;
const senderReasons = suspiciousSenderReasons(message);
const links = messageLinks(message);
const warnings = [];
if (senderReasons.length) {
warnings.push(`<section class="mail-safety-warning" role="alert"><strong>Sender details may be misleading</strong><ul>${senderReasons.map(reason => `<li>${esc(reason)}</li>`).join('')}</ul><small>Sender names and addresses can be forged. Verify the sender through a trusted channel.</small></section>`);
}
const linkCards = links.map((link, index) => `
<div class="mail-link-row ${link.reasons.length ? 'mail-link-risky' : ''}">
<div><strong>${link.reasons.length ? 'Potentially unsafe link' : 'External link'}</strong><span>${esc(link.host)}</span>
${link.reasons.length ? `<small>${esc(link.reasons.join('; '))}</small>` : ''}</div>
<button type="button" class="mail-link-open" data-mail-link="${index}">Review &amp; open</button>
</div>`).join('');
const reader = $('#reader-pane');
const header = reader.querySelector('.reader-header');
if (warnings.length && header) header.insertAdjacentHTML('afterend', warnings.join(''));
const replyBar = reader.querySelector('.reply-bar');
if (links.length && replyBar) {
replyBar.insertAdjacentHTML('beforebegin', `<section class="mail-links"><h3>Links in this message</h3>${links.some(link => link.reasons.length) ? '<p class="mail-safety-intro">Some links show warning signs. Every link requires confirmation before it opens.</p>' : ''}${linkCards}</section>`);
reader.querySelectorAll('[data-mail-link]').forEach(button => {
button.onclick = async () => {
const link = links[Number(button.dataset.mailLink)];
if (!link) return;
button.disabled = true;
try {
await window.daybreakMail.openExternal(link.url);
} catch (error) {
toast(error.message || 'Could not open this link');
} finally {
button.disabled = false;
}
};
});
}
};
let customFolders = [];
function renderCustomFolders() {
const box = $('#custom-folders');
if (!box) return;
box.replaceChildren(...customFolders.map(folder => {
const button = document.createElement('button');
button.className = 'folder custom-folder';
button.dataset.folder = folder.id;
button.classList.toggle('active', activeFolder === folder.id);
const glyph = document.createElement('span');
glyph.className = 'nav-glyph';
glyph.textContent = '▭';
const label = document.createElement('span');
label.textContent = folder.name;
button.title = folder.path;
button.append(glyph, label);
button.addEventListener('click', () => {
if ($('#filter-folder').value) { $('#filter-folder').value = ''; folderBeforeSearch = null; }
activeFolder = folder.id;
$$('.folder').forEach(item => item.classList.toggle('active', item === button));
$('#sidebar-title').textContent = folder.name;
$('#crumb-current').textContent = folder.name;
mailPageOffset = 0;
void syncMailbox(false, { offset: 0 });
});
return button;
}));
}
async function loadCustomFolders() {
if (!connectedMailAccount || !window.daybreakMail?.listFolders) return;
try {
customFolders = (await window.daybreakMail.listFolders()).folders || [];
renderCustomFolders();
} catch {}
}
async function createMailFolder() {
if (!connectedMailAccount || !window.daybreakMail?.createFolder) { openMailAccount(); return; }
const name = prompt('New mail folder name:')?.trim();
if (!name) return;
try {
const result = await window.daybreakMail.createFolder(name);
customFolders = result.folders || customFolders;
renderCustomFolders();
toast(`Folder “${result.folder?.name || name}” created`);
} catch (error) {
toast(error.message || 'Could not create the folder');
}
}
function updateAccountCard(account) {
const card = $('#account-settings');
if (!card) return;
@@ -18,6 +166,7 @@ function updateAccountCard(account) {
card.querySelector('.account-info span').textContent = email;
card.title = `${displayName} <${email}>`;
if (typeof renderLabels === 'function') renderLabels();
void loadCustomFolders();
card.querySelector('.online-dot').style.background = '#70ad7b';
const profileButton = $('.top-avatar');
if (profileButton) {
@@ -403,6 +552,7 @@ if (window.daybreakMail) {
});
$('#settings-button').onclick = () => openPreferences();
$('#refresh').onclick = () => syncMailbox(true);
$('#add-folder').addEventListener('click', createMailFolder);
$$('.folder').forEach(button => button.addEventListener('click', () => {
if ($('#filter-folder').value) {
$('#filter-folder').value = '';
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "ep-mail",
"version": "0.1.20",
"version": "0.2.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "ep-mail",
"version": "0.1.20",
"version": "0.2.0",
"dependencies": {
"@capacitor/android": "^8.5.2",
"@capacitor/core": "^8.5.2",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "ep-mail",
"version": "0.1.20",
"version": "0.2.0",
"private": true,
"description": "Eternity Project mail client",
"author": "Eternity Project",
+3
View File
@@ -520,6 +520,8 @@
connect: (details) => EpMail.connect(details),
updateAccount: (id, details) => EpMail.updateAccount({ id, ...details }),
syncFolder: (folder, offset, filters) => EpMail.syncFolder({ folder, offset, filters }),
listFolders: () => EpMail.listFolders(),
createFolder: (name) => EpMail.createFolder({ name }),
listDrafts: () => EpMail.listDrafts(),
saveDraft: (draft) => EpMail.saveDraft(draft),
deleteDraft: (id) => EpMail.deleteDraft({ id }),
@@ -529,6 +531,7 @@
setSnooze: (details) => EpMail.setSnooze(details),
checkSnoozeReminders: () => EpMail.checkSnoozeReminders(),
saveAttachment: (details) => EpMail.saveAttachment(details),
openExternal: (url) => EpMail.openExternal({ url }),
send: (message) => EpMail.send(message),
disconnect: (id) => EpMail.removeAccount({ id }),
davList: () => EpMail.davList(),
+3
View File
@@ -12,6 +12,8 @@ if (Capacitor.isNativePlatform() && Capacitor.getPlatform() === 'android') {
connect: details => EpMail.connect(details),
updateAccount: (id, details) => EpMail.updateAccount({ id, ...details }),
syncFolder: (folder, offset, filters) => EpMail.syncFolder({ folder, offset, filters }),
listFolders: () => EpMail.listFolders(),
createFolder: name => EpMail.createFolder({ name }),
listDrafts: () => EpMail.listDrafts(),
saveDraft: draft => EpMail.saveDraft(draft),
deleteDraft: id => EpMail.deleteDraft({ id }),
@@ -21,6 +23,7 @@ if (Capacitor.isNativePlatform() && Capacitor.getPlatform() === 'android') {
setSnooze: details => EpMail.setSnooze(details),
checkSnoozeReminders: () => EpMail.checkSnoozeReminders(),
saveAttachment: details => EpMail.saveAttachment(details),
openExternal: url => EpMail.openExternal({ url }),
send: message => EpMail.send(message),
disconnect: id => EpMail.removeAccount({ id }),
davList: () => EpMail.davList(),
+5
View File
@@ -121,3 +121,8 @@ body.ep-daylight .row-check:checked{accent-color:#526a2c}
.search-filters{position:absolute;right:78px;top:calc(100% + 8px);z-index:12;display:grid;grid-template-columns:1fr 1fr;gap:10px;width:min(360px,calc(100vw - 32px));padding:14px;border:1px solid var(--border,#d8ddd5);border-radius:12px;background:var(--panel,#fff);box-shadow:0 8px 28px #17201724}.search-filters.hidden{display:none}.search-filters label{display:grid;gap:4px;font-size:12px}.search-filters input,.search-filters select{min-width:0;border:1px solid var(--border,#d8ddd5);border-radius:7px;padding:7px;background:transparent;color:inherit;font:inherit}.search-filters .filter-checkbox{display:flex;align-items:center;gap:7px}.search-filters .filter-checkbox input{min-width:auto}.search-filters .text-button{grid-column:1/-1;justify-self:start}.top-actions{position:relative}
body.ep-wasteland .search-filters{background:#211c18;border-color:#4a3f33;color:#d4cbbc}body.ep-wasteland .search-filters input,body.ep-wasteland .search-filters select{border-color:#4a3f33;color:#d4cbbc}
body.ep-daylight .search-filters{background:#fbfbf6;border-color:#b9c5bc;color:#263a3d}
.mail-safety-warning{margin:10px 16px;padding:12px 14px;border:1px solid #d69b43;border-left:4px solid #b87321;border-radius:8px;background:#fff6df;color:#5b3c17;font-size:12px}.mail-safety-warning strong{display:block}.mail-safety-warning ul{margin:7px 0;padding-left:18px}.mail-safety-warning small{display:block;line-height:1.4}.mail-links{padding:12px 16px;border-top:1px solid var(--line,#eaede8)}.mail-links h3{margin:0 0 8px;font-size:12px}.mail-safety-intro{font-size:11px;color:#8d4a16}.mail-link-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 10px;margin-top:6px;border:1px solid var(--line,#eaede8);border-radius:8px;font-size:11px}.mail-link-row>div{min-width:0;display:grid;gap:3px}.mail-link-row span,.mail-link-row small{overflow-wrap:anywhere;color:#727970}.mail-link-risky{border-color:#d69b43;background:#fff8ea}.mail-link-open{flex:none;border:1px solid #9ba99b;border-radius:6px;background:transparent;padding:6px 8px;font-size:10px}.mail-link-open:disabled{opacity:.55;cursor:wait}
body.ep-wasteland .mail-safety-warning{background:#392719;border-color:#a8793e;color:#f0d4a3}body.ep-wasteland .mail-link-row{border-color:#4a3f33}body.ep-wasteland .mail-link-risky{background:#392719;border-color:#a8793e}body.ep-wasteland .mail-link-row span,body.ep-wasteland .mail-link-row small{color:#cbbba0}
body.ep-daylight .mail-safety-warning{background:#fff6df;color:#5b3c17}body.ep-daylight .mail-link-risky{background:#fff8ea;border-color:#d69b43}
.folder-add{border:0;background:transparent;color:#929990;font-size:18px;cursor:pointer}.folder-add:hover{color:#487354}.section-label+.folder-nav:empty{display:none}.custom-folder span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
+2
View File
@@ -33,6 +33,8 @@
<button class="folder" data-folder="Archive"><span class="nav-glyph">▱</span><span>Archive</span></button>
<button class="folder" data-folder="Trash"><span class="nav-glyph">⌫</span><span>Trash</span></button>
</nav>
<div class="section-label"><span>FOLDERS</span><button class="folder-add" id="add-folder" aria-label="Create folder">+</button></div>
<div id="custom-folders" class="folder-nav"></div>
<div class="sidebar-divider"></div>
<div class="section-label"><span>LABELS</span><button class="tiny-plus" id="add-label" aria-label="Add label">+</button></div>
<button class="label-link" data-label="Design"><i class="label-dot dot-amber"></i>Design</button>
+150
View File
@@ -6,6 +6,154 @@ let mailboxSyncQueued = false;
let mailboxRefreshPending = false;
let folderBeforeSearch = null;
const senderBrandDomains = {
amazon: ['amazon.com', 'amazon.co.uk'],
apple: ['apple.com', 'icloud.com'],
google: ['google.com', 'gmail.com'],
microsoft: ['microsoft.com', 'outlook.com', 'live.com'],
paypal: ['paypal.com']
};
function suspiciousSenderReasons(message) {
const email = String(message.email || '').trim().toLowerCase();
const domain = email.split('@').pop() || '';
if (!domain) return [];
const reasons = [];
if (domain.includes('xn--')) reasons.push('The sender address uses an internationalized domain that may imitate another domain.');
const name = String(message.sender || '').toLowerCase();
for (const [brand, domains] of Object.entries(senderBrandDomains)) {
const brandName = new RegExp(`^(?:the\\s+)?${brand}(?:\\s+(?:customer\\s+service|support|security|account|billing|team|payments?|services?))*$`, 'i');
if (brandName.test(name) && !domains.some(allowed => domain === allowed || domain.endsWith(`.${allowed}`))) {
reasons.push(`The display name mentions ${brand}, but the sender domain is ${domain}.`);
}
}
if (/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(name) && name.split('@').pop() !== domain) {
reasons.push('The address-like display name does not match the actual sender domain.');
}
return [...new Set(reasons)];
}
function inspectMailLink(raw) {
const cleaned = String(raw).replace(/[.,!?;:)\]}>"']+$/g, '');
let parsed;
try { parsed = new URL(cleaned); } catch { return null; }
if (!['http:', 'https:'].includes(parsed.protocol) || parsed.username || parsed.password) return null;
const host = parsed.hostname.toLowerCase();
const reasons = [];
if (parsed.protocol === 'http:') reasons.push('unencrypted HTTP connection');
if (host.includes('xn--')) reasons.push('internationalized domain that may imitate another address');
if (/^(?:\d{1,3}\.){3}\d{1,3}$/.test(host) || host.startsWith('[')) reasons.push('IP-address destination instead of a named website');
if (['bit.ly', 't.co', 'tinyurl.com', 'is.gd', 'lnkd.in'].includes(host)) reasons.push('shortened link hides its final destination');
for (const [brand, domains] of Object.entries(senderBrandDomains)) {
const mentionsBrand = new RegExp(`(^|[.-])${brand.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')}([.-]|$)`, 'i').test(host);
if (mentionsBrand && !domains.some(domain => host === domain || host.endsWith(`.${domain}`))) {
reasons.push(`hostname mentions ${brand} without using its usual domain`);
}
}
return { url: parsed.href, host, reasons };
}
function messageLinks(message) {
const bodyLinks = (message.body || []).join('\n').match(/https?:\/\/[^\s<>"']+/gi) || [];
const declaredLinks = Array.isArray(message.links) ? message.links : [];
return [...new Set([...bodyLinks, ...declaredLinks])]
.map(inspectMailLink)
.filter(Boolean)
.slice(0, 30);
}
const originalOpenMessage = openMessage;
openMessage = function (id) {
originalOpenMessage(id);
const message = messages.find(item => item.id === id);
if (!message) return;
const senderReasons = suspiciousSenderReasons(message);
const links = messageLinks(message);
const warnings = [];
if (senderReasons.length) {
warnings.push(`<section class="mail-safety-warning" role="alert"><strong>Sender details may be misleading</strong><ul>${senderReasons.map(reason => `<li>${esc(reason)}</li>`).join('')}</ul><small>Sender names and addresses can be forged. Verify the sender through a trusted channel.</small></section>`);
}
const linkCards = links.map((link, index) => `
<div class="mail-link-row ${link.reasons.length ? 'mail-link-risky' : ''}">
<div><strong>${link.reasons.length ? 'Potentially unsafe link' : 'External link'}</strong><span>${esc(link.host)}</span>
${link.reasons.length ? `<small>${esc(link.reasons.join('; '))}</small>` : ''}</div>
<button type="button" class="mail-link-open" data-mail-link="${index}">Review &amp; open</button>
</div>`).join('');
const reader = $('#reader-pane');
const header = reader.querySelector('.reader-header');
if (warnings.length && header) header.insertAdjacentHTML('afterend', warnings.join(''));
const replyBar = reader.querySelector('.reply-bar');
if (links.length && replyBar) {
replyBar.insertAdjacentHTML('beforebegin', `<section class="mail-links"><h3>Links in this message</h3>${links.some(link => link.reasons.length) ? '<p class="mail-safety-intro">Some links show warning signs. Every link requires confirmation before it opens.</p>' : ''}${linkCards}</section>`);
reader.querySelectorAll('[data-mail-link]').forEach(button => {
button.onclick = async () => {
const link = links[Number(button.dataset.mailLink)];
if (!link) return;
button.disabled = true;
try {
await window.daybreakMail.openExternal(link.url);
} catch (error) {
toast(error.message || 'Could not open this link');
} finally {
button.disabled = false;
}
};
});
}
};
let customFolders = [];
function renderCustomFolders() {
const box = $('#custom-folders');
if (!box) return;
box.replaceChildren(...customFolders.map(folder => {
const button = document.createElement('button');
button.className = 'folder custom-folder';
button.dataset.folder = folder.id;
button.classList.toggle('active', activeFolder === folder.id);
const glyph = document.createElement('span');
glyph.className = 'nav-glyph';
glyph.textContent = '▭';
const label = document.createElement('span');
label.textContent = folder.name;
button.title = folder.path;
button.append(glyph, label);
button.addEventListener('click', () => {
if ($('#filter-folder').value) { $('#filter-folder').value = ''; folderBeforeSearch = null; }
activeFolder = folder.id;
$$('.folder').forEach(item => item.classList.toggle('active', item === button));
$('#sidebar-title').textContent = folder.name;
$('#crumb-current').textContent = folder.name;
mailPageOffset = 0;
void syncMailbox(false, { offset: 0 });
});
return button;
}));
}
async function loadCustomFolders() {
if (!connectedMailAccount || !window.daybreakMail?.listFolders) return;
try {
customFolders = (await window.daybreakMail.listFolders()).folders || [];
renderCustomFolders();
} catch {}
}
async function createMailFolder() {
if (!connectedMailAccount || !window.daybreakMail?.createFolder) { openMailAccount(); return; }
const name = prompt('New mail folder name:')?.trim();
if (!name) return;
try {
const result = await window.daybreakMail.createFolder(name);
customFolders = result.folders || customFolders;
renderCustomFolders();
toast(`Folder “${result.folder?.name || name}” created`);
} catch (error) {
toast(error.message || 'Could not create the folder');
}
}
function updateAccountCard(account) {
const card = $('#account-settings');
if (!card) return;
@@ -18,6 +166,7 @@ function updateAccountCard(account) {
card.querySelector('.account-info span').textContent = email;
card.title = `${displayName} <${email}>`;
if (typeof renderLabels === 'function') renderLabels();
void loadCustomFolders();
card.querySelector('.online-dot').style.background = '#70ad7b';
const profileButton = $('.top-avatar');
if (profileButton) {
@@ -403,6 +552,7 @@ if (window.daybreakMail) {
});
$('#settings-button').onclick = () => openPreferences();
$('#refresh').onclick = () => syncMailbox(true);
$('#add-folder').addEventListener('click', createMailFolder);
$$('.folder').forEach(button => button.addEventListener('click', () => {
if ($('#filter-folder').value) {
$('#filter-folder').value = '';
+3
View File
@@ -520,6 +520,8 @@
connect: (details) => EpMail.connect(details),
updateAccount: (id, details) => EpMail.updateAccount({ id, ...details }),
syncFolder: (folder, offset, filters) => EpMail.syncFolder({ folder, offset, filters }),
listFolders: () => EpMail.listFolders(),
createFolder: (name) => EpMail.createFolder({ name }),
listDrafts: () => EpMail.listDrafts(),
saveDraft: (draft) => EpMail.saveDraft(draft),
deleteDraft: (id) => EpMail.deleteDraft({ id }),
@@ -529,6 +531,7 @@
setSnooze: (details) => EpMail.setSnooze(details),
checkSnoozeReminders: () => EpMail.checkSnoozeReminders(),
saveAttachment: (details) => EpMail.saveAttachment(details),
openExternal: (url) => EpMail.openExternal({ url }),
send: (message) => EpMail.send(message),
disconnect: (id) => EpMail.removeAccount({ id }),
davList: () => EpMail.davList(),
+5
View File
@@ -121,3 +121,8 @@ body.ep-daylight .row-check:checked{accent-color:#526a2c}
.search-filters{position:absolute;right:78px;top:calc(100% + 8px);z-index:12;display:grid;grid-template-columns:1fr 1fr;gap:10px;width:min(360px,calc(100vw - 32px));padding:14px;border:1px solid var(--border,#d8ddd5);border-radius:12px;background:var(--panel,#fff);box-shadow:0 8px 28px #17201724}.search-filters.hidden{display:none}.search-filters label{display:grid;gap:4px;font-size:12px}.search-filters input,.search-filters select{min-width:0;border:1px solid var(--border,#d8ddd5);border-radius:7px;padding:7px;background:transparent;color:inherit;font:inherit}.search-filters .filter-checkbox{display:flex;align-items:center;gap:7px}.search-filters .filter-checkbox input{min-width:auto}.search-filters .text-button{grid-column:1/-1;justify-self:start}.top-actions{position:relative}
body.ep-wasteland .search-filters{background:#211c18;border-color:#4a3f33;color:#d4cbbc}body.ep-wasteland .search-filters input,body.ep-wasteland .search-filters select{border-color:#4a3f33;color:#d4cbbc}
body.ep-daylight .search-filters{background:#fbfbf6;border-color:#b9c5bc;color:#263a3d}
.mail-safety-warning{margin:10px 16px;padding:12px 14px;border:1px solid #d69b43;border-left:4px solid #b87321;border-radius:8px;background:#fff6df;color:#5b3c17;font-size:12px}.mail-safety-warning strong{display:block}.mail-safety-warning ul{margin:7px 0;padding-left:18px}.mail-safety-warning small{display:block;line-height:1.4}.mail-links{padding:12px 16px;border-top:1px solid var(--line,#eaede8)}.mail-links h3{margin:0 0 8px;font-size:12px}.mail-safety-intro{font-size:11px;color:#8d4a16}.mail-link-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 10px;margin-top:6px;border:1px solid var(--line,#eaede8);border-radius:8px;font-size:11px}.mail-link-row>div{min-width:0;display:grid;gap:3px}.mail-link-row span,.mail-link-row small{overflow-wrap:anywhere;color:#727970}.mail-link-risky{border-color:#d69b43;background:#fff8ea}.mail-link-open{flex:none;border:1px solid #9ba99b;border-radius:6px;background:transparent;padding:6px 8px;font-size:10px}.mail-link-open:disabled{opacity:.55;cursor:wait}
body.ep-wasteland .mail-safety-warning{background:#392719;border-color:#a8793e;color:#f0d4a3}body.ep-wasteland .mail-link-row{border-color:#4a3f33}body.ep-wasteland .mail-link-risky{background:#392719;border-color:#a8793e}body.ep-wasteland .mail-link-row span,body.ep-wasteland .mail-link-row small{color:#cbbba0}
body.ep-daylight .mail-safety-warning{background:#fff6df;color:#5b3c17}body.ep-daylight .mail-link-risky{background:#fff8ea;border-color:#d69b43}
.folder-add{border:0;background:transparent;color:#929990;font-size:18px;cursor:pointer}.folder-add:hover{color:#487354}.section-label+.folder-nav:empty{display:none}.custom-folder span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}