0

I'm uploading messages into my IMAP mail server via IMAP store operation. However, I would like to add "comments" to these messages so that when I download these emails again I know the they are created by "store". Basically, I need to add text which will be ignored by the formal semantics of parsing RFC822.

The specification of http://www.ietf.org/rfc/rfc822.txt defines how to add comments but I cannot make it working :(

Does anybody has en example of a RFC822 message with a comment in it?

Robert Grezan
  • 1,266
  • 3
  • 13
  • 27
  • 2
    Couldn't you just make up a header, or if your server has arbitrary flags, append with a custom IMAP flag – Max May 25 '13 at 22:36
  • @max Yes - that is one way to solve this problem but using comments seems much cleaner because what ever I want to add are actually just comments :) – Robert Grezan May 25 '13 at 23:14
  • I'm not sure what you mean by comment, the only comments I know are the (parenthesized) bits that can appear after names in email addresses. – Max May 26 '13 at 02:42
  • @Max you are right - that is comment I'm talking about. I was adding X-UNIQUE-SPECIAL-DATA: Something (some comment info) but that is not working - meaning java mailx parser is saying that is not ok. – Robert Grezan May 26 '13 at 09:27
  • 1
    I don't think there's any such thing as an out-of-band comment (outside the bounds of the message) in RFC 822, at least not supported by IMAP. As @Max said, your best best is probably a header, or if you really want something out of band, an IMAP flag. Your RFC822 parser should not be choking on `X-UNIQUE-SPECIAL-DATA`. – Celada May 26 '13 at 14:25
  • You should be aware that RFC822 has long been superseded by newer versions; the current specification is [RFC5322](http://www.ietf.org/rfc/rfc5322.txt). Especially some of the more esoteric features of 822 are gone in the newer versions. – tripleee May 27 '13 at 16:53

1 Answers1

0

You are probably looking for IMAP's annotations. However, it's an extension which is far from being common -- quite a lot of IMAP servers do not support it.

It seems that having a special "flag" on each message you created is something which would be enough for you. If that is correct, then simply using IMAP flags (or keywords) is what you're looking for. Simply add one special flag, like thisIsProducedByFooSoftware to the APPEND operation. (You said you were doing that via STORE -- that's wrong, in IMAP, STORE manipulates just FLAGS, it doesn't add new messages. New messages are added by APPEND.)

Jan Kundrát
  • 3,700
  • 1
  • 18
  • 29