在 Debian 系统中,“邮件组件”可能指 邮件传输代理(MTA,如 Postfix、Exim、Sendmail),也可能指 邮件客户端或库(如 Dovecot、mailutils、mutt)。下面以最常见的情况(Postfix / Exim)为主,说明如何降级这些组件。
先确认你当前安装的是哪个邮件系统:
dpkg -l | grep -E 'postfix|exim|sendmail|dovecot|mailutils'
常见结果:
postfixexim4dovecot-coremailutilsDebian 默认只保留当前仓库中的最新版本,因此降级通常需要指定旧版本号或启用旧仓库(snapshot / archive)。
apt-cache policy postfix
示例输出:
postfix:
Installed: 3.8.2-1
Candidate: 3.8.2-1
Version table:
3.8.2-1 500
500 http://deb.debian.org/debian bookworm/main amd64 Packages
如果只有当前版本,则无法直接降级。
访问 Debian 包归档:
找到你需要的版本,例如:
postfix=3.7.6-0+deb12u2
编辑源列表:
sudo nano /etc/apt/sources.list.d/snapshot.list
添加(示例,日期需替换):
deb [trusted=yes] https://snapshot.debian.org/archive/debian/20240101T000000Z/ bookworm main
更新:
sudo apt update
sudo apt install postfix=3.7.6-0+deb12u2
如果依赖冲突,可同时指定依赖版本:
sudo apt install postfix=3.7.6-0+deb12u2 libsasl2-2=2.1.28+dfsg-10
apt-get --allow-downgrades(慎用)如果你已经手动下载了 .deb 文件:
sudo apt-get install --allow-downgrades ./postfix_3.7.6-0+deb12u2_amd64.deb
⚠️ 风险:
降级成功后,建议锁定版本:
sudo apt-mark hold postfix
解除锁定:
sudo apt-mark unhold postfix
apt-cache policy exim4
sudo apt install exim4=4.96-15+deb12u2
sudo apt install mutt=2.2.9-1
cp -a /etc/postfix /etc/postfix.bak
你可以直接贴出:
dpkg -l | grep -E 'postfix|exim|mail'