[Dovecot] plugin problem

Lars Stavholm stava at telcotec.se
Sat Sep 29 14:17:54 EEST 2007


Johannes Berg wrote:
> On Sat, 2007-09-29 at 12:44 +0200, Lars Stavholm wrote:
>> I'm trying to do a rewrite of the dspam_plugin for dovecot 1.1b1.
> 
> Cool. I never imagined that the plugin would find such wide-spread
> use :)

Well, it's only me, don't know if anyone else uses it. Still,
I think it's a brilliant idea. Doesn't get any more user friendly.

>> How can I retrieve the full unix path for a specific mail?
>>
>> The original code uses mail_get_first_header() to retrieve the
>> signature header. I need something like mail_get_mail_file_path(&path)
>> which I then could pass on to dspam. Is there some such function
>> available?
> 
> I don't think you can since mail might be stored in any kind of format
> like mbox, dbox, ... Only in maildir would this be possible. You can

OK, obviously I'm using Maildir format, but let's not restrict
the functionality to that fact.

> probably somehow get the raw text of a message though, but I don't know
> off-hand, and then write it to a temporary file. In any case, I suggest

There you go, that's my solution then,
should work with all storage formats.

> doing that only when no signature is available, and I still don't see
> how you would end up with mails w/o signature at all except maybe during
> conversion to a new dspam installation.

Who said anything about signatures not being available?

As far as I can tell from my tests, the signature's are picked up
nicely by the dspam plugin.

However, I'm used to a dspam setup where TrainPristine=on, and the
retraining/reclassification requires pristine mail-sources, without
the X-DSPAM-... stuff, including the signature.

So, basically, I would read the mail in error, be it spam or ham,
and pipe it to the dspam client for retraining/reclassification.
The --user option of dspam is used to point dspam to the correct
user (since we don't have a signature).

I saw some mail_get_istream() or similar, that seems to be a way
to open up some sort of byte stream reading the mail contents.
That might be what I'm looking for.

BTW, I would like to keep the previous functionality with the
dspam plugin using signatures. In order to do that I need to
be able to set dspam plugin specific options somwhow. Any idea?

Cheers
/Lars



More information about the dovecot mailing list