Mailkit - fetch & search not returning new mails after a while - powershell

For some time I was using an IMAP-subscribe/event MailKit based solution to gather & identify new mails which worked reliably. Suddenly a strange behaviour appeared: the first few events were fired but then MailKit seemed not to receive any new CountChanged events - even though the connection remained online.
So I tried to switch to a simple sleep-60 loop that fetches all mails in the inbox which worked - for some iterations. After a few minutes the fetch command did not return new mails anymore. The system behaves like there is a cache that is not updated after a while so MailKit always receives the same results - for both, event-based as well as polling-fetch/search methodology. I do not know whether there have been changes to the Exchange system.
Does anyone have a clue what the reason for this behaviour could be or in what directions I continue my investigations?
MailKit 2.1.3.0, Exchange version couldn't be determined

Related

Outlook Application wont send mails every second instance

I know I should probably ask MS about this, but I dont know if I trust their communication tools to get me a satisfying answer.
I have recently taken the task to test an application of mine.
Part of this test is to send an e-mail to it, then log in and see if I get the result I want (this is automated)
For this the process is:
Open Outlook -> Send Mail
Close Outlook
Open App -> Check result
Open Outlook -> Send Mail
Close Outlook
But for some reason, every second time the outlook app is opened, (including manually opening the app to check on configurations etc.) Mails will go to the outbox but will not be sent, unless I manually trigger them to.
Now, there are possible solutions like keeping the app running continously, or telling my testing-suite to press F9 after every sent mail, but I want to tackle the root cause, and fix the underlying problem.
The Outlook Version used is the latest Version of Office 365 Outlook.
Has anyone else had this experience and figured out a fix?
Thank you in advance.
Keep in mind that message submission is an asynchronous process, so if you close Outlook while it is still sending, the message might end up stuck in the Outbox.
You can call Namespace.SendAndReceive to force submission, but it is still asynchronous. You can hook into the SyncObject.SyncEnd event on the first (All Accounts) SyncObject from the Namespace.SyncObjects collection and quite only after that event fires.
Since this problem occured on a machine I do not own, I tried avoiding certain easy troubleshooting steps. After I couldnt find an answer on my own, and I didnt get responses here that would've helped me solve this without a wooden hammer method, I asked for permission to issue a repair to the local office 365 suite.
After the repair it had redownloaded and installed the entirety of office 365.
After connecting my company MS account to outlook, the issue no longer appeared.
I guess this counts as solving this issue.

How to read Desktop Notifications in Powershell

My goal is to write a powershell script that runs every n seconds, reads through any notifications on my Windows 10 home edition desktop that have been sent since the last run, and then send me emails if certain notifications have occurred. I can handle the scripting and task scheduler piece, I'm just having trouble finding the powershell way to check my Desktop notification queue.
This is the only post I could dig up on the subject and it remains unanswered https://powershell.org/forums/topic/get-notifications/. Most other posts I find are focused on generating notifications from powershell and not reading them. I also haven't been able to find anything that looks correct in the API docs either. Any help would be greatly appreciated!

OpenPop and Web Beacons error with GetMessages

Has anyone working with OpenPop get errors when the emails being processed have web beacons in them? I have two services that process inboxs, extracting attachments, and creates blobs for processing, but whenever an email that has a web beacon (code to single back to the mothership) the openPop dies on GetMessages. If I forward the message right back to the same mailbox, the forward removes the web beacon and all is well.
We had to setup an OWA rule that detects messages, for example from quickbooks#notification.intuit.com and forwards them right back to the same inbox. This automatically cleans out the web beacon, but the sender is no longer known and we cannot notify them and let them know we received their invoice.
Not sure how to get rid of the web beacons, but retain the sender.
Any help appreciated.
Here is where it dies, and what the error is:
Errors I trap
1/3/2017 7:47 PM: ProcessAllMessages - GetAllMessages Exception - Length cannot be less than zero.
Parameter name: length
1/3/2017 7:47 PM: ProcessAllMessages - Retrieved 0 out of 1 email(s) successfully.
We had to move off of the OpenPop as it appears there were just some core issues handling certain mime types that came in by email. Since no one can control devices, email clients of email senders we needed a more robust solution that handled exceptions rather than quit at an exception.
We migrated/rewrote using exchange web services
https://msdn.microsoft.com/en-us/library/office/dn567668.aspx
it was pretty easy to migrate the code as we only had to change connections and a few basic objects. The majority of the framework we had written was not changed at all.

Parse-server Not sending Push Notification to large Audience

All push notifications with reciever with less counts sends properly but large audience push notifications get stuck at Sending and count also does not get updated.Since it is live application i am not able to send push notification with such large audience..Any idea how to debug and why is it stucked ??? All other notifications are sending and recieveing normally but large audience isnt. Its just stuck at Sending
After Debugging found out that when i call other query results are returned properly but this specific query does not returns anything...
RestQuery.prototype.runFind in RestQuery.js
does not call function with results..
And it is always stuck there.
Running the same query in mongo shell does not take more than 0.4 seconds but is always stuck in parse-server
Plus Sometimes other queries also show lost connection to mongo.
Shouldnt Parse-server handle indexing itself.
Thanks in advance.
Not sure if this is your issue, but as far as Parse Server 2.2.17 goes, there is a bug with the cloud code. Cloud code is having trouble working properly and they advise to roll back to 2.2.16.

How to test MAPI Send Email errors

We have a program written in Delphi that can send emails via simple MAPI
for the people that use MAPI with outlook installed 95% of the time it works fine
but for the 5% of people that it doesn't just work for is there anyway to Test MAPIlooking for something where we can find if there is an issue with our program or if its something that their hardware guy needs to fix.Would be good if its some Microsoft tool or something official so if we go to the clients hardware/IT guy and say test this he will trust the results of the test
some errors we have come across include
api-ms-win-crt-runtime-l1-1-0.dll is missing from your computer. Try reinstalling the program to fix this problem.
Access violation only for one contact in the outlook address book - happened when calling the MAPIResolveName (no solution found for this - client didnt want to reinstall outlook)
Mapi error 26 for Office build version 1703 - first email goes through ok but they all fail after that. (You can make a work around by using the MapiLogOn and pass the session handle through in the MAPISendMail call)
Either there is no default mail client or the current mail client cannot fulfill the messaging request