[Dovecot] dovecot-dspam-integration

Johannes Berg johannes at sipsolutions.net
Tue May 8 12:41:57 EEST 2007


> > > Additionally, you check for 0 for a good condition, yet there is no
> > > possibility of a changed enh_error value for 0 in call_dspam nor in the
> > > function that calls it.
> > 
> > Cruft too then, or just defensive coding maybe...
> > 
> Actually, if you consider that cruft, then your code is broken as that
> is the condition necessary for it to work.

Ok. Heh. I hadn't looked at the code when writing this. Let me check.

Ok so we're discussing enh_error. It's passed by pointer, so the
fetch_and_copy_reclassified function first sets it to 0 assuming no
error. If there's no signature, it is set to -2 and the loop is broken,
this means that it'll be checked for non-zero later and we roll back the
transaction. Alternatively, enh_error can be set != 0 if call_dspam
returns an error which can happen when dspam returns an error code or
isn't present.

Not sure I understand your question now.

> Yes, it works only if I have --user USER as mentioned, without any
> domain stuff.

So I don't have --user given

>  (joe, not joe at whatever). Anyway, I think I have fixed the
> program with two lines of code being changed (depending on the preferred
> coding style, this may be 1-3 lines...). I will send you the patch later
> today if I get some spam to test it out on. Basically it amounts to
> having the first two arguments after the program name to execl to be
> "--user" and the equivalent to getenv("USER"). (Mine is two lines
> because I have done char *user=getenv("USER") at the beginning of
> call_dspam since most people seem to prefer that style instead of having
> getenv directly in the call to execl.

Usually dspam is able to either pick out the user from the signature
(uid in signature setting for dspam) or from the user it's running
under. I guess you're running some virtual user setup?

> > The point is that you have to
> >  (a) when no files exist:
> >       move into spam: create a file <sig> with contents "spam"
> >       move out of spam: create a file <sig> with contents "notspam"
> You said that you in your previous email.

Heh, I was too lazy to dig it up.

>  (B and C are indeed done.) A
> doesn't seem to happen.

Well, no, B and C aren't really done either since we never touch any
signature-database on disk.

>  Your code complains about no signatures. I will
> dig into the code a little later and help out with this if you would
> like. For now, the code should be patched to allow things in the spam
> folder to be moved out even if their is no signature or the signature
> has expired (and no longer points to any cache in dspam). Maybe your
> code already does this. I haven't had a chance to test it yet.

I think it *should* complain about signatures. If you try training such
an old message that dspam no longer knows about it, it'll throw an
error, and if you have a message without signature then you can't
retrain it. I just delete the message in that case, though I suppose if
you use a trash folder you'll have to use that configuration..

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20070508/be2dc463/attachment.pgp 

More information about the dovecot mailing list