7 Replies Latest reply on Mar 17, 2007 12:58 AM by 405101

    How to copy email messages

      Hello everyone,

      Can this be done: copy sent messages from Sent Items from an OCS user on one db to another OCS user on another db?

      Yes, i know it's weird but this is the task. So, does anyone know how to?

      I've created a dblink between the 2 dbs but when i try mail_messages.copy_messages i get the following error:

      Error report:
      ORA-22160: element at index [2] does not exist
      ORA-06512: at "ES_MAIL.ES_FOLDER_API", line 2456
      ORA-06512: at "ES_MAIL.ES_FOLDER_API", line 2484
      ORA-06512: at "ES_MAIL.MAIL_FOLDER", line 1019
      ORA-06512: at line 29

      Thanks in advance for any tips or clues.

        • 1. Re: How to copy email messages
          The best approach would be to use a server side rule where you forward/copy the send message to the user on the second OCS.

          The two OCS instances must be independent - otherwise you'll end up in a loop.

          • 2. Re: How to copy email messages
            I have a dblink between db1 and db2. That's it. But i'm not interested in SSR's because i'd have to create a SSR for every user because it's a [1 user :1 user] copy operation i'm interested in.

            Thank you for your time and interest but i'm afraid that your solution is not what i need.

            • 3. Re: How to copy email messages
              what is your objective Irina? it might help in suggesting a solution.
              is the second db a live OCS instance? is it a "mirror" of the first system or completely different structure? are you trying to do compliance (outgoing mail) archiving or is this meant to be some kind of DR or backup system?
              • 4. Re: How to copy email messages
                Yep...it's archiving.
                The solution that Oracle offers is no good for us cause the users have to access the archive by a button click, so i am trying to replicate user accounts in term of emails and folder structure.

                So...any ideas?
                • 5. Re: How to copy email messages
                  Irina, I don't think the mail api is not really designed for that. To do things at the database level, you might want to look at streams to pump all changes over to an archive database.

                  However one thing to bear in mind is that if you are capturing changes in the user's mail folder then you do not have an authoritative record of all mail (just an archive of what actually made it into their folders (e.g. if they choose not to keep a sent copy, then you will not have it in your archive).

                  For this reason, true compliance archiving usually aims to intercept the smtp delivery process (either as an intermediate gateway or plugin to a gateway .. google for such products).

                  you would normally do this at your corporate smtp gateway. unfortunately, I don't believe you can internally intercept/hook the OCS smtp process with 100% reliability (e.g. via a trigger), so I'd suggest you look at external smtp solutions if you really need compliance archiving.

                  • 6. Re: How to copy email messages
                    Hi Paul,

                    Thank you for your suggestion but i found my solution. The mail api was designed for exactly that, but not the public ones...so i'm using the api's the application actually uses when a user copies a mail message in a shared folder. And it works.

                    So thank you for your input but i found what i was searching for.

                    All the best,

                    • 7. Re: How to copy email messages
                      Hi Irina, I'm intrigued by what you are doing. Can you post the details of your solution?