-/* $Cambridge: exim/src/src/mime.c,v 1.1.2.3 2004/11/30 15:18:58 tom Exp $ */
+/* $Cambridge: exim/src/src/mime.c,v 1.1.2.4 2004/12/15 11:51:09 tom Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
FILE *mime_stream = NULL;
uschar *mime_current_boundary = NULL;
+/*************************************************
+* set MIME anomaly level + text *
+*************************************************/
+
+/* Small wrapper to set the two expandables which
+ give info on detected "problems" in MIME
+ encodings. Those are defined in mime.h. */
+
+void mime_set_anomaly(int level, char *text) {
+ mime_anomaly_level = level;
+ mime_anomaly_text = text;
+};
+
/*************************************************
* decode quoted-printable chars *
while (*(p+offset) != '\0') {
/* hit illegal char ? */
if (mime_b64[*(p+offset)] == 128) {
+ mime_set_anomaly(MIME_ANOMALY_BROKEN_BASE64);
offset++;
}
else {
/* byte 0 ---------------------- */
if (*(p+1) == 255) {
+ mime_set_anomaly(MIME_ANOMALY_BROKEN_BASE64);
break;
}
data[(*num_decoded)] = *p;
p++;
/* byte 1 ---------------------- */
if (*(p+1) == 255) {
+ mime_set_anomaly(MIME_ANOMALY_BROKEN_BASE64);
break;
}
data[(*num_decoded)] = *p;
p++;
/* byte 2 ---------------------- */
if (*(p+1) == 255) {
+ mime_set_anomaly(MIME_ANOMALY_BROKEN_BASE64);
break;
}
data[(*num_decoded)] = *p;
if (decode_qp_result == -2) {
/* Error from decoder. p is unchanged. */
+ mime_set_anomaly(MIME_ANOMALY_BROKEN_QP);
data[(*num_decoded)] = '=';
(*num_decoded)++;
p++;