Building hash based on IMAP message headers to maintain uniqueness

This is more of a general java question than Javamail but since it has relevance to IMAP, i thought of posting it here. Basically, I discovered it hard way that the IMAP server that I am working with (MS Exchange) isn't returning unique UID for the same message (for the same UIDVALIDITY on the folder). Under certain condition it simply purges the old message, creates a new message with a new UID (for example when read status on a message is changed, rather than changing the flag status, it purges the existing one and creates a new one with a new UID). I don't want to fight with Microsoft over this as all my previous attempts at pointing their errors have gone in vein.
Given this, I want to build a hash out of all the message headers and probably the internal date. This i know will guarantee uniquness in majority of the cases. The question is how do I do that. Is doing an MD5 on all the headers the best way to go about it? Will i run into a hash collision type situation with this?

Thanks bill. What's apparently happening in our exchange envrionment is that we have let's say a client A that deposits the message in Exchange store over MAPI. That client can create new message or change flags on existing, change priority and do all kinds of the stuff. When that client does whatever it does over MAPI, exchange somehow decides to flush the old message and create a new message even though the change was merely an update. I've confirmed with client A that they aren't doing anything unusual, its just that Exchange decides to do it their way. They actually are not violating the IMAP protocol either coz all they are doing is flushing the old message and creating a new one. My outlook client connected over IMAP handles this just fine in that as an end-user you don't see a delete followed by an add and hence i am assuming they must use something along the lines that I am planning on doing.
Totally agree that not using UID is going to be expensive but they haven't left me with any choice.

