[exim] MIME errors and MIME ACL

Top Page
Delete this message
Reply to this message
Author: Dickenson, Steven
Date:  
To: Exim-users
Subject: [exim] MIME errors and MIME ACL
I've been tweaking a new Exim 4.5 installation on a new box, and I'm
trying to do away with demime completely. The trouble I'm having is
replacing the demime_errorlevel check with an equivalent in the MIME
ACL.

I found a reference to the following code through a search of the
archives.

deny
  decode      = default
  condition   = ${if > {$mime_anomaly_level}{2} \
                    {true}{false}}
  message     = This message contains a MIME error ($mime_anomaly_text)
  log_message = MIME ERROR ($mime_anomaly_text)


However, a quick examination of the source shows only two MIME anomaly
errors in mime.h:

#define MIME_ANOMALY_BROKEN_BASE64    2, "Broken BASE64 encoding
detected"
#define MIME_ANOMALY_BROKEN_QP        1, "Broken Quoted-Printable
encoding detected"


Neither of which exceed the above-listed error of 2. In contrast, the
old demime.h contains several MIME errors:

#define MIME_ERRORLEVEL_LONG_LINE        3,US"line length in message or
single header size exceeds %u bytes",MIME_SANITY_MAX_LINE_LE
NGTH
#define MIME_ERRORLEVEL_TOO_MANY_PARTS   3,US"too many MIME parts (max
%u)",MIME_SANITY_MAX_DUMP_FILES
#define MIME_ERRORLEVEL_MESSAGE_PARTIAL  3,US"'message/partial' MIME
type"
#define MIME_ERRORLEVEL_FILENAME_LENGTH  3,US"proposed filename exceeds
%u characters",MIME_SANITY_MAX_FILENAME
#define MIME_ERRORLEVEL_BOUNDARY_LENGTH  3,US"boundary length exceeds %u
characters",MIME_SANITY_MAX_BOUNDARY_LENGTH
#define MIME_ERRORLEVEL_DOUBLE_HEADERS   2,US"double headers
(content-type, content-disposition or content-transfer-encoding)"
#define MIME_ERRORLEVEL_UU_MISALIGNED    1,US"uuencoded line length is
not a multiple of 4 characters"
#define MIME_ERRORLEVEL_UU_LINE_LENGTH   1,US"uuencoded line length does
not match advertised number of bytes"
#define MIME_ERRORLEVEL_B64_LINE_LENGTH  1,US"base64 line length exceeds
%u characters",MIME_SANITY_MAX_B64_LINE_LENGTH
#define MIME_ERRORLEVEL_B64_ILLEGAL_CHAR 2,US"base64 line contains
illegal character"
#define MIME_ERRORLEVEL_B64_MISALIGNED   1,US"base64 line length is not
a multiple of 4 characters"
#define MIME_ERRORLEVEL_QP_ILLEGAL_CHAR  1,US"quoted-printable encoding
contains illegal character"


Is there some way of recreating these sanity checks using ACL statement,
or are we going to need to wait until Tom adds more sanity checks to the
source?

On a side note, is the list pretty much in agreement that ClamAV can
handle MIME decoding on it's own, without the aid of demime?

Steven
---
Steven Dickenson <sdickenson@???>
Computer Network Manager
The Key School, Annapolis Maryland