A4 BAD Protocol Error: "Specified set of flags is not valid"

Hi there
I try to implement a copying procedure for mails. The application should copy all messages (with flags and all that stuff) from one mail account to another one. As mail server are used an Exchange 2003 Server and a Zimbra server (version 5). The connection protocol is IMAP. I'm using javaMail 1.4.0
Anyway, if I'm trying to copy a message which has set the flags RECENT and SEEN as well as some user flags, I get this error message:
javax.mail.MessagingException: A4 BAD Protocol Error: "Specified set of flags is not valid".;
  nested exception is:
     com.sun.mail.iap.BadCommandException: A4 BAD Protocol Error: "Specified set of flags is not valid".
     at com.sun.mail.imap.IMAPFolder.doCommand(IMAPFolder.java:2337)
     at com.sun.mail.imap.IMAPFolder.appendMessages(IMAPFolder.java:1289)
     at org.zimbra.exchange.MyTestClass.main(MyTestClass.java:323)
Caused by: com.sun.mail.iap.BadCommandException: A4 BAD Protocol Error: "Specified set of flags is not valid".
     at com.sun.mail.iap.Protocol.handleResult(Protocol.java:296)
     at com.sun.mail.imap.protocol.IMAPProtocol.appenduid(IMAPProtocol.java:881)
     at com.sun.mail.imap.protocol.IMAPProtocol.append(IMAPProtocol.java:835)
     at com.sun.mail.imap.IMAPFolder$10.doCommand(IMAPFolder.java:1292)
     at com.sun.mail.imap.IMAPFolder.doProtocolCommand(IMAPFolder.java:2387)
     at com.sun.mail.imap.IMAPFolder.doCommand(IMAPFolder.java:2332)
     ... 2 moreThis is a shortened source code which I'm using. In principle it is based on the sample files given in the documentation:
eStore = eSession.getStore();
eStore.connect(user, password);
zStore = zSession.getStore();
zStore.connect(userZimbra, passwordZimbra);
IMAPFolder fe = (IMAPFolder) eStore.getDefaultFolder().getFolder("inbox");
IMAPFolder f = (IMAPFolder) zStore.getDefaultFolder().getFolder("inbox");
f.open(Folder.READ_ONLY);
Message[] msgs = f.getMessages();
fe.appendMessages(msgs);Can someone help me and describe what I'm doing wrong??
thanks

