postfix 服务器邮件操作命令

使用邮件服务首先保证服务器能ping通公网

*查看队列
postqueue -p
*删除队列邮件根据ID
postsuper -d MessageID
*根据发送者来删除队列邮件 ,替换 “info@otherdomain .com”就可以
mailq | tail +2 | awk ‘BEGIN { RS = “” }# $7=sender, $8=recipient1, $9=recipient2{ if ($7 == “info@otherdomain.com” && $9 == “”)print $1 }‘ | tr -d ‘*!’ | postsuper -d -
*根据收件人删除 ,替换you@yourdomain.com 就可以
mailq | tail +2 | awk ‘BEGIN { RS = “” }# $7=sender, $8=recipient1, $9=recipient2{ if ($8 == “you@yourdomain.com” && $9 == “”)print $1 }‘ | tr -d ‘*!’ | postsuper -d -
*根据发生服务器的hostname来删除 ,替换掉 senderhostname
mailq | grep senderhostname | awk ‘{ print $1} ‘| postsuper -d -
*如果当前的系统队列很长,负担很重,我们可以把队列里的邮件先hold
postsuper -h ALL
*当处理完后,再把队列移回来
postsuper -r ALL
postfix本身可以作为命令使用:
*启动postfix
postfix start
*停止postfix
postfix stop
*重新读取postfix配置文件
postfix reload
*立即投递队列中所有邮件(慎用)
postfix flush
*修复队列以及任何权限错误
postfix check
 
常用操作:
postqueue -p 列出队列里的所有邮件
postsuper -d ID 删除一封邮件
postsuper -d ALL 删除所有邮件
postsuper –h ID 保留邮件
postsuper -r ALL 重新排例
postcat -q ID   显示邮件内容
postqueue -f   清空邮件
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值