Skip to content

倪之帅 Victor 个人主页

  • Home
  • Tech
    • Linux
    • LNMP
    • Mac
    • Mobile
    • Products
    • SMS
  • 英语学习
May 16, 2018 / Linux

postfix删除队列中的邮件

Postfix中有一套Mail Queue Management机制,所有队列中的邮件都可以全自动的处理,但在发送大量邮件的时候,有必要对这个队列进行手工的维护处理,比如说,删除队列中的邮件. 以下是一些常用的命令:

列出目前在 Mail Queue 中的邮件

mailq

刪除所有在 Queue 中的邮件

postsuper -d ALL

刪除所有正在 deferred 队列中的邮件 (删除曾经发送失败的邮件 )

postsuper -d ALL deferred

刪除所有正在 deferred 队列中的郵件 ( 可看出哪些信被刪除了 )

find /var/spool/postfix/deferred -type f -exec rm -vf /{/} /;

刪掉「三天以前」无法发送的邮件

find /var/spool/postfix/deferred -type f -mtime +3 -exec rm -f /{/} /;

列出目前所有无法发送的邮件

find /var/spool/postfix/deferred -type f -exec ls -l –time-style=+%Y-%m-%d_%H:%M:%S {} /;

刪除超过 5 天的 “defer” 佇列中的退信记录

find /var/spool/postfix/defer -type f -mtime +5 -exec rm -f /{/} /;

预设所有跟Postfix 相关的邮件都会放在/var/spool/postfix/ 目录下,想了解Postfix是如何管理队列的,可以参考 qmgr -Postfix queue manager 的手册.
以下是每个目录的用途

MAIL QUEUES

* incoming 收信箱

* active 正在准备发送的邮件

* defered 无法发送的邮件,等待重发

* corrupt 无法读取或者损坏的邮件

* hold 暂停的邮件,需要手工启动 DELIVERY STATUS REPORTS

* bounce 每一位收件者的送信状态,记录为什么退信由 bounce(8) 管理

* defer 每一位收件者的寄送状态,说明为什么延迟由 defer(8) 管理

* trace 每一位收件者的寄送状态信息,说明被 Postfix 用 “sendmail -v” 或 “sendmail -bv” 命令执行的状态由 trace(8) 管理

Post navigation

Previous Post:

mount ntfs-3g

Next Post:

Centos 7 enable port 80

2 Commments

  1. ReinaX says:
    August 29, 2017 at 3:05 pm

    I see your website needs some fresh content. Writing manually takes a lot
    of time, but there is tool for this time consuming task, search for: Wrastain’s tools for content

    Log in to Reply
  2. 86Mavis says:
    August 29, 2017 at 9:15 pm

    I see you don’t monetize your page, don’t waste your traffic,
    you can earn additional bucks every month because you’ve got hi quality content.
    If you want to know how to make extra bucks, search for: best adsense alternative Wrastain’s tools

    Log in to Reply

Leave a Reply Cancel reply

You must be logged in to post a comment.

Categories

  • Linux
  • LNMP
  • Mac
  • Mobile
  • PHP
  • Products
  • SMS
  • Uncategorized
  • VPS
  • 原创
  • 技术

Recent Posts

  • composer切换源_composer全局更换镜像源的教程
  • 宝塔终端切换root用户为www
  • linux 宝塔 nginx php8.0 或者 php7 安装swoole
  • 宝塔面板修改composer默认PHP版本
  • PHP代码http跳转到https

Archives

  • October 2022
  • August 2022
  • June 2020
  • June 2019
  • October 2018
  • May 2018
  • April 2018
  • March 2018
  • July 2016
  • June 2016
  • April 2016
  • November 2015
  • October 2015
  • May 2015
  • April 2015
  • February 2015
  • January 2015
  • December 2014
  • October 2014
  • August 2014
  • April 2014
  • June 2011
  • June 2010
  • May 2010
  • April 2010
  • December 2004
  • October 2002
  • January 2001
  • March 2000
© 2000-2025 倪之帅 Victor 个人主页