Thunderbird message filter misses messages when automatically run but works when manually run - thunderbird

I have defined several message filters. They are all enabled and each filter has the property Getting new mail and Manually run for "Apply filter when" set to active.
Sometimes some mails that should be filtered still land in the inbox. When I then run all filters manually on the inbox the filters are applied correctly.
How can it be that sometimes for some messages I have to run the filters manually when it should do it when getting the mail?

Related

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

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

How to get mail when a program test is failed in Coded UI test with Microsof Visual Studio?

I've created many test cases. I want to be emailed by MSV when coded ui test failed. I tried SMPT format but I dont know how to write true code for it. I mean I can send an e mail myself but it doesnt depend on whether test is fail or not. How can I?
Thanks yo!
Since you have so many test cases, are you expecting mail for each and every failed scenario individually or all failed scenarios as a whole (one time email) at the end of the test run?
If you want to send mail for all failed scenarios individually then follow below steps.
Under TestCleanup check the UnitTestOutcome.Failed is true or not.
If it is true it means that a particular test method failed.
Based on this under this condition you can send a mail from here.
If you need a single mail then store all failed information in any format you want and in AssemblyCleanup you can keep the mail code so that it executes at the end of all the test.
Note having screenshots and Exception inside the mail is related to how you are handling reports in your projects. This is just an idea for you questions.

Azure WebJob Logging/Emailing

I've converted a console app into a scheduled WebJob. All is working well, but I'm having a little trouble figuring out how to accomplish the error logging/emailing I'd like to have.
1.) I am using Console.WriteLine and Console.Error.WriteLine to create log messages. I see these displayed in the portal when I go to WebJob Run Details. Is there any way to have these logs saved to files somewhere? I added my storage account connection string as AzureWebJobsDashboard and AzureWebJobsStorage. But this appears to have just created an "azure-webjobs-dashboard" blob container that only has a "version" file in it.
2.) Is there a way to get line numbers to show up for exceptions in the WebJob log?
3.) What is the best way to send emails from within the WebJob console app? For example, if a certain condition occurs, I may want to have it send me and/or someone else (depending on what the condition is) an email along with logging the condition using Console.WriteLine or Console.Error.WriteLine. I've seen info on triggering emails via a queue or triggering emails on job failure, but what is the best way to just send an email directly in your console app code when it's running as a WebJob?
How is your job being scheduled? It sounds like you're using the WebJobs SDK - are you using the TimerTrigger for scheduling (from the Extensions library)? That extensions library also contains a new SendGrid binding that you can use to send emails from your job functions. We plan on expanding on that to also facilitate failure notifications like you describe, but it's not there yet. Nothing stops you from building something yourself however, using the new JobHostConfiguration.Tracing.Trace to plug in your own TraceWriter that you can use to catch errors/warnings and act as you see fit. All of this is in the beta1 pre-release.
Using that approach of plugging in a custom TraceWriter, I've been thinking of writing one that allows you to specify an error threshold/sliding window, and if the error rate exceeds, an email or other notification will be sent. All the pieces are there for this, just haven't done it yet :)
Regarding logging, the job logs (including your Console.WriteLines) are actually written to disk in your Web App (details here). You should be able to see them if you browse your site log directory. However, if you're using the SDK and Dashboard, you can also use the TextWriter/TraceWriter bindings for logging. These logs will be written to your storage account and will show up in the Dashboard Functions page per invocation. Here's an example.
Logs to files: You can use a custom TraceWriter https://gist.github.com/aaronhoffman/3e319cf519eb8bf76c8f3e4fa6f1b4ae
Exception Stack Trace Line Numbers: You will need to make sure your project is built with debug info set to "full" (more info http://aaron-hoffman.blogspot.com/2016/07/get-line-numbers-in-exception-stack.html)
SendGrid, Amazon Simple Email Service (SES), etc.

How to hook 'send email' of IBM Lotus Notes

I'm working on a plugin for IBM Lotus Notes. I need to change content of an email right after user clicks 'send email' button, before the email is actually sent. I have searched APIs of Lotus Notes but can't find a workaround. There is a library named com.ibm.notes.mailsend in folder /opt/ibm/lotus/notes/framework/shared/eclipse/plugins. But I can't find any document related to it on Internet, and have no idea how to capture event about sending email. Does anyone know how to implement the function that I need? Thanks.
Update: Thanks Richard. Basically I've figured out how to hook email sending. But I also need to make an option that user can set differently for each individual email. From my understanding, email known as message is stored in Mail File database before being sent. How to 'add flag' to the message? Thanks.
The way to hook events in Lotus Notes is with the Notes C API's Extension Manager routines. The general strategy for hooking mail send operations is to set up a hook on EM_NSFNoteUpdateMailbox. This can be done on either the Notes client or the Domino Server. On the server side, if your processing is non-trivial, you run the risk of slowing down Domino if you try to do all of the work in your hook, so the strategy most people adopt is to have the hook code change the status of the message to "On Hold" and then signal a separate server task to take over the work. That way the hook can return and the separate server task can take whatever time is needed before resetting the status of the message so that normal routing will take over. You can find documentation here.
For server-side processing only, there are two options that will allow you to write your code in Java instead of C. One is an OpenNTF project called TriggerHappy that allows you to write Java Agents that are fired when some boilerplate hook code is triggered, and the other is the OpenNTF version of the Domino OSGi Tasklet Service (aka DOTS), which allows taskets to be fired in response to EM events. Note that there is an IBM-supported version of DOTS that is shipped in Domino 9 "Social Edition", but my understanding is that it does not include the EM event support.
Updated for additional info requested...
In order to add a flag to each message that can be read by the code that runs in your hook, you need to modify the mail template that is used in the users' mail files. You will need permission from the Domino system administrators to do this, and to be blunt: this is not something that Domino adminisrators like to do because it makes their job more difficult when they are upgrading Domino versions. There are many ways you could modify the template, but the point of all of them would be to add a new hidden field to messages which would serve as a flag for your hook code. If the field exists, your code would do the changes to the content that you need, otherwise it would leave the content alone. One possible way to do this would be by adding a shared action containing a formula to set your hidden field (that formula is just something like FIELD myFlagFieldName := "1";) and then you can add that shared action to the Memo form. Users would press the action button any time they want to trigger your code. The admin would need to maintain backup database containing your shared action and re-add it to the mail template after every upgrade and then re-add it to the new template version's Memo form. Of course there are other ways as well, some that are more friendly to users but harder for admins to deal with, and vice versa.

NLog Email Target with High Priorty/Importance

I've recently changed the Email Target log level up one level from Error to Warn. This is to capture some important user actions which aren't Errors on an application level but user input errors, which I don't class as errors so have logged them as Warn.
So in my subject I've changed
subject="NLog Error Message from PoppyService on ${machinename}"
to
subject="NLog ${level} Message from PoppyService on ${machinename}"
so I get a different subject based on the log level, but is there a way to make the email High Importance for Error log level only? I imagine, I'll have to create a second mail target, one for Error and one for Warn, but I can't find how to change the priority of the email to High.
There isn't a way shown in http://nlog-project.org/wiki/Mail_target.
Unfortunately there are no way to do this in the current version of NLog, without creating a custom target.