Emails with empty content-id - jakarta-mail

I sometimes recieve e-mails with empty CONTENT-ID.
Exemple:
In most cases, the empty content-id belongs to an attachement, that is added to the email two times, once as correct inline attachement with a content ID, in the second, the content-disposition is : attachement instead and the content ID is empty.
Is this a mail client bug ?

According to the MIME RFC a Content-ID is optional, but if present should be "world-unique" (which an empty string certainly isn't).
Personally I'd treat empty Content-ID to be identical to a missing Content-ID.

Related

Azure Logic App - Loop through email addresses and send to slack

I am attempting my first Logic App, which will trigger from an email. It will then look for any email addresses in the body of the email, and send an individual slack message to a channel with the email address as the text.
So far, all I can do is post one message to the channel with an array of the email addresses.
Here's what I am doing...
When an email arrives, first initialize an array :
Then I convert the email body to text (to remove any HTML)
Then I find any addresses in the above text :
Then I set the above emails variable with :
createArray(outputs('Find_Email_Address_in_Email')['body'])
And Finally I send a slack message in a loop based on the Emails array :
What gets posted to slack is :
(The whole array, when I want it to run once for each email in the list).
I think I am either setting the array incorrectly, or the for each isnt set up correctly?
I got it.
On the Set Variable section, Instead out using the output straight from the JS execution, I convert it to JSON first like :
json(outputs('Previous_Step_Name')['body'])

Why does gmail API when using history.list method send message ids without the field what action has been preformed on them?

When using gmail API, history.list method we get "bare" message ids with no additional field from the fields in 'labelAdded', 'labelRemoved', 'messageAdded', 'messageRemoved'. Why is that? And is it possible that a new message has been added but when we use this method, the field messageAdded hasn't been used, so we receive it "bare" ?
According to the GMail history API, the list only contains the id and threadId fields.
It works this way because the objective of the history API is to provide you with the changes that happened in the mailbox, not its contents.
After you obtain the list from Users.history: list you need to call Users.messages: get or Users.messages: list to get the full messages.
If the messageAdded field is empty, it means that no new messages were added after the last historyId you examined. You might have skipped some. Make sure that every time you query the API you internally store the last historyId you processed so you can resume from that point in the future and not lose any changes.

Gmail API's history.list incorrect messagesAdded value

In the history list endpoint is recommended to use specific change-type fields like messagesAdded rather than the messages field.
However I've noticed that when receiving an email with an attachment or without body (just the subject) the messagesAdded field is empty while the messages field has an entry.
Is this the correct behaviour? I was expecting the messagesAdded key with a value as well.

Error Code: 2250 when deleting an invoice

QBO raises the error code 2250 "You must fill out at least one split line". Why does it need to pass a line for deleting an invoice? Should it just require invoice.id?
For whatever bizarre reason, the Intuit v3 "delete" call requires that you pass the entire invoice object to the delete call in order to delete an invoice.
It's weird, yes. Unfortunately, it's also the way the API works and is required.
You can see this documented here:
https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/010_calling_data_services/060_delete
Quoting:
The request body includes the full payload of the object as returned in a read response.
I figured a hack way without submitting the entire object. It accepts an empty line and sync token along with the invoice id.

Adding hyperlinks in sql server

I'm working on storing the body of emails in sql server as ntext. The email body which I'm storing has hyperlinks like "view my website". I want to represent this normal text as hypelink?
Any Ideas?
You can insert the text as a normal insert. You may want to consider using something like FCKEditor to allow your users to format the email properly unless your going to be able to control how the HTML is created. You will want to make sure your columns datatype and size are appropriate.
Not knowing your table schema here is a very basic example.
Insert into Emailtable
('emailHtml', 'emailText')
Values
('<HTML><Head></Head><Body>view my website</Body></HTML>', 'Text version of the email')
If your going to have spaces and special characters in your link you could HTML encode the link so when it stores it and retrieves it you know your getting the right values.
You can store the text as formatted HTML and when you sent it with your email client (not sure how you will be sending these) set the client to send the message as HTML formatted. Then it's just a matter of adding the tags to the NText.
the sql type named text is appropriated for html content(including hyperlinks).
In your page you shoud use HtmlString class to show htm content.

Resources