Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的 Exim 邮件队列中充满了垃圾邮件,因此我运行了一个自定义 grep 命令来搜索包含垃圾邮件术语的假脱机邮件。问题是,我不知道 Exim 将消息分成多个文件(一个用于标头信息,一个用于数据等),因此我的 grep 命令在保留标头文件的同时删除了数据文件。
有谁知道我可以轻松查找和删除队列中具有头文件但没有数据文件的消息的方法?还是另一种解决方法?
找到他们:
exipick '$message_body_missing'
查找并删除它们:
exipick -i '$message_body_missing' | xargs exim -Mrm
由于缺乏 exipick,
cd /var/spool/exim/input find -name "*-H" -exec sh -c 'H={}; if [ ! -e ${H%-*}-D ]; then rm $H; fi' \;