[Gllug] Postfix and body_checks

Ian Lewis ian.lewis at dlf.org.uk
Fri Nov 25 11:30:56 UTC 2005


> [mailto:gllug-bounces at gllug.org.uk] On Behalf Of Simon Morris
> I'm playing with "body_checks" in postfix to do string replacement in
> the body of emails.
> 
> It essentially works in that if postfix sees the string I am searching
> for it will replace that entire line of the mail with text that I
> specify.
> 
> However I only want to replace the single word that matches the
> regular expression, not the whole line... Is this possible?
> 
<snip />
> It may be that I need to stop thinking about using body_checks and use
> the content filtering module in postfix.

The content filtering is intended to allow checking of headers, body, mime
and so on. It uses the Regular Expressions to do the checking and action
decision. Read this http://www.postfix.org/BUILTIN_FILTER_README.html it
should clarify things.

According to the manual, at least this bit
http://www.postfix.org/header_checks.5.html, it is possible to do some form
of substitution. 

On balance it is better to use postqueue filtering, with Procmail maybe, to
do your substitutions. 

If you want to track your query further look on Neohapsis
http://archives.neohapsis.com/archives/postfix/ where Weitse Wenema and Ralf
Hildebrandt answer Postfix queries. You'll see the attitude to stupid
questions pretty quickly.

Cheers,

Ian
--
Ever tried, ever failed. No matter. Try again, fail again. Fail better
 - Samuel Beckett 

--
Ian Lewis - DLF IT Support Analyst

Disabled Living Foundation (DLF)
380-384 Harrow Road
London W9 2HU
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list