[Dovecot] Retrieve Physical Message Filename

Timo Sirainen tss at iki.fi
Tue Dec 29 23:02:04 EET 2009


On Tue, 2009-12-29 at 15:50 -0500, Tony Rutherford wrote:
> Hi,Using Dovecot 1.2.9 with Maildir and Layout=FS.In a plugin, i'm
> overriding "update_flags":void my_mail_update_flags(struct mail
> *_mail, enum modify_type modify_type, enum mail_flags flags)For this
> email which is having its flags updated, I need to retrieve the
> physical filename of the message.  I see where
> using:mail_get_special(_mail, MAIL_FETCH_UIDL_FILE_NAME,  &fname);...I
> can retrieve part of the filename, but without the ":2" and the flags
> part.Is there a method I can use to get the whole filename (without
> having to reassemble it myself).  I've looked around, and I'm guessing
> it exists, but I don't see it offhand.

The problem is that by the time you're trying to access the file, its
flags may have already changed, which also means its filename could have
changed. So even if you got it, your code would probably randomly fail.

What exactly are you going to do with the filename? Maybe you should
instead be opening the file with mail_get_stream() and doing something
with the fd.

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


More information about the dovecot mailing list