[Exim] Filter file RegExp problem

Top Page
Delete this message
Reply to this message
Author: Carl Inglis
Date:  
To: exim-users
Subject: [Exim] Filter file RegExp problem
Greetings,

I am running Exim on a Linux box and want to use a (.forward) filter
file to bounce any message which has more than 5 '@' symbols (ie
6 or more recepients).

So far I've come up with:
========
# Exim filter <<== do not edit or remove this line!

if error_message then finish endif

if ${sg{$header_to:,$header_cc:}{\n}{}} matches "(*\@*){6,}" then
       seen mail
       from "postmaster@???"
       bcc "postmaster@???"
       subject "Bounced message"
       text "Some of our addresses do not accept messages with 
more than 5 receipients.\n\nYour message dated: $tod_full\nwith 
subject: $header_subject\nfailed."


       save $home/bounced_messages


endif
========

in the .forward file. It works if I substitute a "," for the "@", but if I
escape the "@" with "\", it doesn't seem to work. Obviously I need
a little help with regular expressions. Or can anyone suggest a
better way of doing this?

This is to block certain "friends" who take great delight in
forwarding round those joke-lists and other such band-width
hogging penc. $deity knows I've tried telling them, but this seems
to be the only way to get the message through. It doesn't help that
SWMBO doesn't want me to block them at the SMTP port. <sigh>

Carl
--
Carl C. Inglis - uther@???
"..as to who I am now, if you're prompted to ask: I'm the ghost of my
future and the sum of my past." - Talis Kimberly, Small Mended
Corners, Archetype Cafe