Stopping unwanted character sets

Matt Kettler mkettler at evi-inc.com
Fri Aug 3 22:24:38 IST 2007


Hugo van der Kooij wrote:
> Hi,
> 
> There was some discussion a while ago about stopping messages based on
> country of orrigin.
> 
> But I see more use in stopping unwanted charactersets.
> 
> For example:
> ------=_NextPart_000_0000_7D761D51.CFA8A7DF
> Content-Type: text/plain;
>     charset="windows-1251"
> Content-Transfer-Encoding: quoted-printable
> 
> 
> I have no need for messages in this character set nor anyone else.
> 
> Is there a way to filter on these?

If you've got the mimeheader plugin loaded (defaults to being loaded in 3.1.0
and higher) you can use a mimeheader rule

something like this should work:
mimehader MIME_WIN_1251	Content-Type =~/windows-1251/i



> I can find them if they mess with the subject line in postfix with:
> 
> /^Subject: =\?KOI8-R\?/                 REJECT  Russian encoding not
> allowed here.
> /^Subject: .* =\?windows-1251\?/        REJECT  Crappy propriatary
> encoding not allowed here.
> /^Subject: .*\[windows-1251\]/          REJECT  Crappy propriatary
> encoding not allowed here.
> /^Subject: =\?windows-1252\?/           REJECT  Crappy propriatary
> encoding not allowed here.
> 
> But what if it is proper MIME message and the character set is used only
> in some mime parts?
> 
> Is there a SA ruleset for this? (Or even a postfix trick to do this.)
> 
> Hugo.
> 



More information about the MailScanner mailing list