URN Filter to Ignore Emails - sql

I am using UiPath's Get Outlook Mail Messages component to obtain emails.
My only request has been to ignore any emails that are Replies, so contain "RE:"
In my email filters I had tried the below:
#SQL=urn:schemas:httpmail:subject NOT LIKE 'RE%'
Unfortunately, I receive the error "Get Outlook Mail Messages: Cannot parse condition. Error at "#SQL=((urn:schemas:httpmail:subject NOT ...".
When I try the filter: `
#SQL=urn:schemas:httpmail:subject LIKE 'RE%'
I am able to obtain all emails that contain 'RE:' but as specified, I want to omit these.
Would anyone be able to advise how to Omit these emails? I need to obtain every other email in the Inbox so makes more sense to just ignore the Replies.
Thanks,

Your code is very close to being correct. The NOT keyword does work, just the placement is incorrect, unlike normal SQL where the NOT would be before the LIKE, in this case it would come before the field name.
So rather than:
#SQL=urn:schemas:httpmail:subject NOT LIKE 'RE%'
It would be:
#SQL=NOT urn:schemas:httpmail:subject LIKE 'RE%'

Related

Postfix Header Checks

Good morning everyone, I'm trying to create a rule of changing the FROM header on sent email.
My need is to change the FROM of all the mails that come from a specific mailbox (software#domain.com) and that have in CC the mail of a specific store (store04#domain.com).
For Example the mail sent to SMTP Server will have as FROM:software#domain.com, as CC:store#domain.com and as TO: customer#company.com, the mail that will have to exit need to have header with FROM: store#domain.com and TO:customer#company.com only.
I already tested some rules in header checks config (/etc/postfix/header_checks) but without any working results.
Thanks in advance.
Something like the below might work:
if /^From: software#domain.com$/
/^From: software#domain.com$/ REPLACE From: store#domain.com
/^CC: store#domain.com$/ IGNORE
endif
I haven't tested this and I am by no means a Postfix expert, but from my reading of http://www.postfix.org/header_checks.5.html, I think I have got all you need.
Can't comment to Jacobs answer but want to add that http://www.postfix.org/header_checks.5.html states
Note: do not prepend whitespace to patterns inside if..endif.

Get The Latest Email From EWS

Can anyone help me, I need to retrieve only the very latest email in my exchange server inbox.
I don't need any other email to show up with the one I want.
But I'm stuck, since the farthest that I could get is only the email I received only today.
I use SearchFilter with DateTimeReceived :
Here's the snipped of my code for the filter :
Dim search As New SearchFilter.IsGreaterThanOrEqualTo(ItemSchema.DateTimeReceived, DateTime.Today.Date)
Thanks in advance.
Just sort your search results by the DateTimeReceived property, in descending order.
view.OrderBy.Add(ItemSchema.DateTimeReceived, SortDirection.Descending);
Then when you loop through the results, the first email will be the latest (and then you can jump out of the loop).

Mail Merge Specific Keywords

I was wondering if there is some way that mail merge specific keywords such as "Ask", "Fill-in", "If Then Else", etc are being handled in docx4j. Here is a full list of keywords that I'm looking to handle in the code.
https://support.office.com/en-us/article/Set-the-rules-for-a-mail-merge-d546ee7e-ab7a-4d6d-b488-41f9e4bd1409
These are all round tripped in docx4j's general operation.
However, none of them are handled specifically in docx4j's MailMerge processing code, with the exception of NEXT record.

Slack API - Don't notify user when parsing user id

In this message formatting doc: https://api.slack.com/docs/message-formatting, you can use special control sequence characters < and > to perform server-side parsing (server-side as in Slack API's server-side).
So using <#U024BE7LH> in your chat.postMessage() call will get parsed to something like #bob or whatever the username associated with that ID is, in the actual text that shows up in slack.
Unfortunately, this will cause a notification for the person you're referring to. How do I make it so that it doesn't notify the person? I've tried to enclose in a code block, i.e.:
`<#U024BE7LH>`
or
```
<#U024BE7LH>
```
But it still pings. I'm thinking the only way is to get a list of users and parse the name from the ID.
According to this, backticks should work but empirically it hasn't for me. The Slack employee says to just convert the user ID to their name and use that without the templating.
https://forums.slackcommunity.com/s/question/0D73a000005n0OXCAY/detail?language=en_US&fromEmail=1&s1oid=00Dj0000001q028&s1nid=0DB3a000000fxl3&s1uid=0053a00000Ry9cX&s1ext=0&emkind=chatterCommentNotification&emtm=1667894666436&emvtk=fH.W2M01lq9W1cf31RSROPwB7LYs.och8RgbVTqoNlg%3D&t=1667931570045

EWS SearchFilter.ContainsSubstring to filter on Sender Email Address

I'm trying to filter emails on Exchange Web Services using SearchFilter.ContainsSubstring as follows:
sfilter = New SearchFilter.ContainsSubstring(EmailMessageSchema.Sender, EmailAddress, ContainmentMode.Substring, ComparisonMode.IgnoreCase)
MailItems = service.FindItems(Folder.Id, sfilter, view)
Unfortunately this doesn't work, and I don't want to use Queries, because I can't guarantee that I can use features of Exchange Server 2013.
Composing a variety of requests in Fiddler, I can observe that if I remove the last character of the email address, then the filter works, remove the first character instead, works - put them back, broken.
So perhaps it's pedantic, and it has to be a true substring to qualify, so if I change the Containment mode to FullString - it doesn't work, so I can't do anything like a collection with Substring OR FullString.
It looks like I'll be able to do (Substring with last char missing AND Substring with first char missing), but it surely can't be that broken can it?
What can I do to get this to work?
Note that my code is in VB.NET, but I can't imagine that this is the problem.
Cheers,
Mark
I worked out that the IsEqualTo filter works with From/Sender, and it doesn't care about case-sensitivity issues, so it's probably what I should have tried to begin with.
The code to match an email address is:
sfilter = New SearchFilter.IsEqualTo(EmailMessageSchema.From, New EmailAddress(Message.FromAddress))
MailItems = service.FindItems(FailureFolder.Id, sfilter, iv)
I still don't know how to find all emails from users at the same domain though.
More Info:
I really needed to filter by Sender Domain and did that by pulling the entire folder contents down and filtering in .Net code. Even that causes problems.
Basically to keep things quick and tight, I tried to pull all the data with a PropertySet:
New PropertySet(BasePropertySet.IdOnly, EmailMessageSchema.Sender)
Filtering still didn't work, yet email addresses still showed in my list of items view. Well it turns out that the value of Message.Sender contains some kind of ActiveDirecty path in it until you call LoadPropertiesForItems. After LoadPropertiesForItems, it's an email address.
Note that my earlier attempt to filter at the server was scuppered because filtering would have to occur against the ActiveDirectory path style of string.
This is all highly confusing, and not at all user friendly.
If anybody has any idea on how to filter by email domain at the server, let me know!
Mark
What is your goal? Sender isn't a string property, so I'm not surprised that the results are odd with ContainsSubstring. I tried it against Office 365 and it worked, but older versions of Exchange may not be as "smart" about handling this kind of query. Depending on what you're trying to achieve, there may be a better filter.
if(emailSenderList.size() == 1) {
return new SearchFilter.IsEqualTo(EmailMessageSchema.From, emailSenderList.get(0));
}
return new SearchFilter.SearchFilterCollection(LogicalOperator.Or, emailSenderList.stream().map(em -> new SearchFilter.IsEqualTo(EmailMessageSchema.From, em)).toArray(SearchFilter.IsEqualTo[] :: new));