/ Forums / Advansys Formativ / Creating Solutions with Formativ / getMessage from Proxy fails

  • Creator
    Topic
  • #4405
    sam
    Participant

    Hi,

    We have an applet that fires on send. It makes a log of every attachment and attachment whithin any attached email. The issue is if someone sends and email via a proxy the attachment email is not properly found because the attachment email is actualy located in the proxy account (The current user is forwarding an email that was received in the proxy account).

    How to i get this email message properly. I currently use the GetMessage fonction on the account. Also funny thing is i can only see proxyhistory adresse property on the Application object. Other useful properties like Proxied always is false.

    Any help is appreciated. Here is some code bellow…


    intParentAttachmentCount = GroupWise.ItemAttachmentGetCount("X00")
    for intCounter = 0 to intParentAttachmentCount - 1
    ' extract from email attachement as other classes don't have attachments
    if GroupWise.ItemAttachmentGetClass("X00", intCounter) = 2 then
    ' this function takes the email and extracts all attachment (is Recursive)
    ExtractAttachments groupwise.Account.GetMessage(groupwise.ItemAttachmentGetName("X00", intCounter))
    else
    'normal attachment code
    end if
    next

  • Author
    Replies
  • #8104
    sam
    Participant

    Hi,

    With the help of this post: http://www.advansyscorp.com/forums/topic/7454029072/

    I created a work around:

      
    
    intParentAttachmentCount = GroupWise.ItemAttachmentGetCount("X00")
           for intCounter = 0 to intParentAttachmentCount - 1
             ' extract from email attachement as other classes don't have attachments
             if GroupWise.ItemAttachmentGetClass("X00", intCounter) = 2 then
               ' current account
               set tmpMsg = groupwise.Account.GetMessage(groupwise.ItemAttachmentGetName("X00", intCounter))
               if tmpMsg <> "" then
                 ExtractAttachments tmpMsg
               else
                ' proxies
                for intPrx = 0 to groupwise.Account.Application.ProxyHistory.Count - 1
                   set tmpAccount = groupwise.Account.proxy(groupwise.Account.Application.ProxyHistory(intPrx))
                   set tmpMsg = tmpAccount.GetMessage(groupwise.ItemAttachmentGetName("X00", intCounter))
                   if tmpMsg <> "" then
                     ExtractAttachments tmpMsg
                     set tmpAccount = nothing
                     set tmpMsg = nothing
                     exit for
                   end if
                 next
                 set tmpAccount = nothing
                 set tmpMsg = nothing
               end if
             else
               ' normal attachment code
             end if
           next
    
    

    gonna go optimize it…

    #8103
    Support 3
    Participant

    We are glad to see you have found a good workaround to the problem and appreciate you posting.

    Regards,
    Advansys Support

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.