procmail
[Top] [All Lists]

Re: Maling list

2004-04-16 13:04:35
On Fri, 16 Apr 2004 20:36:22 +0200, Paul R <paul(_at_)bassline(_dot_)nl> wrote:

Hi there,

Probably a simple question: I want a distribution list on my domain. But, to
prevent spammers to use it, I want some security (example the ip-number I
sent the mail from). So what I like to do in pseudocode:

if sender's ip = 111.111.111.111
then forward this mail to user1, user2, user3 etc.
else
dump it in a file called ubusers
endif

Does anyone know how to do this in procmail?


I am not an expert in procmail, but try the follow in your sand box.
See  http://www.professional.org/procmail/sandbox.html on how to setup a
sand box.



Here is what I suggest.

## Define the IP address to trap.
TRAPPEDIP='111.111.111.111'
## Capture the remote IP to $MATCH
:0
* ^Received:.*\[\/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+
 { TCPREMOTEIP=${MATCH} }

## Test if the capture IP address matches TRAPPEDIP
:0
* $TCPREMOTEIP??$TRAPPEDIP
 {
 LOG="Trapped Email Sent from $TCPREMOTEIP, forwarding to  user1, user2,
user3 $NL"
 
Do your forwarding here.
}

There could be more ways to do it, or a better optimized code, but this
should get you in the right way.
Hope this helps.


_______________________________________________
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>