[jdev] RFC 3921 message to RFC 5322 message conversion

Tomasz Sterna tomek at xiaoka.com
Tue Jan 5 04:02:42 CST 2010


I am working on accessing jabber message archive with IMAP and a normal
MUA with IMAP backend.

This begs a question: How do I convert RFC 3921 message, to RFC 5322
message to store in IMAP store. (But it may also be useful for
Jabber/E-Mail gateway.)

1. How do i store 'from' and 'to' fields of the XMPP message?
RFC 5322 defines From: as mailbox-list and To: as address-list which in
turn reduces to addr-spec which does not include schema and is assumed
to be in SMTP domain. ":" is used to delimiter group names so we cannot
use XMPP URI there.
- Should I add X- header for preserving XMPP 'from' field? What exact?
- Should I fill From: and To: fields to maka maile readers usable?

2. Subject: header is straightforward

3. <thread/> converts directly to References:
- what if there is no <thread/>? Should I supplement it? How?

4. Should I generate Message-ID header? If so, how? Maybe it would be
useful to base it on some of the message characteristics?

Tomasz Sterna

More information about the JDev mailing list