[Dovecot] plugin problem

Timo Sirainen tss at iki.fi
Sun Sep 30 13:56:20 EEST 2007


On Sat, 2007-09-29 at 19:43 -0300, "Fábio M. Catunda" wrote:
> I'm almost there, look, from my log:
> FROM=Spam FILE=1191103168.P24773Q0M499718.fabio TO=INBOX
> 
> Looks perfect, but it's not. The real filename is
> 1191105530.P22847Q0M112390.fabio:2,Sa
> and not
> 1191103168.P24773Q0M499718.fabio
> 
> I'm using this function to get filename:
> filename = mail_get_special(mail, MAIL_FETCH_UIDL_FILE_NAME);
> 
> Anybody knows why the filename is returned incomplete?

Maildir filenames aren't stable. I suppose you could get it working most
of the time by getting the current filename, but nothing guarantees that
it hasn't changed already by the time you're trying to open it. You
could get the current filename by using maildir-specific functions (like
maildir_file_do() where the callback function would stat() the file,
like maildir_mail_stat() works in maildir-mail.c).

You already mentioned something about using FIFOs. I'm not exactly sure
how the dspam calling works, but I think FIFOs would be the best way to
do this and also in mailbox format-independent way. If you do the spam
training before COPY command finishes (i.e. in transaction_commit()), if
something crashes in the middle you don't lose anything, because the
entire COPY operation fails, and user tries it again later.

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


More information about the dovecot mailing list