Filtering Message based on attachment extension

Hi All,
I have task to develop a java based email client (POP3, IMAP and SMTP based) which only allows email with attachment with certain extension to be downloaded by clients. I develop it with javamail API.
So far my implementation for IMAP is to retrieve all unread/new messages and then check its attachments. All Messages that do not have attachment with intended file extension are discarded and my email client will only present those with intended file extension attachment.
Is there a more efficient way of doing this? can we, for example query the IMAP server by using certain search term so that we only retrieve messages with intended file extension? How about POP3?
Thank you

Very little information is retrieved from the IMAP server to get the
information you need. You can use the search method to reduce
the set of messages you need to consider, and you can use the
fetch method to optimize the fetching of the information needed
to decide whether to display the message. Note that the message
content won't be fetched until you display it.
You can turn on session debugging to see the IMAP protocol
commands being used.
POP3 is completely different. With POP3 you'll need to download
the entire message content to get the information you need to decide
whether to display the message.

Similar Messages

  • Polling messages based on priority in BPEL using JMS adapter

    Hi All,
    Is it possible to poll the messages based on the priority in BPEL using JMS adapter?
    I could set the priority for the messages but while polling it is picking the messages in FIFO(First in First out) order. But I want the messages to be picked on priority.Any help is appreciated.

    Do you only want to pick up messeges with a certain priority? So anything larger than say priority 2?
    You can try this: Oracle JCA Adapter for JMS - 11g Release 1 (11.1.1.5.0)
    Message SelectorThis field is also optional. It filters messages based on header and property information. The message selector rule is a Boolean expression. If the expression is true, then the message is consumed. If the expression is false, then the message is rejected.For example, you can enter logic, such as:
    JMSPriority > 3. Based on this, messages with a priority greater than 3 are consumed; all other messages are rejected.
    JMSType = 'car' AND color = 'blue' AND weight > 2500
    Country in ('UK', 'US', 'France')

  • Can JMS Message be filtered dynamically based on the JMS Header variable

    Hi All,
    We have a requirement to filter messages from an MQ (Queue) using the JMS Adapter.
    There is only one subscriber to this Queue.
    Can we use the Message Selector option using the same subscriber to pick different messages based on the context set.
    For example I have two BPEL instances running for the same BPEL process and both of them have to read messages from the same MQ Queue, say SampleQueue.
    The first BPEL instance need to pick the messages when JMSpriority = 1
    The second BPEL instance should pick the messages when JMSpriority = 2
    Is this possible? As the Message Selector in the examples given is expecting a literal on the right side of the expression.
    Ex : Country='UK' Color='Green' etc
    To put the question in a different way, can the right side of the expression in a message selector be a BPEL variable?
    Thanks

    Hi
    I have the same question. Basically, I want to match my response message with the request message. I am putting in an id in JMSCOrrelationID in the request. The applciation that send the response put the COrrelationId, I sent into the JMSMessageId. But now, I want to correlate my request and response? What is the best way to do this in BPEL?
    Can the right side be a variable? I want to say JMSMessageID = 'ID: ' + JMSCorrelationId.

  • Error messages when I attach iPad;

    I keep getting an error message when I attach my iPad/iPhone and try to go to iTunes:
    "The registry settings used by the iTunes drivers fro inmportng and burning CDS and DVDs are missing.  This can happen as a result of installing other CD burning software.  Please install iTunes"  I   HAVE UNINSTALLED, INSTALLED SEVERAL TIMES; TRIED "REPAIRING", TOO. 
         It took an hour to load 10 songs last night to iTunes from a CD to load on iPad/Phone. 

    NO, you have to edit the registry like below (do it with extreme care):
    Open Registry Editor:
    XP: From the Start menu click Run. In the resulting dialog, type "regedit" (without quotes) and click OK.
    Vista: From the Start menu, in the Start Search dialog, type "regedit" (without quotes) and press Enter.
    Windows 7: From the Start menu, in the "Search programs and files" dialog, type "regedit"(without quotes) and press Enter.
    If Windows needs your permission to continue, click Continue.
    Click the plus sign (XP) or arrow (Vista and Windows 7) next to HKEY_LOCAL_MACHINE to expand its contents.
    Expand the contents of SYSTEM.
    Expand the contents of CurrentControlSet.
    Expand the contents of Control.
    Expand the contents of Class.
    Click to select the heading that begins with "{4D36E965-" (you just need to highlight this folder). It should look like this: 
    From the File menu, click Export.
    In the dialog box that appears, make sure the "Selected branch" radio button is enabled, then save the file somewhere that you can find it later. This is a backup of this registry key. You should hang on to this in case you need to reimport your original settings later.
    On the right side of the Registry Editor window, right-click the UpperFilters entry and choose Modify from the shortcut menu.
      If the UpperFilters entry is missing, follow these instructions:  Right-click the empty white space within the right-hand portion of the Registry Editor window. From the shortcut menu, choose New > Multi-String Value.
    Name this new value "UpperFilters" (without the quotes). Then, right-click the newly created UpperFilters entry and choose Modify from the shortcut menu.
    In the window that appears, use the appropriate steps below to add iTunes device filter to the "Value data" box.  If the "Value data" box already contains text, follow these instructions:  The text contained in the "Value data" box represents third-party device filters. If you remove these device filters, the third-party software that installs them may stop functioning properly. In the example below "NTIDrvr" and "SiRemFil" represent these third-party device filters.
    Click in the box below this text. This accomplishes two things. First, it removes the highlighting from the text. This way when you start typing it won't overwrite these device filters. Second, it places the cursor below this text.
    Now, type "GEARAspiWDM" (without quotes) to add the iTunes device filter.
    If the "Value data" box is blank, follow these instructions:
    Type GEARAspiWDM to add in the iTunes device filter. See the example below.
    Continue on with the next step.
    Click OK.
    Restart the computer.

  • Mail freezes if a message has an attachment: help!!

    I just upgraded my G4 imac to an intel imac last week. So far so good, until yesterday, when Mail started acting up. It is to the point that I have to use the webmail version.
    When I launch the program, and have new messages, I click on them. But if the message has an attachment (which my spam messages often do), when I click them (even single click- just to select them so I can delete them)- Mail totally freezes and I have to quit the app. And the hard drive makes a lot of scary loud noise. I have never experienced anything like this before, and am not sure what to make of it. If the message does not have an attachment, it seems to work just fine. But so as it is, I just can't select the messages with attachments. B/c as soon as I do, the app is useless and frozen and I have to quit, sometimes even force-quit.
    Help!!
    Thanks.

    You’re welcome.
    You really should either erase the disk and restore from a backup or repair it with a disk utility. If you keep using the computer under those conditions, things can only get worse and you may soon start experiencing frequent crashes or even data loss...
    I don’t know much about third-party disk repair utilities because I’ve never used anything other than Disk Utility myself. The best disk repair utility is a good backup, which everybody should have anyway. If I ever encounter a problem that Disk Utility cannot fix, I just erase the disk and restore from a backup.
    Assuming the version of Disk Warrior you have supports Mac OS X 10.4 (which I don’t really know) and the problem is just that you cannot use it to boot an Intel-based Mac, if you have access to a PowerPC-based Mac with Mac OS X 10.4 installed, I believe you should be able to repair the disk by connecting the Intel-based Mac in Target Disk Mode to the PowerPC-based Mac.

  • Pick mails based on attachment name

    Hi experts,
    How to pick a mail from the mail server based on attachment name using pop3 portocol?
    Regards
    Sowmya

    Hi Sowmya,
    I asume you use microsoft exchange server?
    In this case I would not to this request in XI.
    It is possible to write macros for MS exchange.
    The macro could read the mails. If the mail matches the request the macro cut paste the mail to a dedicated mail-folder.
    XI only polls on this dedicated folder. so it is guaranteed that XI just processes messages that should be processed.
    Regards Mario

  • Different Attachment extension(.xls,.txt) in sender mail adapter

    Hi Experts
    Is it possible to use different type of attachment extension (e.g .xls,.txt) in the sender mail adapter?
    My requirement is , the attachment in the mail adapter will be used as the main payload.So I am using PayloadSwapBean adapter module.
    Currently I am using the following module key for .xls attachment and it is working.Configuration for .xls attachment is as follows
    swap.keyName-Content-Disposition
    swap.keyname-Content-Description
    swap.keyName-Content-Type
    swap.keyValue-attachment;filename="MailAttachment-1.xls"
    swap.keyValue-MailAttachment-1
    swap.keyValue-application/vnd.ms-excel.
    Now, the attachment may be .xls or .txt file.
    Now If I want to use .txt atachment then do I need to define all these parameter again and in that case what will be my content type for .txt file.
    Your inputs required
    thanks
    Ayan

    PayloadSwapBean  will only convert the attachment as the main payload.
    Yeah for reading excel file I have a separate custom adapter module.This is not in the scope of my question..
    All I am asking , can .txt as well as .xls attachment be used in the same sender mail adapter.
    If that is possible what will be my content-type for .txt or can I remove content-type and use only content-disposition and content-description so that any type of attachment it can recognise.
    The momment I am specifying  content-type , I am making it particular  that only say .xls attachment , it will identify.
    I hope I make you clear.Inputs required
    Thanks
    Ayan

  • When trying to install an extension for InDesign CC 2014 I get an error message saying that the extension only works with version 7.0 or greater. My version is 10.0.0.7 x64 Build I was using this extension fine with InDesign CC

    When trying to install an extension for InDesign CC 2014 I get an error message saying that the extension only works with version 7.0 or greater. My version is 10.0.0.7 x64 Build I was using this extension fine with InDesign CCError message with InDesign CC 2014

    Used the 64bit version before CC 2014 as well so don't think that's the issue. Here is the text in the .mxi file if I have missed something:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <macromedia-extension id="PrintUI Tools" name="PrintUI Tools" requires-restart="true" version="3.0.0">
      <author name="PrintUI.com"/>
      <description/>
      <license-agreement/>
      <products>
        <product maxversion="" name="InDesign" primary="true" version="7.0"/>
      </products>
      <files>
        <file destination="" file-type="CSXS" products="" source="PrintUIManagement.zxp"/>
      </files>
      <update url="http://printui.com/public/downloads/updates/printui_tools_update.xml"/>
    </macromedia-extension>

  • Header missing in SOAP message header (SAP XI Extension)

    Hi Experts,
    We are implementing interface MasterDataUpdateConfirmation_Out between 2 SAP ERP systems. The middleware is SAP PI.
    SAP PI team requested a change in this interface Stack - Replace Stack ABAP by Stack Java. The changes were made.
    However, now we get an error in the interface in the SAP ERP sender system, but the message arrives to SAP PI where is processed without errors and also arrives to SAP ERP receive system and the message is also processes without errors.
    The error we have in XML message in SAP ERP sender system is:
    XML element {http://schemas.xmlsoap.org/soap/envelope/}Header missing in
    SOAP message header (SAP XI Extension)
    Exception of class CX_XMS_SYSERR_PARSER
    Can anyone please help us? We have no ideia what to do.
    Thanks in advance,
    RS

    Hi again,
    I don't know if it is important, but the communication is asynchronous and the sender system is SAP ECC 6.0.
    Thanks!

  • Envelope missing in SOAP message header (SAP XI Extension)

    I have scenario where in I am sending a file from XI to PCK. BUt i am getting a following error.
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Call Adapter
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>XIProtocol</SAP:Category>
      <SAP:Code area="PARSER">ITEM_MISSING</SAP:Code>
      <SAP:P1>Envelope</SAP:P1>
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>XML tag Envelope missing in SOAP message header (SAP XI Extension)</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    I am enclosing the file i am trying to send.
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:CFP_SENDER_MT xmlns:ns0="HTTP://PCKXI.WORLDBANK.ORG">
    - <SEND>
      <TF_Number>12</TF_Number>
      <TF_Desc>1212</TF_Desc>
      </SEND>
      </ns0:CFP_SENDER_MT>
    Can somebody please enlighten me about this error? Points would be rewarded immediately
    Regards,
    Manish

    Dear Manish,
    quite often the reason for this kind of error
    is the fact that the receiver of the XI message is
    returning a http response to the Integration Server.
    As of XI3.0 SP21 / PI7.0 SP13 this response
    is also properly parsed and visible in the error
    header of the XI message.
    For almost all prior support package levels an
    advanced correction is available as per OSS note:
    1064346 Improved error output for connection problems
    Please check whether this applies to your system.
    If so, you will see detailed information on the error
    in the error header object of the XI message as soon
    as this issue re-occurs.
    Best Regards,
    Harald Keimer
    XI Development Support
    SAP AG, Walldorf

  • Collecting Message based on Delivery Id

    Hi,
    We have an scenario to collect the messages based on delviery number, like customer sends the bulk order and SAP splits that order and create the delivery for each splitted orders .
    Eg.
    Sales Order     Batch Order
    PO#      1234
    This Batch order is split in to multiple orders as below
    Order_1     Order_2     Order_3
    1234_A_C     1234_B_C     1234_C_C
    Delivery_1     Delivery_2     Delivery_3
    1     2     3
    These deliveries are sent to PI as DESADV in differnet time frame.
    ->     DESADV# 1     DESADV# 2     DESADV# 3
    inbound time     10:30AM     11:00AM     11:20AM
    PO#     1234_A_C     1234_B_C     1234_C_C
    Outbound time     11:20AM     11:20AM     11:20AM
    Now we need to collect all the DESADV for a single batch order and send it to customer as a single DESADV .
    Can anyone help me how to handle this in PI.
    Is there any BPM process there to collect the messages based on PO number (1234_A_C,1234_B_C,1234_C_C) for particular partner.
    I know correleation id can be used but PO is not constant.
    Thanks
    Lakshmi S

    you can use the BPM Pattern to achieve this functionality.
    Also refer the following links:
    http://help.sap.com/saphelp_nwpi71/helpdata/EN/08/16163ff8519a06e10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/41/e3d13f7fb44c21e10000000a1550b0/frameset.htm
    /people/sudharshan.aravamudan/blog/2005/12/01/illustration-of-multi-mapping-and-message-split-using-bpm-in-sap-exchange-infrastructure

  • Find Message based on Content

    Hi all
    Is it Possible in XI to find a message based on the Message Content.Like any value in Payload?
    Thanks and Regards
    Bhasker

    Hi Bhasker,
        Check this blog:
    http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3417600)ID0547743150DB20098387303032179271End?blog=/pub/wlg/2675
    Regards,
    Ravi

  • Problem with sending message with excel attachment

    hi,
           i m using sap b1 2005b  i send message with excel attachment to sap user but message is reached to destination but attchment cannot send .ot shows an internal error pls help me.
    reagrds,
    vishal

    Vishal,
    Couple of questions. 
    How are you sending this message.  Is it a message that you create and send Internally with an attachment.
    As you reply me, please also check if the <b>Attachments folder</b> has been set under <b>Administration > System Initialization > General Settings.....Path Tab</b>
    SBO tries to copy the attachment from the location you select to the Path defined for Attachments.
    Let me know
    Suda

  • Group the files based on their extensions

    Hi,
    I am traversing a dir and listing all the files under that directory. Now i want to group the files based on the extension and just print the number of files with each extension.
    ex:
    Extension No.of Files Size of the files
    .java 10 23455 bytes
    .html 2 1000 bytes
    I am able to get the extension of the files. I would like to know how to proceed after that.
    Any sample code will be helpful.
    Regards
    Kutty

    I have used a method to list all the files in the directory. After adding files with same extension to the HashMap. i am printing files after reading file by file. I need to print the files once i complete reading all the files in the directory.
    Any suggestions?
    private void listingFiles(File f )
              Map extensionMap = null;
              File[] files = f.listFiles();
              for( int i = 0; i < files.length; i++ )
                   File file1 = files;
                   Dprop.size += files[i].length();
                   if (file1.isFile())
                        fcount = fcount +1;     
                        if (extensionMap == null)
                             extensionMap = new HashMap();
                             // Group files by extension
                             for(int idx = 0; idx < files.length; idx++)
                                  if (files[idx].isFile() && files[idx] != null)
                                       String ext = getExtension(files[idx]); // get the extension
                                       ext = ext.toLowerCase();
                                       List fileList = (List)extensionMap.get(ext);
                                       if(fileList == null)
                                       fileList = new ArrayList();
                                       extensionMap.put(ext, fileList);
                                       fileList.add(files[idx]);
                        // Access all the files by extension
                             for(Iterator extensionIterator = extensionMap.keySet().iterator(); extensionIterator.hasNext(); )
                                  String ext = (String)extensionIterator.next();
                                  List fileList = (List)extensionMap.get(ext);
                                  System.out.println("\n\nNo of Files "+fileList.size()+" with extension '"+ext+"' in '"+f+ "' Directory");
                                  for(Iterator fileIterator = fileList.iterator(); fileIterator.hasNext(); )
                                       File file = (File)fileIterator.next();
                                  System.out.println("File Name "+file+" File Size "+file.length());
                   else
                        dcount = dcount +1;
                        listingFiles( file1 );
    Thanks in advance
    Kutty

  • I can't find the photos after I have saved them from a text message, It says attachment saved, where do they go and how do I get there? Thanks

    I can't find the photos after I have saved them from a text message, It says attachment saved, where do they go and how do I get there? Thanks

    Here to help shed some additional light on this case, jdondr. I also own a Maxx. With your phone, if you access the Gallery, there should be a folder named: Messaging.  If you look at the upper left hand corner, you should see a drop down box. Is it currently set to Albums?
    NicandroN_VZW
    Follow us on Twitter @VZWSupport
    If my response answered your question please click the �Correct Answer� button under my response. This ensures others can benefit from our conversation. Thanks in advance for your help with this!!

Maybe you are looking for