What is actually the MIME structure of basemsg? It appears that it has too many nested parts in it. If you export a signed message from e.g. Evolution, you'll see that it has just two parts: the body and the signature.

Here's an example which generates a message on stdout that can be read and the signature verified on both mutt (mutt -f test.mbox) and Evolution (File -> Import).

My question was on how to sign multipart e-mails. In your case, basemsg is a simple MIMEText message, not multipart message. I've found the root of my problem — it happens because email.generator in Python doesn't append a newline after the ending boundary. I'm not quite sure about that; when I'll become sure I'll post an answer describing how to fix that.
–
Dmitry ShachnevMay 31 '12 at 12:53