Author SHA1 Message Date
dsh f281121a4d feat: 前端移动端响应式适配(≤767px)
- 左侧文件夹栏在小屏下变为底部导航条:收件箱/草稿箱/已发送/管理后台 + 居中「写信」悬浮圆钮(带未读角标)
- 顶栏紧凑化:列表页搜索框自动下移为通栏第二行
- 邮件列表:隐藏正文摘要、缩小头像/时间列、行高加大便于触控,删除按钮常显
- 阅读页/写信页/设置页:内边距与字号收紧,配额条适配
- 管理后台:侧栏改为横向换行导航,表格横向滚动,统计卡两列排布
- 全部模板 viewport 增加 viewport-fit=cover(iOS 安全区),底部导航支持 env(safe-area-inset-bottom)
- settings.html 内联样式改为 .settings-main 类以便响应式覆盖
2026-08-17 13:21:19 -04:00
kevin fe1bf25d31 Merge pull request 'docs: README 增加界面预览截图(QQ 邮箱风格界面)' (#7) from dsh/mailgo:docs/readme-screenshots into main
Reviewed-on: kevin/mailgo#7
2026-08-17 04:51:15 -04:00
dsh df5ea7b228 docs: README 增加界面预览截图与 QQ 邮箱风格界面说明 2026-08-17 04:50:53 -04:00
kevin 9e7e8e1fb5 Merge pull request 'feat: 前端整体重写为 QQ 邮箱风格布局' (#6) from dsh/mailgo:feature/qq-mail-frontend into main
Reviewed-on: kevin/mailgo#6
2026-08-17 04:42:34 -04:00
25 changed files with 133 additions and 20 deletions
+14 -1
View File
@@ -1,18 +1,31 @@
# MailGo # MailGo
Go 语言编写的轻量级邮件系统,集成 SMTP / IMAP / POP3 协议服务和 Web 管理界面。 Go 语言编写的轻量级邮件系统,集成 SMTP / IMAP / POP3 协议服务和 Web 管理界面。
Web 前端采用 QQ 邮箱风格的布局:顶部导航 + 左侧文件夹栏 + 邮件列表三栏设计。
## 功能特性 ## 功能特性
- **邮件协议**:SMTP(发送)、IMAP(同步)、POP3(收取),均支持 TLS 加密 - **邮件协议**:SMTP(发送)、IMAP(同步)、POP3(收取),均支持 TLS 加密
- **外部投递**:认证用户可向外部邮箱(QQ/Gmail/Outlook 等)发送邮件,内置外发队列、MX 直投、STARTTLS、指数退避重试、退信通知与 DKIM 签名 - **外部投递**:认证用户可向外部邮箱(QQ/Gmail/Outlook 等)发送邮件,内置外发队列、MX 直投、STARTTLS、指数退避重试、退信通知与 DKIM 签名
- **Web 邮箱**收件箱、已发送、草稿箱、富文本编辑(Quill.js)、附件上传/下载 - **Web 邮箱**QQ 邮箱风格界面,支持收件箱 / 已发送 / 草稿箱、未读角标与搜索过滤、全选 / 批量删除、发件人头像、富文本编辑(Quill.js)、附件上传/下载
- **管理后台**:域名管理、用户管理、DKIM 密钥自动生成、DNS 配置提示、全量邮件查看、外发队列管理、IP 封禁管理、仪表盘统计 - **管理后台**:域名管理、用户管理、DKIM 密钥自动生成、DNS 配置提示、全量邮件查看、外发队列管理、IP 封禁管理、仪表盘统计
- **外部认证**OAuth2Google / GitHub)、LDAP(可选,默认关闭) - **外部认证**OAuth2Google / GitHub)、LDAP(可选,默认关闭)
- **安全机制**:BCrypt 密码哈希、登录失败自动封禁 IP、外发频率限制(防滥用)、非认证禁止中继(防开放中继)、管理员可解封 - **安全机制**:BCrypt 密码哈希、登录失败自动封禁 IP、外发频率限制(防滥用)、非认证禁止中继(防开放中继)、管理员可解封
- **多数据库**:默认 SQLite,可切换 MySQL - **多数据库**:默认 SQLite,可切换 MySQL
- **跨平台**Linux 生产部署 + Windows 本地调试 - **跨平台**Linux 生产部署 + Windows 本地调试
## 界面预览
| 收件箱 | 邮件阅读 |
|--------|----------|
| ![收件箱](docs/screenshots/inbox.png) | ![邮件阅读](docs/screenshots/view.png) |
| 写信 | 设置 | 登录 |
|------|------|------|
| ![写信](docs/screenshots/compose.png) | ![设置](docs/screenshots/settings.png) | ![登录](docs/screenshots/login.png) |
> 截图使用演示数据渲染,实际界面以部署为准。
## 快速开始 ## 快速开始
### 编译 ### 编译
Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

+1 -1
View File
@@ -3,7 +3,7 @@
<html lang="zh-CN"> <html lang="zh-CN">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<title>IP黑名单 - MailGo</title> <title>IP黑名单 - MailGo</title>
{{template "styles" .}} {{template "styles" .}}
</head> </head>
+1 -1
View File
@@ -3,7 +3,7 @@
<html lang="zh-CN"> <html lang="zh-CN">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<title>管理后台 - MailGo</title> <title>管理后台 - MailGo</title>
{{template "styles" .}} {{template "styles" .}}
</head> </head>
+1 -1
View File
@@ -3,7 +3,7 @@
<html lang="zh-CN"> <html lang="zh-CN">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<title>DNS配置 - MailGo</title> <title>DNS配置 - MailGo</title>
{{template "styles" .}} {{template "styles" .}}
</head> </head>
@@ -3,7 +3,7 @@
<html lang="zh-CN"> <html lang="zh-CN">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<title>{{if .isEdit}}编辑域名{{else}}新增域名{{end}} - MailGo</title> <title>{{if .isEdit}}编辑域名{{else}}新增域名{{end}} - MailGo</title>
{{template "styles" .}} {{template "styles" .}}
</head> </head>
+1 -1
View File
@@ -3,7 +3,7 @@
<html lang="zh-CN"> <html lang="zh-CN">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<title>域名管理 - MailGo</title> <title>域名管理 - MailGo</title>
{{template "styles" .}} {{template "styles" .}}
</head> </head>
+1 -1
View File
@@ -3,7 +3,7 @@
<html lang="zh-CN"> <html lang="zh-CN">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<title>查看邮件 - MailGo 管理后台</title> <title>查看邮件 - MailGo 管理后台</title>
{{template "styles" .}} {{template "styles" .}}
<style> <style>
+1 -1
View File
@@ -3,7 +3,7 @@
<html lang="zh-CN"> <html lang="zh-CN">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<title>所有邮件 - MailGo</title> <title>所有邮件 - MailGo</title>
{{template "styles" .}} {{template "styles" .}}
</head> </head>
+1 -1
View File
@@ -3,7 +3,7 @@
<html lang="zh-CN"> <html lang="zh-CN">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<title>外发队列 - MailGo</title> <title>外发队列 - MailGo</title>
{{template "styles" .}} {{template "styles" .}}
</head> </head>
+1 -1
View File
@@ -3,7 +3,7 @@
<html lang="zh-CN"> <html lang="zh-CN">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<title>{{if .isEdit}}编辑用户{{else}}新增用户{{end}} - MailGo</title> <title>{{if .isEdit}}编辑用户{{else}}新增用户{{end}} - MailGo</title>
{{template "styles" .}} {{template "styles" .}}
</head> </head>
+1 -1
View File
@@ -3,7 +3,7 @@
<html lang="zh-CN"> <html lang="zh-CN">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<title>用户管理 - MailGo</title> <title>用户管理 - MailGo</title>
{{template "styles" .}} {{template "styles" .}}
</head> </head>
+1 -1
View File
@@ -3,7 +3,7 @@
<html lang="zh-CN"> <html lang="zh-CN">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<title>访问被禁止 - MailGo</title> <title>访问被禁止 - MailGo</title>
<style> <style>
* { margin: 0; padding: 0; box-sizing: border-box; } * { margin: 0; padding: 0; box-sizing: border-box; }
+100
View File
@@ -31,6 +31,7 @@
input, textarea, select, button { font-family: inherit; } input, textarea, select, button { font-family: inherit; }
input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; } input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }
svg { flex-shrink: 0; } svg { flex-shrink: 0; }
a, button { touch-action: manipulation; }
/* ---------- 顶部导航栏 ---------- */ /* ---------- 顶部导航栏 ---------- */
.topbar { .topbar {
@@ -323,6 +324,105 @@
.sidebar a { display: block; padding: 9px 14px; color: var(--text-2); text-decoration: none; border-radius: 6px; margin-bottom: 2px; font-size: 13.5px; } .sidebar a { display: block; padding: 9px 14px; color: var(--text-2); text-decoration: none; border-radius: 6px; margin-bottom: 2px; font-size: 13.5px; }
.sidebar a:hover, .sidebar a.active { background: var(--primary-soft); color: var(--primary); } .sidebar a:hover, .sidebar a.active { background: var(--primary-soft); color: var(--primary); }
.content { margin-left: 220px; } .content { margin-left: 220px; }
.settings-main { padding: 24px; background: var(--sidebar-bg); }
/* ===== 移动端适配(≤767px ===== */
@media (max-width: 767px) {
:root { --topbar-h: 50px; }
/* 顶栏:紧凑单行 + 列表页搜索框下移为第二行 */
.topbar { height: auto; min-height: 50px; padding: 8px 12px; gap: 8px; flex-wrap: wrap; }
.logo-icon { width: 30px; height: 30px; font-size: 15px; border-radius: 8px; }
.logo-text { font-size: 17px; }
.logo-text em { display: none; }
.topbar-search { flex: 1 1 100%; order: 9; border-radius: 8px; }
body.page-list { --topbar-h: 96px; }
.topbar-right { gap: 12px; }
.user-email { display: none; }
/* 左侧文件夹栏 → 底部导航条 */
.mail-sidebar {
position: fixed; top: auto; bottom: 0; left: 0; right: 0;
width: 100%; height: auto; min-height: 58px;
padding: 4px 8px calc(4px + env(safe-area-inset-bottom));
flex-direction: row; align-items: center; gap: 2px;
background: #fff; border-top: 1px solid var(--border); border-right: none;
z-index: 90; box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04);
}
.folder-nav { display: contents; }
.folder {
flex: 1; flex-direction: column; justify-content: center; gap: 2px;
height: 46px; padding: 0; border-radius: 8px; font-size: 10.5px;
position: relative;
}
.folder-nav .folder:nth-child(1) { order: 1; }
.folder-nav .folder:nth-child(2) { order: 2; }
.folder-nav .folder:nth-child(3) { order: 4; }
.folder svg { width: 19px; height: 19px; }
.folder.active::before { display: none; }
.folder .badge {
position: absolute; top: 1px; right: calc(50% - 20px);
min-width: 16px; height: 16px; padding: 0 4px;
font-size: 10px; line-height: 16px; border-radius: 8px;
}
.folder .count { display: none; }
.compose-btn {
width: 46px; height: 46px; padding: 0; border-radius: 50%;
margin: 0 4px; flex-shrink: 0; order: 3;
font-size: 0; box-shadow: 0 3px 10px rgba(255, 149, 0, 0.5);
transform: translateY(-10px);
}
.compose-btn:hover { transform: translateY(-10px); }
.compose-btn svg { width: 20px; height: 20px; }
.sidebar-footer {
margin: 0; border: none; padding: 0;
flex-direction: row; gap: 2px; order: 5;
}
.mail-main { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
/* 邮件列表 */
.list-toolbar { padding: 8px 10px; gap: 8px; }
.check-all { font-size: 12.5px; }
.tb-btn { height: 30px; padding: 0 9px; font-size: 12.5px; }
.page-info { font-size: 12px; }
.mail-row { padding: 0 10px; height: 60px; gap: 8px; }
.avatar { width: 32px; height: 32px; font-size: 13px; }
.cell-from { width: 88px; font-size: 13px; }
.cell-subject-wrap { flex: 1; min-width: 0; }
.cell-subject { font-size: 13px; }
.cell-snippet { display: none; }
.cell-date { width: 56px; font-size: 11.5px; }
.row-del { opacity: 1; }
.list-footer { padding: 8px 10px; }
.pager { margin-left: auto; gap: 4px; }
/* 阅读页 */
.view-toolbar { padding: 8px 10px; gap: 8px; }
.mail-head { padding: 16px 16px 0; }
.mail-title { font-size: 17px; }
.mail-from-row { gap: 10px; margin: 12px 0 14px; }
.mail-body-wrap { padding: 14px 16px; }
.mail-body-iframe { min-height: 260px; }
.view-actions { padding: 14px 16px 20px; flex-wrap: wrap; }
/* 写信页 */
.compose-toolbar { padding: 8px 10px; gap: 8px; }
.compose-field { padding: 8px 14px; gap: 8px; }
.compose-field label { width: 44px; font-size: 13px; }
.compose-footer { padding: 10px 14px; flex-wrap: wrap; }
.quota-bar { width: 130px; }
/* 设置页 */
.settings-main { padding: 14px; }
/* 管理后台 */
.container { padding: 0 12px; margin: 12px auto; }
.sidebar { float: none; width: 100%; margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; }
.sidebar a { margin: 0; padding: 8px 12px; font-size: 13px; }
.content { margin-left: 0; overflow-x: auto; }
th, td { white-space: nowrap; }
.stat-card { width: calc(50% - 10px); margin: 0 0 10px; }
}
</style> </style>
{{end}} {{end}}
+1 -1
View File
@@ -3,7 +3,7 @@
<html lang="zh-CN"> <html lang="zh-CN">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<title>写信 - MailGo</title> <title>写信 - MailGo</title>
<link href="https://cdn.quilljs.com/1.3.7/quill.snow.css" rel="stylesheet"> <link href="https://cdn.quilljs.com/1.3.7/quill.snow.css" rel="stylesheet">
{{template "styles" .}} {{template "styles" .}}
+1 -1
View File
@@ -3,7 +3,7 @@
<html lang="zh-CN"> <html lang="zh-CN">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<title>草稿箱 - MailGo</title> <title>草稿箱 - MailGo</title>
{{template "styles" .}} {{template "styles" .}}
</head> </head>
+1 -1
View File
@@ -3,7 +3,7 @@
<html lang="zh-CN"> <html lang="zh-CN">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<title>收件箱 - MailGo</title> <title>收件箱 - MailGo</title>
{{template "styles" .}} {{template "styles" .}}
</head> </head>
+1 -1
View File
@@ -3,7 +3,7 @@
<html lang="zh-CN"> <html lang="zh-CN">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<title>登录 - MailGo 邮箱</title> <title>登录 - MailGo 邮箱</title>
{{template "styles" .}} {{template "styles" .}}
</head> </head>
+1 -1
View File
@@ -3,7 +3,7 @@
<html lang="zh-CN"> <html lang="zh-CN">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<title>已发送 - MailGo</title> <title>已发送 - MailGo</title>
{{template "styles" .}} {{template "styles" .}}
</head> </head>
+2 -2
View File
@@ -3,7 +3,7 @@
<html lang="zh-CN"> <html lang="zh-CN">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<title>设置 - MailGo</title> <title>设置 - MailGo</title>
{{template "styles" .}} {{template "styles" .}}
</head> </head>
@@ -11,7 +11,7 @@
{{template "navbar" .}} {{template "navbar" .}}
<div class="app-body"> <div class="app-body">
{{template "sidebar" .}} {{template "sidebar" .}}
<main class="mail-main" style="padding:24px;background:#f6f8fc;"> <main class="mail-main settings-main">
{{if .error}}<div class="alert alert-error">{{.error}}</div>{{end}} {{if .error}}<div class="alert alert-error">{{.error}}</div>{{end}}
{{if .success}}<div class="alert alert-success">{{.success}}</div>{{end}} {{if .success}}<div class="alert alert-success">{{.success}}</div>{{end}}
+1 -1
View File
@@ -3,7 +3,7 @@
<html lang="zh-CN"> <html lang="zh-CN">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<title>查看邮件 - MailGo</title> <title>查看邮件 - MailGo</title>
{{template "styles" .}} {{template "styles" .}}
</head> </head>