Chilkat: How to check for respones to a given email - Original-Envelope-Id - chilkat-email

I have MESSAGE-ID from email which I send.
How to filter email in IMAP "all mailboxes" to fined email which are response to my MESSAGE-ID .
Currently I know that in response I need to look for "Original-Envelope-Id".
But how to do this with Chilkat ?
Do I need to use $imap.Search(....)
https://www.chilkatsoft.com/refdoc/csImapRef.html#method70
?
With:
UID
Messages with unique identifiers corresponding to the specified
unique identifier set. Sequence set ranges are permitted.
?
btw.
I already check this example
https://www.example-code.com/powershell/imap_search.asp
But he is not related to search for email response.

Chilkat is passing the search criteria string to the IMAP server unmodified. Therefore, it's really just a matter of understanding the IMAP specification for search criteria as documented in RFC 3501 here: https://www.rfc-editor.org/rfc/rfc3501#section-6.4.4
If you look at the RFC, this is the way to specify a search for a particular header field:
HEADER <field-name> <string>
Messages that have a header with the specified field-name (as
defined in [RFC-2822]) and that contains the specified string
in the text of the header (what comes after the colon). If the
string to search is zero-length, this matches all messages that
have a header line with the specified field-name regardless of
the contents.
However.. my experience is that most IMAP server implementations don't implement all possible SEARCH criteria options.

Related

Microsoft graph API - empty bccRecipients list

This is the Scenario:
In the same Azure tenant, I used one account (user_1_address) to send emails to the other account (user_2_address) using outlook (o365).
I sent 3 emails, one where user_2_address is BCCed, one CCed, and one when it's the TO recipient.
I'm using Microsoft graph API to get a list of emails received by user_2_address in a specific time range, using this query:
https://graph.microsoft.com/v1.0/users/{<user_2_id>}/messages?$filter=
receivedDateTime ge <some date> and receivedDateTime lt <some other date>
and isDraft eq false
and sender/emailAddress/address ne '<user_2_address>'
I'm getting all the three emails user_2_address had received from user_1_address. But in the email user_2 was BCCed the bccRecipients list is empty, when it should contain user_2_address :(
I have seen this question about sending an email from Gmail and BCC an outlook user:
Microsoft graph API: empty BCC field
In that case, also the bccRecipients list was empty, but it was resolved by saying the BCC is removed when sending the emails from an external source (Gmail in that case). When for me it's not an external source - both users are using outlook in the same tenant.
So my questions are:
Is it the desired behaviour, or is it a bug?
Now, let's say I'm using the query above where I get all emails where the sender is not the user_2_address and it's not a draft. Can I assume that every email I get where user_2_address is not in the ccRecipients and toRecipients lists - that email was BCCed to user_2_address?
Thanks!
The bcc field in a Message is an envelope (P1) recipient only so you should always expect that it will be blank (no matter the context inside a tenant really make no difference). Like the other post referenced if it wasn't blank it would break the RFC and the purpose of a BCC, the only exception is the sent item (which is just a copy of the sent message)
No there are many scenarios that would break that particular logic eg forwarded email is one the comes to mind. You could certainly refine you result set that way, one thing you might want to examine is the X-MS-Exchange-Organization-Recipient-P2-Type: mail header that should get set in your internal to internal scenario (you need to look at the PidTagTransportMessageHeaders extended property to see it)

Filter Microsoft Graph List Messages API to only received messages

Goal: I'd like to be able to filter the "List Messages" API to only return emails that are sent to the user rather than any messages that exist anywhere (such as ones sent out by the user).
Right now, if you query this particular API, you get a list of all of the messages in all folders (including Deleted Items and Clutter folders).
I know that I can filter on isDraft eq false to remove the drafts - but I don't know if there's any filter to say don't include messages sent by the user.
What I've Tried: I've looked over the examples and didn't see anything about filtering like this. I've also taken a look at the OData Query Params and dug into the filter param. The problem is I'm not quite sure what I could even filter on. I do see that there is a sender parameter - but given I've connected via OAuth and haven't asked users to provide their email address I'm not sure I have an easy way to filter on that.
Theoretically, I could first do a request to the https://graph.microsoft.com/beta/me/ endpoint to get the userPrincipalName and then add a filter on from/emailAddress/address ne '<userPrincipalName>' when I call the /me/messages endpoint - but that's going to double the number of API calls I'd need to make. Is that the only option I have or is there a better way to go about this?
Thanks for your time :)
There is no filter parameter that will achieve this directly. If you want to filter away sent messages - you'll need to either decode the base64 encoded JWT access token and extract the userPrincipalName or make a call to the /me endpoint and retrieve the userPrincipalName from that. Once you have that, you can add a filter of from/emailAddress/address ne '<userPrincipalName>'.
Please note that if you are filtering on many things and you have an "order by" param that you'll need to include that param in your filter or you'll receive an error about too many filters.

