i wrote a (Transport) like component in python to log jabber messages to a imap mail folder.
It is devloped to work as component with ejabberd 1.2 and [mod_service_log] enabled. Users can register to that component with a jabber client and are able to configure imap-mail access data. And specify a imap folder where the messages are archived. Jabber messages combined in session with a configurable timeout value. So we do not get a single mail for each jabber message.
The component work very well now and i will publish it opensource.
I have one small cosmetic problem. The Component ist not able to recognize the nick names of jabber ids from contacts. So it is only possible to log the jid of the contacts. That is not nice particular if you use a icq transport and the jid is only a stupid number (shame to icq).
Only solution i found is to sniff roster messages from clients and memorize the nicks for all logging jids. But then the roster is memorized at my component and at the ejabberd server. So it costs double memory. Is there any other method to get Roster items for jids. I think XEP-0133 would be able to solve this problem. But it ist not supported by ejabberd.