Someone suggested this code to Don:
| => :0
| => * ^To:.*postmaster@
| => {
| => :0
| => {
| => WHOTO=`formail -z -xTo:`
| => COUNT=`echo ${WHOTO} | sed -e 's/[^(_at_)]//g' | wc -c`
| => COUNT1=`expr ${COUNT} - 1`
| => ISGT=`expr ${COUNT1} \> 9`
| => }
| => :0
| => * ISGT ?? ^^1^^
| => ! mailbox.example.com
| => }
| => This may need to be tweaked a bit, but if the "To:" field contains
| => "postmaster@",
| => we'll count the number of "To" recipients, and forward if the count is
| => 10 or more.
That has more forks than an army mess hall. You want to see whether the To:
headers -- of which there may be more than one -- have ten or more at-signs?
:0
* ^To:(.*\<)postmaster@
{
WHOMTO=`formail -zxTo:` # consider including -xCc:
:0
* 1^1 WHOMTO ?? @
* -9^0
! mailbox(_at_)example(_dot_)com
}
The reason I kept formail to set WHOMTO instead of extracting it is that there
could be more than one To: header. Extracting would get only the topmost or
the bottommost; formail -x will get them all.
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail