More about IMAP, less about Dovecot. This is more an IMAP question than specifically about Dovecot. Sorry to ask here but I've been researching, reading and lurking with no answer so far. What I'm doing is running reports as a user from a remote system to provide a list of messages (Sender/From, Subject, Date, size) in a specific folder(?). In one case it isn't even a Dovecot based server so I only have access as a client. (Though I use Dovecot on several other systems and will need this capability for them.) When a message in the folder has been reported I'd like to add a X-Header-??? indicating that the message has been reported so the next time through it isn't reported again. (After the message is X days old it is deleted.) These reports are run using Perl and I've tried most every CPAN module available but haven't figured out how to change/add a header then save the message back. So far I haven't been able to determine if this is even possible by reading the RFCs. Is there a method as a client from a remote system to make changes to a message then save it back? What is the IMAP verb, command, etc. to do this? Or if there are Perl programmers on the list a brief description (or code) for doing this? TIA (and sorry for the off topic posting), Rod --
On May 7, 2008, at 5:50 PM, Roderick A. Anderson wrote:> Is there a method as a client from a remote system to make changes > to a message then save it back?IMAP messages are immutable. The only way to modify an existing message is to save a new message and expunge the old one. -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 194 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20080507/fefe7a70/attachment-0002.bin>
On 5/7/2008, Roderick A. Anderson (raanders at acm.org) wrote:> Is there a method as a client from a remote system to make changes to > a message then save it back? What is the IMAP verb, command, etc. to > do this?Man, if you could, that would be really, really bad... So hopefully the answer is no, not, never... :) -- Best regards, Charles
At 7:50 AM -0700 5/7/08, Roderick A. Anderson wrote:>More about IMAP, less about Dovecot. > >This is more an IMAP question than specifically about Dovecot. >Sorry to ask here but I've been researching, reading and lurking >with no answer so far. > >What I'm doing is running reports as a user from a remote system to >provide a list of messages (Sender/From, Subject, Date, size) in a >specific folder(?). In one case it isn't even a Dovecot based >server so I only have access as a client. (Though I use Dovecot on >several other systems and will need this capability for them.) > >When a message in the folder has been reported I'd like to add a >X-Header-??? indicating that the message has been reported so the >next time through it isn't reported again. (After the message is X >days old it is deleted.)This is a bad idea. Adding any header to a delivered message is simply wrong on principle. IMAP requires that message headers and bodies do not change.>These reports are run using Perl and I've tried most every CPAN >module available but haven't figured out how to change/add a header >then save the message back. So far I haven't been able to determine >if this is even possible by reading the RFCs.You've read RFC3501 and missed section 2.3.1.1? Messages in IMAP are supposed to be *immutable* as far as all header and body data is concerned.>Is there a method as a client from a remote system to make changes >to a message then save it back? What is the IMAP verb, command, >etc. to do this? Or if there are Perl programmers on the list a >brief description (or code) for doing this?The two ways you could go with this are: 1. Instead of using a header, use an IMAP flag. One of the standard flags might suffice (i.e. '\Seen') but you can also come up with your own custom flags, which the Dovecot docs refer to as "keywords." These are set with the IMAP STORE command. 2. If you are absolutely locked in to an added header, you could delete the original message, create a modified version, and use the IMAP APPEND command to write the modified message back to a mailbox. -- Bill Cole bill at scconsult.com