Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: SpamAssassin: users

no score when doctype is declared

 

 

SpamAssassin users RSS feed   Index | Next | Previous | View Threaded


akyel.zafer at gmail

Feb 23, 2012, 5:45 AM

Post #1 of 15 (1036 views)
Permalink
no score when doctype is declared

Hi,
Anyone having the same problem ? When I declare doctype as below, spam
score result is always 0 but if I removed it scores as expected.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//tr"
"http://www.w3.org/TR/html4/loose.dtd">

Thank you.


KMcGrail at PCCC

Feb 23, 2012, 7:12 AM

Post #2 of 15 (1018 views)
Permalink
Re: no score when doctype is declared [In reply to]

On 2/23/2012 8:45 AM, zafer akyel wrote:
> Hi,
> Anyone having the same problem ? When I declare doctype as below, spam
> score result is always 0 but if I removed it scores as expected.
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//tr"
> "http://www.w3.org/TR/html4/loose.dtd">
>
> Thank you.

Please put samples on pastebin or similar so we have some idea what you
mean.


akyel.zafer at gmail

Feb 23, 2012, 7:43 AM

Post #3 of 15 (1023 views)
Permalink
Re: no score when doctype is declared [In reply to]

Hi,

This is the whole HTML we are testing.

http://pastebin.com/cjPYe9Gz

Thank you.


2012/2/23 Kevin A. McGrail <KMcGrail [at] pccc>:
> On 2/23/2012 8:45 AM, zafer akyel wrote:
>>
>> Hi,
>> Anyone having the same problem ? When I declare doctype as below, spam
>> score result is always 0 but if I removed it scores as expected.
>>
>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//tr"
>> "http://www.w3.org/TR/html4/loose.dtd">
>>
>> Thank you.
>
>
> Please put samples on pastebin or similar so we have some idea what you
> mean.



--
Zafer AKYEL


KMcGrail at PCCC

Feb 23, 2012, 7:44 AM

Post #4 of 15 (1016 views)
Permalink
Re: no score when doctype is declared [In reply to]

On 2/23/2012 10:43 AM, zafer akyel wrote:
> This is the whole HTML we are testing.
>
> http://pastebin.com/cjPYe9Gz
>
> Thank you.
How are you calling SpamAssassin exactly?


akyel.zafer at gmail

Feb 23, 2012, 7:58 AM

Post #5 of 15 (1022 views)
Permalink
Re: no score when doctype is declared [In reply to]

Hi, I am using java to execute the spamassassin

executeCommand = "spamassassin -L -t";

String[] command = {"CMD", "/C", executeCommand};

ProcessBuilder probuilder = new ProcessBuilder(command);
probuilder.directory(new File("c:\\Mail-SpamAssassin-3.0.4"));
Process process = probuilder.start();

and appending buffer contents to the process..

EOM===================

2012/2/23 Kevin A. McGrail <KMcGrail [at] pccc>:
> On 2/23/2012 10:43 AM, zafer akyel wrote:
>>
>> This is the whole HTML we are testing.
>>
>> http://pastebin.com/cjPYe9Gz
>>
>> Thank you.
>
> How are you calling SpamAssassin exactly?



--
Zafer AKYEL


Bowie_Bailey at BUC

Feb 23, 2012, 8:16 AM

Post #6 of 15 (1016 views)
Permalink
Re: no score when doctype is declared [In reply to]

On 2/23/2012 10:43 AM, zafer akyel wrote:
> Hi,
>
> This is the whole HTML we are testing.
>
> http://pastebin.com/cjPYe9Gz
>
> Thank you.

SA is designed to work on email messages. That looks like a webpage,
not an email. If you send that to SA as-is, you will not get good
results. You would want to at least fake some headers so that it looks
like an email with an html body.

My SA scored it as spam because of the missing headers:

X-Spam-Status: Yes, score=5.5 required=5.0 tests=MISSING_DATE,MISSING_FROM,