Could You make an example?
I tried to subclass the class 'IMAPMessage' (messages which are returned with folder.getMessage() are of that type) and cast the messages to my new class. Unfortunately, I get always a 'ClassCastException'.
This are parts of my code:
public class MyIMAPMessage extends IMAPMessage {
     protected MyIMAPMessage(IMAPFolder folder, int msgnum, int seqnum) {
          super(folder, msgnum, seqnum);
          // TODO Auto-generated constructor stub
     public Flags getFlags() {
          Flags flags = new Flags();
          for (int i=0; i<flags.getSystemFlags().length; i++)
               flags.add(flags.getSystemFlags());
          return(flags);
f.open(Folder.READ_ONLY);
Message[] msgs = f.getMessages();
System.out.println(((MyIMAPMessage)msgs[0]).getFlags());
I think I do not exactly get your point. Maybe You could explain it a little more in detail.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • [Forum FAQ] Troubleshooting error "The specified SQL server instance is not valid" when installing SCOM reporting service

    Symptom
    If you have failed to install SCOM reporting service, you may encounter below error when you reinstall it:
    “The specified SQL server instance is not valid”.
    (Figure 1)
    Figure 1.
    Reason
    This issue may be caused by multiple reasons, for example the reasons in Figure 1.
    However, you may find that SSRS and Report Server website are configured correctly and no SSL or proxy Server is used. In these scenario, you can open the log file under path
    to find the root reason:
    C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\LogFiles
    Later, you will find the error as below:
    ERROR: Throwing Microsoft.ReportingServices.Library.ReportServerDisabledException: , Microsoft.ReportingServices.Library.ReportServerDisabledException:
    The report server cannot decrypt the symmetric key that is used to access sensitive or encrypted data in a report server database. You must either restore a backup key or delete all encrypted content. ---> System.Runtime.InteropServices.COMException
    (0x80090016): Keyset does not exist (Exception from HRESULT: 0x80090016)
    at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
    at RSManagedCrypto.RSCrypto.ReencryptSymmetricKey(Byte[] symKeyBlob, Byte[] pPublicKeyBlob)
    at Microsoft.ReportingServices.Library.ConnectionManager.<GetEncryptionKey>b__2()
    --- End of inner exception stack trace ---;
    Solution
    According to the error message, you can delete encrypted content by following the steps below:
    Open SQL Reporting Services Configuration Manager.
    Select “Encryption Keys”.
    Click “Delete” to delete all encrypted content. (Figure 2)
    Figure 2.
    After that, we can install SCOM reporting service again, after successfully install reporting service, we should see the SCOM operation console as below:
    Figure 3.
    In addition, you may also encounter other errors when installing SCOM reporting service, and the troubleshooting steps may be different. However, we can also check SQL reporting
    service logs to find the root reason.
    Here are some articles that would be helpful for SCOM reporting service installation and troubleshooting:
    How to Install the Operations Manager Reporting Server
    http://technet.microsoft.com/en-us/library/hh298611.aspx
    Unable to install SCOM 2012 Reporting Services
    http://blogs.technet.com/b/mdegre/archive/2013/05/27/unable-to-install-scom-2012-reporting-services.aspx
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    Hello,
    I'm afraid you must use a dedicated instance of SQL Server for each site(SCOM/SCCM). Some similar issues were disscussed on this forum:
    SCCM and SCOM - SQL Server 
    http://social.technet.microsoft.com/Forums/en-US/configmanagergeneral/thread/bfa14da9-4692-4c64-a107-e085c967d259
    SCOM, SCCM, SQL on same server?
    http://social.technet.microsoft.com/Forums/en-US/configmgrsetup/thread/b5373aa7-5233-4b1f-9b39-b86e481e04d5
    Thanks,
    Yog Li
    TechNet Community Support

  • Flat file connection: The file name "\server\share\path\file.txt" specified in the connection was not valid

    I'm trying to execute a SSIS package via SQL agent with a flat file source - however it fails with Code: 0xC001401E The file name "\server\share\path\file.txt" specified in the connection was not valid.
    It appears that the problem is with the rights of the user that's running the package (it's a proxy account). If I use a higher-privelege account (domain admin) to run the package it completes successfully. But this is not a long-term solution, and I can't
    see a reason why the user doesn't have rights to the file. The effective permissions of the file and parent folder both give the user full control. The user has full control over the share as well. The user can access the file (copy, etc) outside the SSIS
    package.
    Running the package manually via DTExec gives me the same error - I've tried 32 and 64bit versions with the same result. But running as a domain admin works correctly every time.
    I feel like I've been beating my head against a brick wall on this one... Is there some sort of magic permissions, file or otherwise, that are required to use a flat file target in an SSIS package?

    Hi Rossco150,
    I have tried to reproduce the issue in my test environment (Windows Server 2012 R2 + SQL Server 2008 R2), however, everything goes well with the permission settings as you mentioned. In my test, the permissions of the folders are set as follows:
    \\ServerName\Temp  --- Read
    \\ServerName\Temp\Source  --- No access
    \\ServerName\Temp\Source\Flat Files --- Full control
    I suspect that your permission settings on the folders are not absolutely as you said above. Could you double check the permission settings on each level of the folder hierarchy? In addition, check the “Execute as user” information from job history to make
    sure the job was running in the proxy security context indeed. Which version of SSIS are you using? If possible, I suggest that you install the latest Service Pack for you SQL Server or even install the latest CU patch. 
    Regards,
    Mike Yin
    If you have any feedback on our support, please click
    here
    Mike Yin
    TechNet Community Support

  • Know good email address flagged as not valid

    I'm getting know good email addresses flagged as not valid when I try to send email. Any suggestions?

    What is the exact error message you are getting? Could it be that you can't connect to your outgoing server (It is common for this to happen)... if the message is "address invalid" read carefully and make sure it is not saying "server address invalid".
    The fix for most people is to use the default SMTP server on the iPhone instead of your ISPs. Most ISPs don't allow access to their SMTP servers from outside their network - so if you are not on your home WiFi, the outgoing email will fail.

  • "specified handle or index is not valid" on System.loadLibrary

    Hi,
    I have a WAS 6.40 installation on HPUX 11i. I am using a native method in one of the login modules I have made, but am getting the following error (stack trace shown below):
    [Jan 11, 2005 11:33:27 AM - 10 - Err] java.lang.UnsatisfiedLinkError: /usr/lib/libJDecrypt.sl: specified handle or index is not valid.
    [Jan 11, 2005 11:33:27 AM - 10 - Err] 0: java.lang.ClassLoader$NativeLibrary.load(Native Method)
    [Jan 11, 2005 11:33:27 AM - 10 - Err] 1: java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1611)
    [Jan 11, 2005 11:33:27 AM - 10 - Err] 2: java.lang.ClassLoader.loadLibrary(ClassLoader.java:1511)
    [Jan 11, 2005 11:33:27 AM - 10 - Err] 3: java.lang.Runtime.loadLibrary0(Runtime.java:795)
    [Jan 11, 2005 11:33:27 AM - 10 - Err] 4: java.lang.System.loadLibrary(System.java:834)
    [Jan 11, 2005 11:33:27 AM - 10 - Err] 5: com.netegrity.siteminder.sap.webas.util.JavaDecrypt.<clinit>(JavaDecrypt.java:56)
    [Jan 11, 2005 11:33:27 AM - 10 - Err] 6: com.netegrity.siteminder.sap.webas.jaas.SiteMinderLoginModule.<clinit>(SiteMinderLoginModule.java:146)
    [Jan 11, 2005 11:33:27 AM - 10 - Err] 7: sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    [Jan 11, 2005 11:33:27 AM - 10 - Err] 8: sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    [Jan 11, 2005 11:33:27 AM - 10 - Err] 9: sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    [Jan 11, 2005 11:33:27 AM - 10 - Err] 10: java.lang.reflect.Constructor.newInstance(Constructor.java:274)
    [Jan 11, 2005 11:33:27 AM - 10 - Err] 11: java.lang.Class.newInstance0(Class.java:308)
    [Jan 11, 2005 11:33:27 AM - 10 - Err] 12: java.lang.Class.newInstance(Class.java:261)
    [Jan 11, 2005 11:33:27 AM - 10 - Err] 13: com.sap.engine.services.security.login.LoginContextFactory.initializeLoginContext(LoginContextFactory.java:160)
    [Jan 11, 2005 11:33:27 AM - 10 - Err] 14: com.sap.engine.services.security.login.FastLoginContext.login(FastLoginContext.java:127)
    [Jan 11, 2005 11:33:27 AM - 10 - Err] 15: com.sap.engine.services.servlets_jsp.server.runtime.context.SessionServletContext.doLogin(SessionServletContext.java:619)
    [Jan 11, 2005 11:33:27 AM - 10 - Err] 16: com.sap.engine.services.servlets_jsp.server.runtime.context.SessionServletContext.checkUser(SessionServletContext.java:294)
    [Jan 11, 2005 11:33:27 AM - 10 - Err] 17: com.sap.engine.services.servlets_jsp.server.runtime.context.ApplicationContext.checkMap(ApplicationContext.java:403)
    [Jan 11, 2005 11:33:27 AM - 10 - Err] 18: com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.checkRequest(HttpHandlerImpl.java:67)
    [Jan 11, 2005 11:33:27 AM - 10 - Err] 19: com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:780)
    [Jan 11, 2005 11:33:27 AM - 10 - Err] 20: com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:239)
    [Jan 11, 2005 11:33:27 AM - 10 - Err] 21: com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
    [Jan 11, 2005 11:33:27 AM - 10 - Err] 22: com.sap.engine.services.httpserver.server.Processor.request(Processor.java:147)
    [Jan 11, 2005 11:33:27 AM - 10 - Err] 23: com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)
    [Jan 11, 2005 11:33:27 AM - 10 - Err] 24: com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)
    [Jan 11, 2005 11:33:27 AM - 10 - Err] 25: com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
    [Jan 11, 2005 11:33:27 AM - 10 - Err] 26: java.security.AccessController.doPrivileged(Native Method)
    [Jan 11, 2005 11:33:27 AM - 10 - Err] 27: com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)
    [Jan 11, 2005 11:33:27 AM - 10 - Err] 28: com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:162)
    Strangely when I try to load the .sl library from a test application outside WAS it loads perfectly. Have tested a similar DLL on a WAS setup on Windows. It works fine there.
    regards,
    Vishal

    Hi Markus,
    Thanks for pointing out the problem. I was suspecting the same too.
    Unfortunately we are also using some third party libraries, which happen to be 32-bit. Would need a workaround somehow.
    Could you mention the location from where u got the info regarding PAM on HPUX? As in where is it documented etc.?
    regards,
    Vishal

  • After moving from Canada to the US, getting a new iPhone 5C, and restoring my backup from iCloud, I can't update my apps. I get an error message that my account is not valid in the Canadian App store and I must change to the US store. How do I do that?

    After moving from Canada to the US, getting a new iPhone 5C, and restoring my backup from iCloud, I can't update my apps. I get an error message that my account is not valid in the Canadian App store and I must change to the US store. How do I do that?

    Change here:
    Settings > iTunes & App Stores > Apple ID: > View Apple ID > Country/Region.
    You must have a verified billing address & be located in the country whose store you are trying to use.

  • Create asset-error"E003 SYST: Period 000 is not valid in financial year var

    Error during Asset Creation: E003
    AS01: Create asset was executed. During saving the asset got an error
    E003 SYST: Period 000 is not valid in financial year variant
    Following are the Depr keys assigned;
    LINA is being used for Book Depreciation
    MSTL Depreciation key is being used for ACRES, ALT MIN, ACE, E&P.
    Asset Class is Buildings

    Hello!
    I had the same problem a few month ago. There is a SAP note about this. Run the Asset Year end technical proces in ARJW. Try again your asset creation.
    Greetings,
    Stéphane

  • Where() clause returning "The query specified in the URI is not valid..."

    I have a .Net mobile service.
    Calling this:
    https://qserv.azure-mobile.net/tables/items?$filter=(company%20eq%20%27987af3f9-8d44-4a9d-8be2-7e0567287106%27)
    Returns:
    {"message":"The query specified in the URI is not valid. Could not find a property named 'company' on type 'Default.<>f__AnonymousType2_3OfString_String_Double'."}
    The field name in the "items" entity model is "company" and on the database is "company_Id", neither will work.Using http://ajax.aspnetcdn.com/ajax/mobileservices/MobileServices.Web-1.2.5.min.jsWhat is wrong?
    Regards

    I see. Now works. So it would be like doing "SELECT ITEM,CATEGORY,COUNTRY, FROM TABLE WHERE CATEGORY='toy' AND COUNTRY='US'"
    All rows will contain the "CATEGORY" and "COUNTRY" fields (or more), which is kind of redundant and bandwidth consuming.
    Hope MS can change this.
    Regards

  • Error: Metadata of component EquipmentShipment is not valid!

    Hello all,
    I have created one webdynpro DC -A which has two DCs as used DC- B & C.
    Now everything builds & runs fine on local server. but when I activate DC "A" gives build errors, as it does not get reference for DC -B.
    Here is the error:
    "Error: Metadata of component EquipmentShipment is not valid! "Role "UsedComponent": A minimum of 1 object(s) is required!" "
    This error is only for "B" not "C"
    I tried rebuild, resync, recreate the dependency through public part but no use.
    Could you please help me with this issue?
    Thanks in advance!
    Regards,
    Sarika.

    Hi Sarika,
    Generally these type of errors occur due to broken DCs. Check DC build for 'B'. You may find more accurate information in the build report. I too faced similar issue once then the problem was some of the RFC changes were not imported. Check whether it is also same case for you.
    If it is a  wd-gen error, try to remove wdgen and gen folders for DC-B and build & try.
    Still you have problem, check this [thread |Re: Local DC problems;whether it can help you.
    Regards,
    Siva

  • HT1918 I purchased Iphone in London. Then i shifted to India after 1 yr and now i want to change the account info. But when i tried to change the credit card details in itunes, i get an error message that this card is not valid in UK.

    I purchased iphone in London one year back. Then i shifted to India recently. Now when i want to change my credit card detail in itunes, i get an error message that This card is not valid in UK. But i am no more in UK now. In the same page i edited my address but itunes does not change that details showing the above error message.

    So you are trying to change the account from India to the Uk right...? Cause it wont accept UK card if you're trying to keep it for India...

  • I'm installing PS CS5 Exteneded on my new laptop. I get an error saying the serial number is not valid for this product. Help!

    I'm installing PS CS5 Exteneded on my new laptop. I get an error saying the serial number is not valid for this product. Help!

    If you purchased it from Adobe, it is registered and that would prove ownership as well as the emaill they sent with the serial number.
    https://www.adobe.com/account/my-products-services.html#MyProductsHeader
    Sign in with the email and password that you bought it under.
    Click on the triangle next to your product and you will see the serial number assigned to you.
    You have a valid record and proof of ownership. Try again.
    Gene

  • Error : This balancing segment value is not valid for the current ledger

    Dear friend,
    Error : This balancing segment value is not valid for the current ledger.
    when I click Account Assignment in Budget Organization.
    I used R12
    Thank you
    Best regards,
    Hareyuya, Junior.

    Hi,
    Please see these documents.
    Note: 756765.1 - Cannot Use Parent Balancing Segment Values In Massbudget or MassAllocation Formula
    Note: 790339.1 - Cannot Select Parent Values In Mass Budgets
    Note: 437588.1 - Rel 12: Balancing Segment Value Is Not Valid For Current Ledger
    Regards,
    Hussein

  • Order status ORRQ is active error when setting deletion flag

    Hi all.
    We couldn't able to set deletion flag in production order by the following error message
    System status ORRQ is active (ORD 1008458)
    This was caused due to order record required.So we tried to store thro T-code:COPA.But when accessing, No orders were found.
    Please guide to correct the error.
    Thanks
    Bhuvan

    Hi Bhuvan,
    Refer the below discussion and do accordingly.
    ORRQ&amp;nbsp; Status Process Order | SCN
    Thanks & Regards,
    Ramagiri

  • Fatal Error During Solution Center Install - "Key Not Valid for Specified State"

    I have encountered an error while trying to install HP Solution Center for my J6480 All-In-One.  The software I'm installing is "OJJ6400_Full_10.exe"
    I can get past the installation option selections (i.e., the screens that allow selection of which components you want installed) as well the online check for updates to the software.  However, shortly after that I get a fatal error the full text of which are:
    Error Situation Code: 23551631
    The following lines were retrieved from the installation error logs.
    Now Launching=X:\hpzmsi01.exe -m dot4wrp "-*"
    ".\autorun_network.inf" "-networkonly" -| XXX -f X:\DIVins??.DAT
    Error message received: Key not valid for use in specified state.
    X:\cioum32.msi failed with return code 1603
    MSIInstall() failed with 1603
    Exit code=1603
    Your help is appreciated.  Thanks.

    Hey @redleader74,
    At this time I am going to have you unlock the hidden System Administrator Account and attempt an install under there. Ideally, if everything installs fine you should be able to log back into your normal User Account and the complete software and driver package for your HP Officejet J6480 All-in-One Printer will be installed and functional. Can I please have you follow the steps below.
    Step 1: Uninstall Drivers:
    Click on your Start menu
    Select All Programs
    Select the HP folder
    Select your HP Officejet
    Select Uninstall
    Please follow any onscreen prompts to complete the uninstall. Once the uninstall is complete please proceed to the next step.
    Step 2: Clear Temp Files:
    Click on your Start menu
    In the 'search programs and files' box located right above Start after you click on it, type %temp% and hit enter on your keyboard
    When the Temp folder opens, select Ctrl + A at the same time on your keyboard. Everything in this folder will now highlight.
    Select the 'delete' button on your keyboard. The Temp folder contains temporary internet files. No actual files or folders on your computer will be affected by deleting the Temp files. Should a Temp file still be used than you will automatically get the pop up to 'skip' that item.
    Close the Temp folder once it is emptied
    Right click the Recycling Bin on your desktop and select Empty Recycling Bin
    Step 3: Unlock System Administrator Account:
    Click on your Start menu and under the 'search programs and files' box type CMD
    CMD will populate as a search option above, just right click on it and 'run as administrator'
    Once CMD (Command Prompt) opens, type net user administrator /active:yes and hit enter
    Next, close CMD and restart your computer
    When your computer comes on log into the new Account that should show. It will be called Administrator and will not have a password on it.
    If your computer automatically logs into your account after restart than go to your start menu click the arrow beside 'shutdown' and choose 'switch user'. Now log into the Administrator Account we just unlocked
    Step 4: Install Device:
    Under the Administrator Account please click here to download the latest drivers for your printer.
    Once the website opens select the Download button on the top left
    Once the download is complete please follow the onscreen instructions to install your printer
    Once the installation is complete, please test the functions of your HP Officejet to ensure that everything is functioning properly now. If everything installs fine, log out of the Administrator Account and back into your normal User Account. All the Software and Drivers for your product should show installed now on your Account. Once you're logged into your User Account please test your HP Officejet again to verify that your print and scan functions are still working.
    If everything works fine, you will want to Hide the Administrator Account.
    Go to your Start menu and under the 'search programs and files' box type CMD
    CMD will populate as a search option above, just right click on it and 'run as administrator'
    Once CMD (Command Prompt) opens, type net user administrator /active:no and hit enter
    Next, close CMD and restart your computer
    Please let me know if these steps resolve your issue. Good luck!
    X-23
    I work on behalf of HP
    Please click "Accept as Solution" if you feel my post solved your issue, it will help others find the solution.
    Click the "Kudos, Thumbs Up" on the right to say "Thanks" for helping!

  • Get-ChildItem with -LiteralPath is throwing "The specified wildcard character pattern is not valid" when filenames contain brackets

    I'm trying to get a list of folders in a hierarchy that don't contain any mp3 files. (The goal here is to eventually clean up all the "empty" folders that only have album art, thumbs.db, desktop.ini, etc. files left). So I wrote a quick PowerShell
    command to try to do this. But it doesn't seem to be working.
    I already checked out this thread <Get-ChildItem
    SomeFile[].txt occurs error because of the [brackets]: "specified wildcard pattern not valid"> and I think I'm using LiteralPath correctly. Any other hints for troubleshooting this problem? Here's the command I'm using.
    Get-ChildItem -Recurse -Directory | ?{
    @( @(Get-ChildItem -LiteralPath $_.FullName -Recurse) | ?{
    $_.Extension -eq ".mp3"}).Count -eq 0 }
    This is on the latest version of PowerShell found in Windows Technical Preview.

    Fair enough, but it still doesn't answer the original question- why isn't this working with -LiteralPath when the path contains brackets? 
    Get-ChildItem -Recurse -Directory | ?{
    @( @(Get-ChildItem -LiteralPath $_.FullName -Recurse) | ?{
    $_.Extension -eq ".mp3"}).Count -eq 0 }
    Thanks,
    Ben

Maybe you are looking for