Author Henning.von.Bargen
Recipients Henning.von.Bargen, r.david.murray
Date 2016-12-06.13:57:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I can give a little more information.
First, I created a very simple stand-alone test script (for Python >= 2.6):

#!/bin/env python
# -*- coding: utf-8 -*-

import smtplib

# Adjust these!

HOST = "smtp.nowhere.local"
PORT = 25

from_name = u"Test Python smtplib"
from_addr = u"valid.address@nowhere.local"

to_name = u"Python Test Recipient"
to_addr = u""

subject = "Test Nr. 1"
smtp = smtplib.SMTP(HOST, PORT, timeout=10)
smtp.sendmail(from_addr, [to_addr], subject)

This script shows the same behavior, which shows that the problem is not related to my program, but it is indeed a problem with

Unfortunately, I could only test this with Python 2.6, because I'm not allowed to install Python 2.7 on that machine; OTOH I have to run it on that machine to have access to the mail server.

The observations are:

* The message is sent (I sent it to one of my email addresses).

* Spam Assassin flags the message with additional header lines: X-Amavis-Alert: BAD HEADER SECTION, Missing required header field: "Date"
X-Spam-Status: No, score=-2.36 ...
* In some cases the message is silently dropped, because the missing date header caues a negative score; which in turn may be bad enough to classify it as spam, depending on the content.
* The SMTP server used here is Postfix.
* When I receive the message, a Date header is present (obviously it has been inserted during the message's journey through the internet).

Personal opinion: 
I think classifying a message as spam just because a practically useless header field is missing is bad behavior of Spam Assaassin.
Nevertheless, the standard library should try to conform to RFC 5322.
It is good practise to be forgiving while reading but pedantic while writing.
Date User Action Args
2016-12-06 13:57:45Henning.von.Bargensetrecipients: + Henning.von.Bargen, r.david.murray
2016-12-06 13:57:45Henning.von.Bargensetmessageid: <>
2016-12-06 13:57:45Henning.von.Bargenlinkissue28879 messages
2016-12-06 13:57:44Henning.von.Bargencreate