Avoiding MIME_BASE64_TEXT SpamAssassin Test when sending Email From Django?

757 views
Skip to first unread message

rmschne

unread,
Nov 23, 2009, 11:43:14 AM11/23/09
to Django users
I'm using Django's email sending functions (http://
docs.djangoproject.com/en/dev/topics/email/#topics-email) to send
mail.

I construct the simple HTML mail with a small bit of Python code which
is based on data from a database accessed via Django and using a
Django template to construct the html text. I pass this text to
Django's email functions, e.g.

msg=EmailMessage(subject, html_content, from_email, [to])
msg.content_subtype="html"
msg.send

The mail goes just fine. In testing I'm sending mail to myself. My
own SpamAssassin filter is trapping the mail as "spam" !!
---- ----------------------
--------------------------------------------------
1.7 MIME_HTML_ONLY BODY: Message only has text/html MIME parts
2.8 MIME_BASE64_TEXT RAW: Message text disguised using base64
encoding

I'm trying want to NOT send in base64 encoding so as to not attract
this SpamAssassin. How when constructing the text for the mail in
Python/Django to avoid this?

I have nothing but text in the email. The html is simple. It has a
style sheet in the header. The header looks like this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>The Scottish Oil Club</TITLE>
<STYLE> style sheet here
</HEAD>


Jarek Zgoda

unread,
Nov 24, 2009, 3:17:35 AM11/24/09
to django...@googlegroups.com
Wiadomość napisana w dniu 2009-11-23, o godz. 17:43, przez rmschne:
Unfortunately, in such case you have to construct the multipart/*
message by hand. Remember that Python email package uses base64
encoding for all but 8-byte encodings (Django is utf-8 on output
side), so you have to encode it by yourself in latin (or just plain
ASCII).

--
Artificial intelligence stands no chance against natural stupidity

Jarek Zgoda, R&D, Redefine
jarek...@redefine.pl

rmschne

unread,
Nov 24, 2009, 5:50:27 AM11/24/09
to Django users
Jerek,

Thanks ... starting now.
Reply all
Reply to author
Forward
0 new messages