Similar Messages

  • N79 - IMAP retrieves headers only ???

    Hello everyone,
    i'm having a strange problem .When i try to retrieve full email message content through my IMAP server in the organization where i work, i do not get anything but the same listing of emails from IMAP. Even in the Settings menu of the phone's mail client, only "Headers only" option is chechked. There is no option to retrieve it fully, or to access email content as if it was standard webmail access.
    POP3 settings work ok, i got full emails through a separate email inbox, but IMAP is "Headers only", and nothing else.
    Thank you for helping,
    V.   

    Something like this:import javax.mail.search.*;
    SearchTerm new = new FlagTerm(new Flags(Flags.Flag.SEEN), false);
    Message[] msgs = folder.search(new);I haven't tried this particular search term myself but I've used others and they do cut down the time to extract messages from a folder.

  • Mac Mail move IMAP message to Exchange Folder

    SOMEONE PLEASE TELL ME THERE IS AN ANSWER OUT THERE!!!!???
    I have most of my email accounts set up in Mac Mail (Hotmail, Gmail, Yahoo, Exchange (office365 hosted)).
    When I try to move any of my messages from the first 3 accounts (all IMAP) to the Exchange folder I get the error "can't move...message".
    How the heck are people copying/moving IMAP messages to exchange folders in Mac Mail????????????

    No insight whatsoever?

  • Mail constantly re-downloads thousands of IMAP messages

    On my laptop, I have nine IMAP accounts set up. Many of them are very old and have tens of thousands of messages stored in many folders.
    Mail.app is caching them locally, but frequently it seems to feel the need to re-download many thousands of them. The Mail Activity panel always shows things like "Incoming messages: 4507 of 10833, 53 KB/s".
    If I look at the activity window, it is synchronizing IMAP folders ... and the folders it is synchronizing haven't changed in over two years: I have stopped storing new messages in them. So it should already be synced, and Mail.app shouldn't have to download new messages anymore. But it re-downloads them often. Not every time I open mail, but at least a few times per week.
    I don't think the problem is with the folders on the server, because (1) I don't see this doesn't happen on my Mac Pro desktop, and they use the same mail accounts, (2) They are gmail accounts, which I'd assume Google configures intelligently. Though, the desktop is on all the time and Mail is always open, so maybe it does re-download them frequently but I don't notice.
    It's very annoying because it pegs my processor at 100% for about 20 minutes every time it happens, which is often. Slows down the machine and heats it up enough to burn my lap in just a few minutes!
    Any thoughts on how to get Mail.app to be sane about syncing local copies of remote IMAP messages? This is ridiculous.

    https://discussions.apple.com/thread/4045156
    http://support.apple.com/kb/HT4863
    http://support.apple.com/kb/TS3276
    http://support.apple.com/kb/PH8200
    Maybe some of these might help,  hope. I had as imilar issue, I deleted my mail and recreated it.

  • Export release build failed with an error message: complilation failed while excuting : compile-abc

    I updated air sdk from 4.0 to 16.0 beta to fix apple app store submitting bug. I can build the project and run it on simulator without any problem.  But when I tried to export the ios release build, I got this error message: complilation failed while excuting : compile-abc. 
    I use commmand line to excute compile-abc.exe with the parameters that adt gives it, but it failed without any error message.
    Here is the command line:
    compile-abc.exe -mtriple=armv7-apple-ios -filetype=obj -sdk "C:\Program Files (x86)\Adobe\Adobe Flash Builder 4.5\sdks\4.5.1 - air16\lib\aot/lib/avmglue.abc" -fields "C:\Program Files (x86)\Adobe\Adobe Flash Builder 4.5\sdks\4.5.1 - air16\lib\aot/lib/air-fields.arm-air.txt" -O3 -abc-file-list=E:\MyApp\bin-debug\AOTBuildOutput8184169967790207636.tmp\ABCFilesList.txt
    There's a empty file AOTBuildOutput-0000001821_1821.o left in the command line workaroud path. I opened file AOTBuildOutput-0000001821.abc, but didn't get any clue. How can I trace this problem?

    Still having similar issues - seems to be when I embed an image - but works for every release except for release build
    Tried your work around but doesnt seem to make a different
    [Embed(source = "/../assets/[email protected]")]
    protected static const ATLAS_IMAGE:Class;
    [Embed(source = "/../assets/[email protected]", mimeType = "application/octet-stream")]
    protected static const ATLAS_XML:Class;
    [Embed(source = "/../assets/iconMap.png")]
    protected static const ATLAS_IMAGE_LOW_RES:Class;
    [Embed(source = "/../assets/iconMap.xml", mimeType = "application/octet-stream")]
    protected static const ATLAS_XML_LOW_RES:Class;
    if(Starling.current.viewPort.width > 320)
    atlas = new TextureAtlas(Texture.fromBitmap(new ATLAS_IMAGE(), false), XML(new ATLAS_XML()));   
    }else{
    atlas = new TextureAtlas(Texture.fromBitmap(new ATLAS_IMAGE_LOW_RES(), false), XML(new ATLAS_XML_LOW_RES()));

  • IMAP messages do not appear in viewer

    I am having a problem with two out of three IMAP mail accounts from a private server not displaying new IMAP messages in the viewer. The counter shows that the messages have arrived, and I can find and read them via the iPhone or webmail. If I quit mail and restart the program, the messages appear, another work around is that I have to rebuild the mailbox every time I want to see my messages. I running Mail version Version 4.1 (1076) and Mac OS X 10.6.1.
    Can someone explain what might be going on and how I can solve the problem

    Exactly the same problem here on my home and work computers. Work computer runs 10.5.8, home computer runs 10.6.1.
    Two IMAP accounts display messages sometimes, sometimes not.
    Hope somebody figures this out, extremely annoying.

  • Content based Routing Vs Message based Routing

    Hi friends,
    Can u plz differentiale Content based Routing and Message based Routing?

    Hi,
    Content based routing is when the receiver is determined based upon some value in message i.e for a field 'a' receiver is A but if its 'b' receiver is B.this is determined at runtime.
    While message based is normal routing
    Regards,

  • CCMS monitoring for SAPconnect based on Error Message Numbers

    Hi,
    We are trying to use the CCMS monitoring to produce alerts for SAPconnect based specific Error Message Numbers for emails for example, however the monitoring function or data collection method for SAPconnect (BCOMAL_SXDS) does not provide that level of granularity.  Has anybody faced this same problem and can provide a recommendation for this?
    Thanks,
    Javier

    Hello,
    You can see the message details in SE91.
    In FI, you can control the message number in OBA5. Normally message numbers are issued like this
    AA165
    First two digits (alpha) is called application area next digits are called message number.
    Sometimes, you may not be able to see the messages in OBA5, in such case you need to go to OBMSG transaction code and include the message number to your application area, then you need to come to back to OBA5 to make it information / warning / switch off / error (as the case may be)
    Regards,
    Ravi

  • How does one show full message headers in Mail 8.1? The previous 'complete header' option has been replaced with a time consuming 'custom' choice.

    How does one show full message headers in Mail 8.1?
    he previous 'complete header' option has been replaced with a time consuming 'custom' choice.

    Customize your toolbar in Mail and add the All Headers button:

  • Yosemite Mail - cannot see or erase deleted IMAP messages in unified inbox view

    Recently upgraded to Yosemite from last release of 10.7 and Mail isn't handling an IMAP account quite like I'm used to.
    In 10.7 I *used to*: Hit the delete key on an IMAP message or several messages while in unified inbox, those message(s) would turn grey, then I'd hit Shift-Cmd-Delete to erase/expunge permanently.
    *Now* in Yosemite: In unified inbox, I hit the delete key and the message instantly disappears from view (no grey status at all) on the Mac. On my iPhone I can see they're still there. I try Shift-Cmd-Delete to erase/expunge permanently and nothing happens. I look in that account's specific inbox, and *there* they show up, greyed out. And *there* I can Shift-Cmd-Delete to erase/expunge. Also, notably when you're in unified inbox, the View menu option to show/hide deleted messages is greyed out and unavailable to be selected.
    This just seems strange. It has turned (what I assume would be) a routine task for IMAP users from a couple keystrokes, to keystroke>navigate>click>keystroke. Is this a bug, known issue, intentional design? Know of any workarounds? Thank you!

    ps:
    dug deeper and have had a look in the /users/.../Library/Mail/V2 Folder (thanks osx for hiding "Library" again ) and found the two Folders of these two accounts in Question.
    It seems true - all Messages have been wiped of my drive. The only messages in there are the ones, retrieved this morning.
    There is no apparent reason to me, why a System update would want to touch downloaded messages at all. I consider this quite a bug.

  • Hash-based collections vs. mutable hashcodes

    I've been getting ConcurrentModificationExceptions on HashTables (derivatives) in a single-threaded app that does no overt mods to the collection being iterated. The algorithm is a classic Observer, iterating all listeners on an event. These listeners are rather heavyweight classes with hashcode() (along with equals()) essentially calculating the current object internal state, which is mutable.
    What I think is going on is that during an event (iteration over the set) a listener state may change, resulting in a changed hashcode(). While this doesn't overtly modify the collection, it may modify something like the internal ordering. i.e. the "old" object would appear to have disappeared since it can no longer be resolved with its current hashcode. Can anyone confirm that this is indeed a possible phenomenon? If so, it raises an interesting general issue.
    Should hashcode() and equals() be built on an immutable subset of state? Assuming logical identity is desirable (i.e. state matters to equality), and hashcode should reflect the result of equals (re: Josh Bloch in EJ (2nd) Item# 8), this seems to dictate that such objects are not viable elements of a hash-based collection. Discussion?

    jverd wrote:
    796912 wrote:
    Should hashcode() and equals() be built on an immutable subset of state? hashCode() should, yes. Or, if it's mutable, then when using a hash-based collection you have to remove and re-add after a change, or possibly remove, change, re-add. Additionally, there's the iteration gotcha that you found that prompted this thread.you definitely have to remove before you change, otherwise remove won't work.
    equals() shouldn't matter. Changing an object's hash can change which bucket it's in, and that's why things get screwed up. The equals() comparison comes into play when doing a linear search of that bucket, so changing state that contributes to equals won't hurt that. not entirely true. changing equals could change the validity of the uniqueness of the set. if you change the equals criteria of an object already in the set so that it is now equal to another object in the set, the set is no longer valid. while this may not break quite as spectacularly as changing the hashcode, it can still do interesting things. for instance, if you add another element such that the hashmap decides to re-hash, one of your now duplicate elements will be silently dropped on the floor. long answer short, don't change hashcode or equals.
    However, in a SortedSet or SortedMap, changing state that contributes to equals() could lead to problems, so the same remove/re-add rules would apply.nope, sorted collections don't use hashcode or equals, they use compareTo/compare. but, the same rules certainly apply to the comparison criteria for the given sorted collection.

  • New IMAP messages don't show as "unread" in Lion

    I recall fixing this problem in Leopard, but I can't remember how I did it.
    I read my email on three devices (iMac, iPad 1, iPhone 3G). Since I upgraded the iMac to Lion, I've found that Mail frequently, but not always, retrieves new IMAP messages, but they don't appear as unread (i.e., no blue dot). Consequently, they're easy to miss, and the Dock icon badge doesn't show the new count, either.
    Suggestions?

    Mail Preferences > Viewing > Display unread messages with bold font.
    On the top of the same preferences page is the option to use classic layout i.e. SL.
    Mail Preferences  > General  > Make sure that Dock unread count is selected.
    S.

  • Displaying full message headers

    I'm trying to debug a BlackBerry-specific email issue and I need to be able to display full message headers in a BlackBerry to be able to do. My searching around the net has only dug up two or three folks saying it's not possible. Is this true? If not, how do I do it? I've been through every option screen I can find.

    starman7 wrote:
    Any way to see in Convergence?Right click email to get context menu => Other... => "Display Full Headers".
    Regards,
    Shane.

  • Microsoft Virtual Academy - Building Linux-Based Solutions on Azure, Jump Start

    Building Linux-Based Solutions on Azure Jump StartJuly 14, 2015 9am‒1pm PDT4pm-8pm GMT (5pm-9pm UK BST)
    Do you run an open-source infrastructure? Want a public cloud solution that fits your environment? Join Senior Technical Evangelist Rick Claus and four engineers from the Azure Compute team for this live event, and see how easy and efficient it is to build Linux-based solutions on Microsoft Azure. (In fact, 20% of virtual machines that run on Azure run Linux!)
    Explore options you can use to build, deploy, and manage your Linux infrastructure on Azure. Learn how they work and how to support, build, and scale them, along with how to make them available to Devs. See technical demos, and examine open-source tools, such as Docker containers, to manage DevOps pipelines on Azure and to dramatically increase productivity. Plus, walk through...
    This topic first appeared in the Spiceworks Community

    This is the second Flash Player zero-day in a week and cyber-criminals are going to once again capitalize on it.Categories: ExploitsTags: 0dayFlash Playerhacking teamzero dayzeroday(Read more...)
    Read More

  • Email Message Headers

    Hi,
    I'm trying to track bounced emails using a custom header when I send them.
    When I try to retrieve the bounced messages using POP3 I am unable to access the header information, even though I can see it in the message properties in Outlook.
    Does anyone know a way to retrieve all the message headers in an email, or how to access the message properties as seen in Outlook?
    Thanks,
    Kevin.

    If the server is working the way it is supposed to (and if I remember my RFC's correctly) the original message, including the headers, are in the body of the bounced message. The bounce message is a completely new message that was constructed with parts of the originals headers but does not have all the information. You'll have to write some kind of regular expression to pull the content out.

Maybe you are looking for