Transmission api setting wrong To header when specify header_to with multiple recipients

I'm trying to send an email to multiple people(multiple to addresses) and have them all listed in the email clients like a regular email. When I set the header_to field on all recipients to email1#foo.com, email2#foo.com I end up with emails that have a to header set to "First Name" <email1#foo.com, email2#foo.com> which is incorrect.
This shows up as a single person with multiple email addresses in most clients and the header is wrong.
Why is the sparkpost transmission api messing with the header_to field? It's docs say that it uses this in place of generating a To header for you.
After going through every page of docs I could find to try and figure out how sparkpost's backend works I've found that you must omit the Name field on all recipients.
https://developers.sparkpost.com/api/recipient-lists/#header-recipient-object

Can Jmeter LDAP Request or LDAP Extended Request populate a multi-valued attribute?

I am working on a Jmeter LDAP test plan and the test plan has to populate an attribute on the LDAP that is multi-valued.
When I do an LDAP search sampler, I noted that the value I get back is a string, with the values separated by ", ".
But, if I take the same comma-separated string and try to do an LDAP modify or add, using either an LDAP Request or LDAP Extended Request, I get an error.
So I am wondering if there is a way that the Jmeter LDAP Request or LDAP Extended Request can do that?
Thanks,
Jim
EDIT: When I try to use an Extended LDAP Request modification test/add with the attribute of "", I get this error in the Jmeter GUI response:
When attempting to modify entry cn=xxx... to replace the set of values for attribute lastlogindate, value "20181023085627-04, 20181024063205-04" was found to be invalid according to the associated syntax: The provided value "20181023085627-04, 20181024063205-04" is not a valid generalized time value because it contains an invalid character '-' at position 14
The strange part is that even though I have Jmeter to log at debug level, I don't see any detail on the error in the Jmeter.log, but/so I am guessing that that error message is coming from the Jmeter client itself. I noticed that the message says:
to replace the set of values
so it seems like it recognizes that I am trying to modify/replace a multi-value, but it doesn't seem to like the syntax of the replacement values string(s).
Does anyone know what the correct format SHOULD be?
I found the answer to my own question, or at least "A" answer: It appears that I can use an Extended LDAP request, and add the same attribute in that request, multiple times. So for example, if I am populating an attribute named "foo" the Extended LDAP request would have the following:
attribute value opcode
foo 12345 add
foo 12346 add
etc.
I think I also need to do a replace with no value, to empty the attribute, before all the adds.

getdns API: How do I know if a RESPSTATUS_NO_NAME response is secure?

I'm using the Python getdns API.
I'm using the extensions:
extensions = {"dnssec_return_validation_chain" : getdns.EXTENSION_TRUE}
This means that I'm told if the responses are DNSSEC secured with the dnssec_status option in the reply dictionary. (The results.replies_tree is an array of reply dictionaries.)
A query can have no replies if there is no name (e.g. results.status==getdns.RESPSTATUS_NO_NAME).
In this case, how do I know if the RESPSTATUS_NO_NAME response is authenticated with DNSSEC?
When the status is getdns.RESPSTATUS_NO_NAME, the replies_tree will contain replies with an empty "answer" section and return code NXDOMAIN. I.e. result.replies_tree[0]['header']['rcode']==getdns.RCODE_NXDOMAIN
When using a dnssec extension, these replies will contain the proof of non-existance in the "authority" section (when secure) and will contain a dnssec_status just as with replies that do contain answers.
When the status was insecure and the dnssec_return_validation_chain extension was used, result.validation_chain will contain proof of the non-existance of a secure delegation in one of the ancestors of the queried domain.

Resources