List Info

Thread: Re: Bogofilter Digest, Vol 46, Issue 3




Re: Bogofilter Digest, Vol 46, Issue 3
country flaguser name
Germany
2008-03-20 11:56:57
bogofilter-requestbogofilter.org wrote:
> Send Bogofilter mailing list submissions to
> 	bogofilterbogofilter.org
> 
> To subscribe or unsubscribe via the World Wide Web,
visit
> 	http://www.bogofilter.org/mailman/listinfo/bogofilter
> or, via email, send a message with subject or body
'help' to
> 	bogofilter-requestbogofilter.org
> 
> You can reach the person managing the list at
> 	bogofilter-ownerbogofilter.org
> 
> When replying, please edit your Subject line so it is
more specific
> than "Re: Contents of Bogofilter digest..."
> 
> 
> Today's Topics:
> 
>    1. Re: Trouble with training (Matthias Andree)
> 
> 
>
------------------------------------------------------------
----------
> 
> Message: 1
> Date: Thu, 20 Mar 2008 12:19:02 +0100
> From: Matthias Andree <matthias.andreegmx.de>
> Subject: Re: Trouble with training
> To: bogofilterbogofilter.org
> Message-ID: <20080320111902.GA8773merlin.emma.line.org>
> Content-Type: text/plain; charset=iso-8859-1
> 
> On Wed, 19 Mar 2008, 'Stefan Gei?ler' wrote:
> 
>> Hi,
>>
>> I have a problem with training the bogofilter. I
use a PHP script. This 
>> script adds head and body of an email into a file
and passes it as 
>> parameter for training to the filter.
>> I use following functions:
>>
>> 1.) Retrieve the email header:
>> function getplainheader()
>> {
>>   return 
>>
imap_fetchheader($this->rm_mailbox,$this->rm_currentme
ssage,FT_UID|FT_INTERNAL|FT_PREFETCHTEXT 
>> );
>> }
>>
>> 2.) Retrieve the mail body:
>> function dump_body2()
>> {
>>    return 
>>
imap_body($this->rm_mailbox,$this->rm_currentmessage,F
T_UID|FT_INTERNAL);
>> }
>>
>> Then I do following:
>> function evaluate_bogospam($rcmail )
>> {
>>      $mailtext = $rcmail->getplainheader();
>>      $mailtext .= $rcmail->dump_body2();
>>
>>      if( trim( $mailtext ) != "" )
>>      {
>>          $filename = 
>>
"/home/wwwdev/public_html/develope/receivemail/mailbody
";
>>          $fp = fopen( $filename,
"w" );
>>          fputs( $fp, $mailtext );
>>          fclose( $fp );
>>
>>          $cmd = "bogofilter -T -d
/home/wwwdev/public_html/local -I 
>> ".$filename;
>>
>>          exec( $cmd, $ausgabe2, $returnvar );
>>
>>          echo "Bogo Filter return value :
".$returnvar . "   :   " . 
>> $ausgabe2[0]."<br>";
>>      }
>> }
>>
>> The problem is, that I get in bogosity an
"unknown" while the test 
>> function above gives me a clear "spam".
The related mail was trained 
>> before in the same way as shown above.
> 
> Missing the "test function above" and not
knowing PHP much (lack of
> interest and too many security loopholes in
deployment), but taking .=
> for a string concatenation operator:
> 
> Does $mailtext contain the separating blank line
between header and
> body? That's crucial, since bogofilter treats headers
and body
> separately.
> 

Good point. I test this!


Stefan
_______________________________________________
Bogofilter mailing list
Bogofilterbogofilter.org
http://www.bogofilter.org/mailman/listinfo/bogofilter

Re: Bogofilter Digest, Vol 46, Issue 3
user name
2008-03-20 12:02:16
'Stefan Geißler' schrieb:
> bogofilter-requestbogofilter.org wrote:
>> Send Bogofilter mailing list submissions to
>> 	bogofilterbogofilter.org
>>
>> To subscribe or unsubscribe via the World Wide Web,
visit
>> 	http://www.bogofilter.org/mailman/listinfo/bogofilter
>> or, via email, send a message with subject or body
'help' to
>> 	bogofilter-requestbogofilter.org
>>
>> You can reach the person managing the list at
>> 	bogofilter-ownerbogofilter.org
>>
>> When replying, please edit your Subject line so it
is more specific
>> than "Re: Contents of Bogofilter
digest..."
>>
>>
>> Today's Topics:
>>
>>    1. Re: Trouble with training (Matthias Andree)
>>
>>
>>
------------------------------------------------------------
----------
>>
>> Message: 1
>> Date: Thu, 20 Mar 2008 12:19:02 +0100
>> From: Matthias Andree <matthias.andreegmx.de>
>> Subject: Re: Trouble with training
>> To: bogofilterbogofilter.org
>> Message-ID: <20080320111902.GA8773merlin.emma.line.org>
>> Content-Type: text/plain; charset=iso-8859-1
>>
>> On Wed, 19 Mar 2008, 'Stefan Gei?ler' wrote:
>>
>>> Hi,
>>>
>>> I have a problem with training the bogofilter.
I use a PHP script. This 
>>> script adds head and body of an email into a
file and passes it as 
>>> parameter for training to the filter.
>>> I use following functions:
>>>
>>> 1.) Retrieve the email header:
>>> function getplainheader()
>>> {
>>>   return 
>>>
imap_fetchheader($this->rm_mailbox,$this->rm_currentme
ssage,FT_UID|FT_INTERNAL|FT_PREFETCHTEXT 
>>> );
>>> }
>>>
>>> 2.) Retrieve the mail body:
>>> function dump_body2()
>>> {
>>>    return 
>>>
imap_body($this->rm_mailbox,$this->rm_currentmessage,F
T_UID|FT_INTERNAL);
>>> }
>>>
>>> Then I do following:
>>> function evaluate_bogospam($rcmail )
>>> {
>>>      $mailtext = $rcmail->getplainheader();
>>>      $mailtext .= $rcmail->dump_body2();
>>>
>>>      if( trim( $mailtext ) != "" )
>>>      {
>>>          $filename = 
>>>
"/home/wwwdev/public_html/develope/receivemail/mailbody
";
>>>          $fp = fopen( $filename,
"w" );
>>>          fputs( $fp, $mailtext );
>>>          fclose( $fp );
>>>
>>>          $cmd = "bogofilter -T -d
/home/wwwdev/public_html/local -I 
>>> ".$filename;
>>>
>>>          exec( $cmd, $ausgabe2, $returnvar );
>>>
>>>          echo "Bogo Filter return value :
".$returnvar . "   :   " . 
>>> $ausgabe2[0]."<br>";
>>>      }
>>> }
>>>
>>> The problem is, that I get in bogosity an
"unknown" while the test 
>>> function above gives me a clear
"spam". The related mail was trained 
>>> before in the same way as shown above.
>> Missing the "test function above" and not
knowing PHP much (lack of
>> interest and too many security loopholes in
deployment), but taking .=
>> for a string concatenation operator:
>>
>> Does $mailtext contain the separating blank line
between header and
>> body? That's crucial, since bogofilter treats
headers and body
>> separately.
>>
> 
> Good point. I test this!
> 

Please DO NOT respond to digests. If your software is too
dense to take 
digests apart, read the regular version of the list.


-- 
Matthias Andree

Life is what happens to you while you're busy making other
plans.
   						-- John Lennon, 1980
_______________________________________________
Bogofilter mailing list
Bogofilterbogofilter.org
http://www.bogofilter.org/mailman/listinfo/bogofilter

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )