Site Configuration Queries
Cedric Foll
cedric.foll at ac-rouen.fr
Mon May 19 17:57:12 CEST 2003
Le lun 19/05/2003 à 16:56, Simon Huggins a écrit :
> Salut bogofilter!
>
> On Mon, May 19, 2003 at 04:44:20PM +0200, Boris 'pi' Piwinger wrote:
> > Simon Huggins wrote:
> > > foreach my $subent ($entity->parts) {
> > > if ($subent->effective_type eq "message/rfc822") {
> > > $subent->print(\*STDOUT);
> > > }
> > > }
> > Looks like it will output more than one part of that type if
> > available. Is that dangerous? If so, exit after print would do.
>
> It shouldn't be "dangerous" :)
>
> The point was people may want to attach more than one message to their
> mail and have that piped to bogofilter.
I have two pb with this script:
1) It return more than juste the e-mail attached:
# ./get_join.pl < nospam.10995 | head
0Content-Disposition: inline
Content-Description: Message suivi - ADV - KDMV wq
Content-Type: message/rfc822
Return-Path: <i6rbdl51 at business-merchandising.com>
Received: from [218.79.219.198] (218.79.219.198) by mx.laposte.net
(6.0.053) id 3EC57D5E00051400; Mon, 19 May 2003 07:54:38 +0200
Received: from o0.d1gt.com (HELO oil24) [8.196.163.150] by 213.30.181.11
with ESMTP id 62762611; Mon, 19 May 2003 12:48:44 +0300
Message-ID: <387t$h$8$1rbk200o$r$11399 at onyib7c0th>
These 4 lines annoy a lot my bogofilter cfg.
2) Temporary files are created (and never deleted)
So I propose an other script without these issues:
$ cat extract.rfc822
#!/usr/bin/ruby
require 'rmail/parser'
message = RMail::Parser.read($stdin)
i = 1
while message.part(i)
puts message.part(i).to_s.split("\n")[4..-1] * "\n"
i += 1
end
More information about the Bogofilter
mailing list