[Dovecot] plugin problem

Lars Stavholm stava at telcotec.se
Sun Sep 30 11:51:28 EEST 2007


Johannes Berg wrote:
> On Sun, 2007-09-30 at 09:30 +0200, Lars Stavholm wrote:
> 
>>>> The problem is that with the dspam setup I'm using, i.e. 3.8.0,
>>>> Hash driver, shared group, etc. I usually get "signature not
>>>> found", 
>>> The message from my plugin? I'm guessing then there's some problem with
>>> your setup and you didn't configure dspam to put the signature into the
>>> header?
>> I definitely have a dspam setup problem, never got the
>> signatures working with the hash drive.
> 
> Odd. I definitely have that working just fine.
> 
>> Input Options
>> -------------
>> The plugin input options was easy, it seems that dovecot
>> simply puts the options line into an env variable that
>> can be read with the getenv() call, e.g.:
>>
>> dovecot.conf:
>> ...
>> protocol imap {
>>   mail_plugins = dspam
>> }
>> plugin {
>>   # dspam path ':' spam folder ':' [no]signature ':' ignore
>>   dspam = /usr/sbin/dspam:Spam:signature:Trash
>> }
>>
>> ...and in the dspam plugin code I simply parse the result
>> from getenv("DSPAM") and there's the input options.
>>
>> In a future version one might add the ability to ignore
>> more than one folder.
> 
> Hey that looks good.
> 
>> Processing
>> ----------
>> I've tried to setup dspam with hash drive and signatures,
>> to no avail, I just can't get it to work, dspam does not
>> find the signature in the storage area. Don't know why.
> 
> Ah, you have a different problem then, ok.
> 
>> Does anyone have a dspam.conf you could share with me?
> 
> I'll send you mine in private mail.
> 
>> Possibly dspam build options as well?
> 
> Using debian's packages.
> 
>> Another (mildly stupid maybe) question: why the fork()
>> in the original dspam plugin? Seems to me that the fork()
>> + waitpid() doesn't really allow for any advantage over
>> a simple popen() and read the output? I have a sneaky
>> feeling that I'm missing something vital here.
> 
> popen() just forks/execs too, no? Coming from a kernel hacking
> background I'm more familiar with the low level details. Blame it on
> that.

popen() is more like system(), it starts a subprocess and
then waits until the subprocess is done. Difference between
popen() and system() is that using popen() I can capture the
output.

Cheers
/Lars



More information about the dovecot mailing list