MISSING_HEADERS,MISSING_MID,MISSING_SUBJECT,NO_HEADERS_MESSAGE,NO_RECEIVED,
NO_RELAYS,TVD_SPACE_RATIO autolearn=no version=3.3.2
X-Spam-Report:
* -0.0 NO_RELAYS Informational: message was not relayed via SMTP
* 1.2 MISSING_HEADERS Missing To: header
* 0.1 MISSING_MID Missing Message-Id: header
* 1.8 MISSING_SUBJECT Missing Subject: header
* 1.0 MISSING_FROM Missing From: header
* -0.0 NO_RECEIVED Informational: message has no Received headers
* 0.0 TVD_SPACE_RATIO TVD_SPACE_RATIO
* 1.4 MISSING_DATE Missing Date: header
* 0.0 NO_HEADERS_MESSAGE Message appears to be missing most RFC-822
* headers

Incidentally, I get the exact same score when I remove the doctype line.

--
Bowie


akyel.zafer at gmail

Feb 23, 2012, 8:22 AM

Post #7 of 15 (1018 views)
Permalink
Re: no score when doctype is declared [In reply to]

Thank you for your answer but it is an HTML email. That is the content of HTML
I am appending

message.append("From: " + this._from + "\n");
message.append("To: " + this._to + "\n");
message.append("Date: " + formatter.format(d) + "\n");
message.append("Subject:" + this._subject + "\n");
message.append("\n\n");
message.append(this._body + "\n");

It is working good when no doc type declared but i need to add doc type.

Thank you.

2012/2/23 Bowie Bailey <Bowie_Bailey [at] buc>:
> On 2/23/2012 10:43 AM, zafer akyel wrote:
>> Hi,
>>
>> This is the whole HTML we are testing.
>>
>> http://pastebin.com/cjPYe9Gz
>>
>> Thank you.
>
> SA is designed to work on email messages.  That looks like a webpage,
> not an email.  If you send that to SA as-is, you will not get good
> results.  You would want to at least fake some headers so that it looks
> like an email with an html body.
>
> My SA scored it as spam because of the missing headers:
>
> X-Spam-Status: Yes, score=5.5 required=5.0 tests=MISSING_DATE,MISSING_FROM,
>
> MISSING_HEADERS,MISSING_MID,MISSING_SUBJECT,NO_HEADERS_MESSAGE,NO_RECEIVED,
>        NO_RELAYS,TVD_SPACE_RATIO autolearn=no version=3.3.2
> X-Spam-Report:
>        * -0.0 NO_RELAYS Informational: message was not relayed via SMTP
>        *  1.2 MISSING_HEADERS Missing To: header
>        *  0.1 MISSING_MID Missing Message-Id: header
>        *  1.8 MISSING_SUBJECT Missing Subject: header
>        *  1.0 MISSING_FROM Missing From: header
>        * -0.0 NO_RECEIVED Informational: message has no Received headers
>        *  0.0 TVD_SPACE_RATIO TVD_SPACE_RATIO
>        *  1.4 MISSING_DATE Missing Date: header
>        *  0.0 NO_HEADERS_MESSAGE Message appears to be missing most RFC-822
>        *      headers
>
> Incidentally, I get the exact same score when I remove the doctype line.
>
> --
> Bowie



--
Zafer AKYEL


Bowie_Bailey at BUC

Feb 23, 2012, 8:33 AM

Post #8 of 15 (1015 views)
Permalink
Re: no score when doctype is declared [In reply to]

On 2/23/2012 11:22 AM, zafer akyel wrote:
> Thank you for your answer but it is an HTML email. That is the content of HTML
> I am appending
>
> message.append("From: " + this._from + "\n");
> message.append("To: " + this._to + "\n");
> message.append("Date: " + formatter.format(d) + "\n");
> message.append("Subject:" + this._subject + "\n");
> message.append("\n\n");
> message.append(this._body + "\n");
>
> It is working good when no doc type declared but i need to add doc type.
>
> Thank you.

Then you should have put that in the pastebin. In order to diagnose the
problem, we need to see exactly what is being sent to SA.

I took the html from the pastebin, added From, To, Date, and Subject
headers, and ran it through SA.

