postfix / procmail – 在procmailrc中防止重复的电子邮件

我有我的服务器上的后缀,我正在使用procmail和自定义的shell脚本处理传入的电子邮件为我的本地域/计算机上的用户帐户之一。 ([email protected]

当我在电子邮件中只有一个收件人时,一切正常,但只要我在电子邮件列表中添加另一个收件人,我就会收到同样的信息两次! (例如:发送邮件到[email protected][email protected]

main.cf没有特殊的configuration,但是:

mailbox_command = /usr/bin/procmail -a "EXTENSION" 

.procmailrc如下:

 TO=`formail -xTo:` SUBJECT=`formail -xSubject: \ | expand | sed -e 's/^[ ]*//g' -e 's/[ ]*$//g'` SENDER=`formail -xFrom: \ | expand | sed -e 's/^[ ]*//g' -e 's/[ ]*$//g'` BODY=`formail -I "" \ | expand | sed -e '1,/^$/ d' -e '1,/^$/ d'` BODY=`formail -I "" ` SENDER=`formail -rtzxTo:` :0 | $HOME/bin/work.sh "$TO" "$BODY" 

我想在procmailrc中pipe理这个问题,但是我的知识在这种情况下是非常低的。

那么,显然解决scheme是locking/caching文件来过滤重复的消息ID:

 :0 Wh: msgid.lock | formail -D 8192 msgid.cache 

感谢大家 :)