[英]Delete Mails from Postfix Queue with filter from and to
I try to delete some special mails from Postifx Queue.我尝试从 Postifx 队列中删除一些特殊邮件。 I want to Filter with "Mail From" and Mail Domain "TO".我想用“邮件发件人”和邮件域“收件人”过滤。
I have tried:我试过了:
mailq|grep 'info@sendingdomain.com'|awk '/ @test\.com$/ { print $1 }' | tr -d '*!' | postsuper -d -
But it don't work.但它不起作用。
You can use this bunch of code你可以使用这堆代码
#!/bin/bash
[ ! -n "$1" ] && echo "Usage : $0 mail" && exit 1
for mail in $( mailq|egrep '^[A-Z0-9]'|grep "$1"|awk '{print $1}'|sed 's/^\([0-9A-Z]*\).*$/\1/' )
do
/usr/sbin/postsuper -d $mail
done
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.