Why is the email being rejected

emailsmtp

I am having problems sending an email from one email address to another on my domain. I am using a shared server. I use weather software which automatically constructs and sends the email message. I have omitted the host, domain and IP info and replaced them like so: host= example.co.uk, domain = mydomain.co.uk .

The situation is I run a mail group using email address (weatherinfo@) and some users in the group set auto-responders. Therefore to prevent these from going to the whole group the email is sent from a different address (reports@) to weatherinfo@ with the reports@ address receiving the auto-responder messages.

I am getting the following message from the mail delivery system when trying to send the email to weatherinfo@ from report@:

This is the mail system at host mailauth.example.co.uk.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

               The mail system

<weatherinfo@mydomain.co.uk>: host 127.0.0.1[127.0.0.1] said: 554 5.6.0
Reject, id=02474-18 - BAD HEADER (in reply to end of DATA command).

The error log accompanying the email shows:

Reporting-MTA: dns; mailauth.example.co.uk
X-Postfix-Queue-ID: 88002C306D
X-Postfix-Sender: rfc822; reports@mydomain.co.uk
Arrival-Date: Fri,  2 May 2014 22:00:43 +0100 (BST)

Final-Recipient: rfc822; weatherinfo@mydomain.co.uk
Original-Recipient: rfc822;weatherinfo@mydomain.co.uk
Action: failed
Status: 5.6.0
Remote-MTA: dns; 127.0.0.1
Diagnostic-Code: smtp; 554 5.6.0 Reject, id=02474-18 - BAD HEADER

The header from the original message is:

Return-Path: <reports@mydomain.co.uk>
Received: from LAPTOP (helium.example.co.uk [IP Address])
by mailauth.example.co.uk (Postfix) with ESMTPA id 88002C306D
for <weatherinfo@mydomain.co.uk>; Fri,  2 May 2014 22:00:43 +0100 (BST)
To: weatherinfo@mydomain.co.uk
From: reports@mydomain.co.uk
Subject: WEATHER REPORT
Reply-To: reports@mydomain.co.uk
Date: Fri, 02 May 2014 23:00:56 +0100
Message-Id: <43786804l.820319781l1635676l1l@mydomain.co.uk>
Message-ID: <2014.05.02.17001.wd@mail.mydomain.co.uk>
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"

Why is this message being rejected?
Is this being caused by my software or the server?
If it is the software what does the developer need do to fix it?
If it is the server what should I ask my host to do to overcome this problem?

Best Answer

It appears you may be triggering a spam filtering rule. Your address is listed in the Spamhaus PBL list which indicates your IP address should not be originating email to the Internet. Spamhaus provides clear documentation on their policies.

If you want reliable delivery to the Internet the server sending to the Internet needs a fixed IP address with DNS configured to pass rDNS validation. Your mail server should identify itself with the domain you have configured for rDNS.

If you don't have a fixed IP address with appropriate DNS entries use your provider's email relay server to deliver the email.

As other have noted you seem to have an extra Message-Id header being added. This may be causing header validation to fail. (SPAM is much more likely to have bad headers than valid email.)