MIME message. I'm testing it with a message that contains a PDF attachment. I'm not sure about the structure of a multi-part MIME message, but if I look at the file, I see the boundary appear once at the start of the message, once at the start of the attachment and once at the end.