X-Spam-Status: No, score=0.1 required=5.0 tests=MISSING_MID,NO_RECEIVED,
NO_RELAYS,TVD_SPACE_RATIO autolearn=no version=3.3.2
X-Spam-Report:
* -0.0 NO_RELAYS Informational: message was not relayed via SMTP
* 0.1 MISSING_MID Missing Message-Id: header
* -0.0 NO_RECEIVED Informational: message has no Received headers
* 0.0 TVD_SPACE_RATIO TVD_SPACE_RATIO

Then I removed the doctype line and tried again.

X-Spam-Status: No, score=0.1 required=5.0 tests=MISSING_MID,NO_RECEIVED,
NO_RELAYS,TVD_SPACE_RATIO autolearn=no version=3.3.2
X-Spam-Report:
* -0.0 NO_RELAYS Informational: message was not relayed via SMTP
* 0.1 MISSING_MID Missing Message-Id: header
* -0.0 NO_RECEIVED Informational: message has no Received headers
* 0.0 TVD_SPACE_RATIO TVD_SPACE_RATIO

You must be doing something different. Try dumping to a file EXACTLY
what is being sent to SA from your program in each case. Then you can
see if there are any other differences and test manually to see if there
is something your program may be doing to influence the results.

If you can't find anything, save the results both with and without the
doctype line and put them in a pastebin (with the SA headers) so we can
see what is happening.

--
Bowie

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?


akyel.zafer at gmail

Feb 23, 2012, 8:37 AM

Post #9 of 15 (1032 views)
Permalink
Re: no score when doctype is declared [In reply to]

Thank you very much for your answers. I will try and notify you. Thank you.

2012/2/23 Bowie Bailey <Bowie_Bailey [at] buc>:
> On 2/23/2012 11:22 AM, zafer akyel wrote:
>> Thank you for your answer but it is an HTML email. That is the content of HTML
>> I am appending
>>
>>       message.append("From: " + this._from + "\n");
>>       message.append("To: " + this._to + "\n");
>>       message.append("Date: " + formatter.format(d) + "\n");
>>       message.append("Subject:" + this._subject + "\n");
>>       message.append("\n\n");
>>       message.append(this._body + "\n");
>>
>> It is working good when no doc type declared but i need to add doc type.
>>
>> Thank you.
>
> Then you should have put that in the pastebin.  In order to diagnose the
> problem, we need to see exactly what is being sent to SA.
>
> I took the html from the pastebin, added From, To, Date, and Subject
> headers, and ran it through SA.
>
> X-Spam-Status: No, score=0.1 required=5.0 tests=MISSING_MID,NO_RECEIVED,
>        NO_RELAYS,TVD_SPACE_RATIO autolearn=no version=3.3.2
> X-Spam-Report:
>        * -0.0 NO_RELAYS Informational: message was not relayed via SMTP
>        *  0.1 MISSING_MID Missing Message-Id: header
>        * -0.0 NO_RECEIVED Informational: message has no Received headers
>        *  0.0 TVD_SPACE_RATIO TVD_SPACE_RATIO
>
> Then I removed the doctype line and tried again.
>
> X-Spam-Status: No, score=0.1 required=5.0 tests=MISSING_MID,NO_RECEIVED,
>        NO_RELAYS,TVD_SPACE_RATIO autolearn=no version=3.3.2
> X-Spam-Report:
>        * -0.0 NO_RELAYS Informational: message was not relayed via SMTP
>        *  0.1 MISSING_MID Missing Message-Id: header
>        * -0.0 NO_RECEIVED Informational: message has no Received headers
>        *  0.0 TVD_SPACE_RATIO TVD_SPACE_RATIO
>
> You must be doing something different.  Try dumping to a file EXACTLY
> what is being sent to SA from your program in each case.  Then you can
> see if there are any other differences and test manually to see if there
> is something your program may be doing to influence the results.
>
> If you can't find anything, save the results both with and without the
> doctype line and put them in a pastebin (with the SA headers) so we can
> see what is happening.
>
> --
> Bowie
>
> A: Because it messes up the order in which people normally read text.
> Q: Why is top-posting such a bad thing?
> A: Top-posting.
> Q: What is the most annoying thing in e-mail?
>



--
Zafer AKYEL


KMcGrail at PCCC

Feb 23, 2012, 8:40 AM

Post #10 of 15 (1016 views)
Permalink
Re: no score when doctype is declared [In reply to]

