[exim] Conditional pipe's in dotforward?

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Robert Nicholson
Fecha:  
A: exim-users
Asunto: [exim] Conditional pipe's in dotforward?
So I have something like this in my .forward file

if foranyaddress $header_to:,$header_cc: ( $thisaddress matches ^robert 
\@elasti
ca.com\$ )
   and
   (
$rheader_from: does not match "\\s*=\\?(ks_c_5601-|big5|euc-|shift[- 
_]jis|(iso.
\{0,4\}639-)|hkscs|sil|koi[78]|iscii|guobiao|gb2312|gb18030|(iso. 
\{0,4\}2022)|(
iso.\{0,4\}8859-[57])|(windows-1251)|(windows-1255))" and
$rheader_content-type: does not match "\\s*=\\?(ks_c_5601-|big5|euc-| 
shift[-_]j
is|(iso.\{0,4\}639-)|hkscs|sil|koi[78]|iscii|guobiao|gb2312|gb18030| 
(iso.\{0,4\
}2022)|(iso.\{0,4\}8859-[57])|(windows-1251)|(windows-1255))" and
$rheader_subject: does not match "\\s*=\\?(ks_c_5601-|big5|euc-|shift[- 
_]jis|(i
so.\{0,4\}639-)|hkscs|sil|koi[78]|iscii|guobiao|gb2312|gb18030|(iso. 
\{0,4\}2022
)|(iso.\{0,4\}8859-[57])|(windows-1251)|(windows-1255))" and
$message_body: does not match ".*charset=3D(ks_c_5601-|big5|euc-| 
shift[-_]jis|(
iso.\{0,4\}639-)|hkscs|sil|koi[78]|iscii|guobiao|gb2312|gb18030|(iso. 
\{0,4\}202
)|(iso.\{0,4\}8859-[57])|(windows-1251)|(windows-1255))"
   )
   then
    #logwrite "saving backup header_from $header_from: header_to  
$header_to:"
    #logwrite "Saving"
    #logwrite "$header_content-type:"
    #logwrite "$header_subject:"
    #logwrite "$header_from:"
    save $home/Maildir/.INBOX.intray.backup/
endif


Unfortunately this doesn't do a good enough job of screening out asian
character sets

I'd rather execute a pipe to evaluate whether or not a mail has a
faraway character set.

If it doesn't I'd save the mail to my backup folder.

At the very end of my .forward I invoke a pipe which generally should
only get mail that doesn't
include asian character sets. The purpose of the above backup folder
is to make sure I have a copy
of mail that would normally expected to thru the pipe just in case
there's an error with the pipe's
perl script.

So how can I use a pipe to determine whether I write to the backup
folder and if it hasn't
written to that backup folder still make sure that the mail doesn't go
thru my other pipe.

It's expensive to run these pipes so I don't want to have to run both
of them.