cyrusimap / cyrus-imapd

Cyrus IMAP is an email, contacts and calendar server
http://cyrusimap.org
Other
536 stars 147 forks source link

Message contains NUL characters fix #823

Closed brong closed 5 years ago

brong commented 18 years ago

From: Cove Schneider Bugzilla-Id: 2807 Version: 2.1.x Owner: Ken Murchison

brong commented 18 years ago

From: Cove Schneider

This bug was silently fixed at somepoint in 2.2+. If you're still using 2.1, you'll have to patch it your self.

Here is the string you'll find in your logs: 554 5.6.0 Message contains NUL characters

Here is a patch to fix it (unless you really are being sent emails with NULs in them): *** lmtpengine.c.orig 2006-03-06 11:00:00.000000000 -0800 --- lmtpengine.c 2006-03-06 11:00:42.000000000 -0800


* 670,676 ** p[1] = '\n'; p[2] = '\0'; } ! else if (p[0] != '\n') { / line contained a \0 not at the end / r = IMAP_MESSAGE_CONTAINSNULL; continue; --- 670,676 ---- p[1] = '\n'; p[2] = '\0'; } ! else if (p[0] != '\n' && (strlen(buf) < sizeof(buf)-3)) { / line contained a \0 not at the end / r = IMAP_MESSAGE_CONTAINSNULL; continue;

brong commented 18 years ago

Attachment-Id: 428 From: Cove Schneider Type: text/plain File: c21-nul-patch.txt

Patch for 2.1 to fix NUL char problem