On 2/23/2012 10:58 AM, zafer akyel wrote:
> Hi, I am using java to execute the spamassassin
>
> executeCommand = "spamassassin -L -t";
>
> String[] command = {"CMD", "/C", executeCommand};
>
> ProcessBuilder probuilder = new ProcessBuilder(command);
> probuilder.directory(new File("c:\\Mail-SpamAssassin-3.0.4"));
> Process process = probuilder.start();
>
> and appending buffer contents to the process..
>
> EOM===================
I would look to compile a newer version of SA. 3.0.4 is pretty old.

Regards,
KAM


martin at gregorie

Feb 23, 2012, 8:52 AM

Post #11 of 15 (1011 views)
Permalink
Re: no score when doctype is declared [In reply to]

On Thu, 2012-02-23 at 18:22 +0200, zafer akyel wrote:
> Thank you for your answer but it is an HTML email. That is the content of HTML
> I am appending
>
> message.append("From: " + this._from + "\n");
> message.append("To: " + this._to + "\n");
> message.append("Date: " + formatter.format(d) + "\n");
> message.append("Subject:" + this._subject + "\n");
> message.append("\n\n");
> message.append(this._body + "\n");
>
> It is working good when no doc type declared but i need to add doc type.
>
A message formatted like that would be expected to have a plain text
body, not HTML. I'd strongly suggest that you use the Sun/Oracle
JavaMail package to create a correctly formatted message and that you
attach your test HTML as a 'text/html' part. A correctly formatted
message will have both the text/html part preceded by either a plaintext
body or a 'text/plain' part: the latter is preferable. Either way, the
plaintext is a non-HTML version of the HTML part: it is there out of
respect for people who choose not to read HTML-formatted messages.

Martin


brennan at columbia

Feb 23, 2012, 9:02 AM

Post #12 of 15 (1011 views)
Permalink
Re: no score when doctype is declared [In reply to]

Martin Gregorie <martin [at] gregorie> wrote:

> A correctly formatted
> message will have both the text/html part preceded by either a plaintext
> body or a 'text/plain' part: the latter is preferable.


No plain text part is required. There could be only one part, html,
but it needs the right MIME header fields and format, which are not
present there.

Including a plain part is desirable in many cases but not all.


Joseph Brennan
Lead Email Systems Engineer
Columbia University Information Technology


walterhurry at lavabit

Feb 23, 2012, 9:26 AM

Post #13 of 15 (1013 views)
Permalink
Re: no score when doctype is declared [In reply to]

On Thu, 23 Feb 2012 12:02:58 -0500, Joseph Brennan wrote:

> Including a plain part is desirable in many cases but not all.


It is required if you want *me* to read it.


martin at gregorie

Feb 23, 2012, 9:41 AM

Post #14 of 15 (1007 views)
Permalink
Re: no score when doctype is declared [In reply to]

On Thu, 2012-02-23 at 17:26 +0000, Walter Hurry wrote:
> On Thu, 23 Feb 2012 12:02:58 -0500, Joseph Brennan wrote:
>
> > Including a plain part is desirable in many cases but not all.
>
>
> It is required if you want *me* to read it.

+1


jhardin at impsec

Feb 23, 2012, 10:56 AM

Post #15 of 15 (1010 views)
Permalink
Re: no score when doctype is declared [In reply to]

On Thu, 23 Feb 2012, Martin Gregorie wrote:

> On Thu, 2012-02-23 at 17:26 +0000, Walter Hurry wrote:
>> On Thu, 23 Feb 2012 12:02:58 -0500, Joseph Brennan wrote:
>>
>>> Including a plain part is desirable in many cases but not all.
>>
>>
>> It is required if you want *me* to read it.
>
> +1

+1

--
John Hardin KA7OHZ http://www.impsec.org/~jhardin/
jhardin [at] impsec FALaholic #11174 pgpk -a jhardin [at] impsec
key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
Joan Peterson is like that: you expect at least a pseudological
argument, but instead you get the weird ramblings of a woman with
the critical thinking abilities of an 18th century peasant. -- Ken
-----------------------------------------------------------------------
442 days since the first successful private orbital launch (SpaceX)

SpamAssassin users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.