procmail
[Top] [All Lists]

always delivering internally sent email

2004-05-03 07:43:41
Can someone eyeball this recipe?  I trying to guarantee that locally sent
mail within the subnet will always be delivered and bypass the other rules.
Thanks,
-Eric Wood


# Make sure there's only one received header
# Make sure both from and to is within mydomain
# need ip address of received header since mydomain can be spoofed.
# snag the ipaddress from the match
# if email originated from a 10 or 192.168 network, deliver it.

MYDOMAIN="interplas\.com"
IPADDRESS="XXX"
QUAD1="XXX"
QUAD2="XXX"

:0H
* ! ^Received: .*$+Received: \/.*
* $ ^TO_$MYDOMAIN
* $ ^From: .*$MYDOMAIN
* ^Received: .*\[\/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+
{
  IPADDRESS=$MATCH
  :0
  *! IPADDRESS ?? XXX
  {
    :0
    *  IPADDRESS ?? ()\/[0-9]+
    { QUAD1=$MATCH }

    :0
    * IPADDRESS ?? [0-9]+\.\/[0-9]+
    { QUAD2=$MATCH }

    :0:
    * QUAD1 ?? 10
    $DEFAULT

    :0E:
    * QUAD1 ?? 192
    * QUAD2 ?? 168
    $DEFAULT
  }
}




_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>