分类:
2009-06-17 01:02:47
#!/bin/sh
find /var/qmail/queue -type f |xargs rm
touch /var/qmail/queue/lock/sendmutex
touch /var/qmail/queue/lock/tcpto
chown qmails.qmail /var/qmail/queue/lock/sendmutex
chown qmailr.qmail /var/qmail/queue/lock/tcpto
echo "Qmail queue clear finished!\n";
qmail,配置相关查看清除邮件队列
查看队列
# /var/qmail/bin/qmail-qstat
清除队列
方法一(标准):
qmailctl stop
find /var/qmail/queue -type f -exec rm {} \;
touch /var/qmail/queue/lock/sendmutex
chown qmails.qmail /var/qmail/queue/lock/sendmute
qmailctl start
方法二(事先准备): 已经有了现成的空队列的queue目录:
qmailctl stop
rm -rf /var/qmail/queue
tar xf /var/qmail/queue.tar
qmailctl start
方法三(外部工具): 已经安装了qmail-remove工具,并且创建了/var/qmail/queue/yanked目录。
qmailctl stop
qmail-remove -r
qmailctl start
如果一下子删除了 /var/qmail/queue 里面的文件 maillog出现提示: Aug 27 17:51:28 web qmail: 1061999488.699898 alert: cannot start: unable to open mutex qmail启动不了 那就这样做: touch /var/qmail/queue/lock/sendmutex chown qmails:qmail sendmutex qmailctl start |