IFCHARSET


NAME

ifcharset -- check the character sets of an incoming email message

SYNOPSIS

ifcharset {-r charset} {-a charset}

DESCRIPTION

ifcharset scans the main body and all attachments for MIME character set declarations. If no character set declaration is found in the message, or at least one of the character sets is included in the list of acceptable character sets (option -a), ifcharset exits 100. Otherwise, if at least one character set of the message is in the list of to be rejected character sets (option -r), ifcharset exits 0. If none of the found character sets is included in either list, ifcharset exits 100.

In short, ifcharset rejects all messages that include a character set of the r-list except if a character set is found that is included in the a-list.

Please note that case is not significant when character set names are compared.

EXAMPLE

This utility can be used within ~/.qmail scripts to filter out messages which are encoded in GB2312:

   |bouncesaying 'Sorry, I cannot read charset GB2312.' ifcharset -r GB2312

However, if you want to accept messages that include any text in ``iso-8859-1'' or ``US-ASCII'' even if they include texts in ``GB2312'' you should switch to:

   |bouncesaying 'Sorry, I cannot read charset GB2312.' \
      ifcharset -r GB2312 -a iso-8859-1 -a US-ASCII

AUTHOR

Andreas F. Borchert, http://dotqmailutils.sourceforge.net/
converted to HTML: 2008/03/29

Thanks to Sourceforge for hosting this package. SourceForge.net Logo

Andreas F. Borchert, March 29th, 2008