a dot alone in a line (bug?)

Dominique VOLPE dominique.volpe at dpma.finances.gouv.fr
Fri May 19 18:03:44 CEST 2006


Hi,

I tried to classify directly a test message in a command line and the 
bug I reported didn't occur.
It is very strange because in the logs of Postfix, I can undoubtedly see 
that the messages containing a single dot are shortened after they 
passed thru Bogofilter.

In master.cf, I have :
------------------------
xxx.xx.x.xx:smtp      inet  n       -       n       -       -       smtpd
        -o content_filter=filter
filter    unix  -       n       n       -       -       pipe
  flags=R user=filter argv=/home/filter/scripts/postfix-filter.sh -f 
${sender} -- ${recipient}
------------------------



And here is the script "postfix-filter.sh" :
------------------------
#!/bin/bash

FILTER=/usr/local/bogofilter/bin/bogofilter
FILTER_DIR=/home/filter/spool
POSTFIX=/usr/sbin/sendmail
export BOGOFILTER_DIR=/home/filter/data

# Exit codes from <sysexits.h>
EX_TEMPFAIL=75
EX_UNAVAILABLE=69

cd $FILTER_DIR || \
    { echo $FILTER_DIR does not exist; exit $EX_TEMPFAIL; }

# Clean up when done or when aborting.
trap "rm -f msg.$$ ; exit $EX_TEMPFAIL" 0 1 2 3 15

# bogofilter -e returns: 0 for OK, nonzero for error
rm -f msg.$$ || exit $EX_TEMPFAIL
$FILTER -l -p -e > msg.$$ || exit $EX_TEMPFAIL

exec <msg.$$ || exit $EX_TEMPFAIL
rm -f msg.$$ # safe, we hold the file descriptor
exec $POSTFIX "$@"
exit $EX_TEMPFAIL
------------------------


I'll do more tests next week.



Dominique



Le 18/05/2006 23:15, Dominique VOLPE a écrit :
> Le 18/05/2006 22:32, Tom Anderson a écrit :
>   
>> Dominique,
>>
>> Typically a dot alone on a line signifies to Sendmail when it is 
>> receiving info on STDIN that the message has finished.  This should not 
>> be the case when dealing with files.  My hunch is that this has 
>> something to do with how you're sending/receiving email, not with 
>> bogofilter.  Is your mail being delivered through a web form?
>>     
>
> I have just made some tests (from several Webmail and from Thunderbird). 
> Each time, the message was truncated starting from the line containing a 
> point alone.
> I read the received messages with Thunderbird.
>
> My gateway has : Postfix -> Bogofilter -> Postfix
>
> I examined the sources of Bogofilter and I found these lines in 
> "bogoreader.c" (line 567):
>
>          if ((count == 2 || count == 3) &&
> 	    (buf[0] == '.') &&
> 	    (buf[1] == '\r' || buf[1] == '\n'))
>              dot_found = true;
>
> Thus, Bogofilter does a particular treatment when it find a single dot 
> in a line.
> I did not found what it does, because I don't know C language enough.
>
>
> Dominique
>
>
>   
>> Tom
>>
>>
>> Dominique VOLPE wrote:
>>     
>>> Hi,
>>>
>>> I would like to report a probable bug: when a message contains a dot 
>>> alone in a line, then the message is truncated.
>>> The line containing the dot and the following lines are removed.
>>>
>>> I use Bogofilter 0.95.
>>>
>>> Is this bug known and corrected in a later version?
>>>
>>> Thank you
>>>
>>> Dominique
>>>
>>>
>>> _______________________________________________
>>> Bogofilter mailing list
>>> Bogofilter at bogofilter.org
>>> http://www.bogofilter.org/mailman/listinfo/bogofilter
>>>
>>>
>>>       
>> _______________________________________________
>> Bogofilter mailing list
>> Bogofilter at bogofilter.org
>> http://www.bogofilter.org/mailman/listinfo/bogofilter
>>     
> _______________________________________________
> Bogofilter mailing list
> Bogofilter at bogofilter.org
> http://www.bogofilter.org/mailman/listinfo/bogofilter
>   



More information about the Bogofilter mailing list