Oamc

Exchange 邮箱与队列排查 · 修改记录

这是 mail/exchange.md 的每次改动内容,按时间从新到旧。其他文章一起提交的部分不会出现在这里。

#1 2026-10-18 +67 −0 docs: 新增邮件系统、VPN 分类,网络设备补 BGP/QinQ/IRF/镜像 4 篇 60178fc
 new file mode 100644
 @@ -0,0 +1,67 @@
+---
+tags: [Exchange, 邮件, 队列]
+order: 30
+---
+
+# Exchange 邮箱与队列排查
+
+## 场景
+
+公司用 Exchange,要建邮箱、查收发、排队列堆积。
+
+## 前置条件
+
+- 有 Exchange 管理权限(`Exchange Admin Center` 或 PowerShell)
+- 知道邮件流经过哪台服务器
+
+## 配置
+
+```powershell
+# 建邮箱
+New-Mailbox -Name "张三" -UserPrincipalName zhangsan@corp.example.com `
+  -Password (Read-Host -AsSecureString) -FirstName 三 -LastName 张
+
+# 共享邮箱
+New-Mailbox -Shared -Name "客服" -PrimarySmtpAddress support@corp.example.com
+
+# 查邮箱大小
+Get-Mailbox -ResultSize Unlimited |
+  Get-MailboxStatistics |
+  Select-Object DisplayName, TotalItemSize |
+  Sort-Object TotalItemSize -Descending | Select-Object -First 10
+```
+
+排查:
+
+```powershell
+Get-Queue
+Get-Queue | Where-Object { $_.Status -ne "Ready" }
+Get-Message -Queue "服务器\队列" | Select-Object -First 10
+Get-TransportService | Get-MessageTrackingLog -ResultSize 50 |
+  Where-Object { $_.Recipients -like "*zhangsan*" }
+```
+
+## 验证
+
+```powershell
+Test-ServiceHealth
+Send-MailMessage -To zhangsan@corp.example.com -From ops@corp.example.com `
+  -Subject test -Body test -SmtpServer mail.corp.example.com
+```
+
+## 回滚
+
+```powershell
+Disable-Mailbox zhangsan@corp.example.com
+# 或者彻底删掉
+Remove-Mailbox zhangsan@corp.example.com -Confirm:$false
+```
+
+## 坑
+
+- **`Get-Queue` 里 `Retry` 状态堆积**,多半是 DNS 或对端拒收。
+- 磁盘满了传输服务会停止接收,先清日志盘。
+- 删邮箱后还能恢复一段时间,别急着清空已删除邮箱。
+- 发送连接器配错,外发邮件全卡在队列里。
+- 邮件大小限制默认 10MB,用户发大附件会退信。
+- 用 `Get-MessageTrackingLog` 查不到,可能查错了服务器或时间范围。