#include "netware/sysexits.h" /* For exit status codes like EX_OK */
#endif
+#define SKIP_LONG_HEADER_SEP(str, pos) \
+ if (str[pos] == '\r' && str[pos + 1] == '\n' && (str[pos + 2] == ' ' || str[pos + 2] == '\t')) { \
+ pos += 3; \
+ while (str[pos] == ' ' || str[pos] == '\t') { \
+ pos++; \
+ } \
+ continue; \
+ } \
+
/* {{{ proto int ezmlm_hash(string addr)
Calculate EZMLM list hash value. */
PHP_FUNCTION(ezmlm_hash)
}
for (i = 0; to[i]; i++) {
if (iscntrl((unsigned char) to[i])) {
+ /* According to RFC 822, section 3.1.1 long headers may be separated into
+ * parts using CRLF followed at least one linear-white-space character ('\t' or ' ').
+ * To prevent these separators from being replaced with a space, we use the
+ * SKIP_LONG_HEADER_SEP to skip over them.
+ */
+ SKIP_LONG_HEADER_SEP(to, i);
to[i] = ' ';
}
}
}
for(i = 0; subject[i]; i++) {
if (iscntrl((unsigned char) subject[i])) {
+ SKIP_LONG_HEADER_SEP(subject, i);
subject[i] = ' ';
}
}