For robustness, I suggest:
(a) MIME composers MUST avoid emitting boundaries such that
one boundary is a substring of another. (However, MIME readers
MUST NOT refuse to process a message because it has such
boundaries.)
(b) MIME readers MUST ignore trailing whitespace in lines that
are less than 1000 characters long, when examining a line
to see if it is a boundary marker. (However, since a
boundary marker can contain no more than 74 characters before any
padding whitespace, including leading and trailing '-'
characters, any line with non-white-space characters after
the 74th position cannot be a boundary marker.)
Keith