[Dovecot] Retrieve Physical Message Filename
Tony Rutherford
arutherford at bluetie.com
Wed Dec 30 16:23:01 EET 2009
Thanks for the reply. I won't be changing any files, or even accessing them, i'll simply be passing the filename along to "another system". I'm not allowed to change this other system or any of its interfaces. The other system has been in place and is "off limits" as far as changes go (I'm told). To make it simple, this other system needs to be notified of any flag changes on emails. So, when we detect a flag change (in our plugin), we need to pass the message filename along to this other system. I hope this makes sense...and again...i'm not justifying the need for it, but I have to play the hand i'm dealt....Tony RutherfordSoftware EngineerBlueTie Inc.arutherford at bluetie.com(585) 586-2000 x1040-----Original Message-----From: "Timo Sirainen" [tss at iki.fi]Date: 12/29/2009 04:02 PMTo: "Tony Rutherford" CC: dovecot at dovecot.orgSubject: Re: [Dovecot] Retrieve Physical Message FilenameOn 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.
This message is intended solely for the individual(s) to whom
it is addressed. If you are not the intended recipient, any
dissemination or copying is strictly prohibited. If you
believe you received this message in error, please notify
the sender and delete from your system. Thank you.
More information about the dovecot
mailing list