"=?utf-8?Q??=" in To: field with Outlook and MailChimp - utf-8

I can't find much information on this problem aside from issues with Code Igniter and long subjects (my subject is < 20 chars). I sent a campaign with MailChimp, and found that when using Outlook (Gmail web is fine), the To: field says "=?utf-8?Q??=" instead of the recipient name.
What could cause this?

The To header below encodes an empty string (nothing between two ?'s in =?utf-8?Q??=:
To: =?utf-8?Q??= <MyName#MyCompanyName.com>
Either get rid of the utf-8 encoding or actually provide a display name
To: =?utf-8?Q?Some Name?= <MyName#MyCompanyName.com>

Related

Performing updates using alternate key in Dynamics 365 WebAPI

Can anyone help, as I believe someone has already faced the issue I'm having.
I have a custom entity (alssc_anglesector) with an alternate key (alssc_name)
“alssc_ANGLESector#odata.bind”: “/alssc_anglesectors(alssc_name=’Air’)”,
“alssc_ANGLESector#odata.bind”: “/alssc_anglesectors(alssc_name=’Water Auth/Company’)”,
when I create an account and use the first bind with “Air” it works fine, while when using the second “Auth/Company” I got the response
“message”: “Bad Request – Error in query syntax.”,
“type”: “Microsoft.OData.ODataException”,
“stacktrace”: ” at
Microsoft.OData.UriParser.ODataPathParser.ExtractSegmentIdentifierAndParenthesisExpression(String
segmentText, String& identifier, String& parenthesisExpression)
I have also tried to encode it
"alssc_ANGLESector#odata.bind": "/alssc_anglesectors(alssc_name=\u0027Water Auth\u002FCompany\u0027)",
but the end result was the same.
I’m not being able to overcome this, Any ideas / suggestions ?
could it be a Bug in D365 API WebApi ?
As per the answer in the comment thread: This request is unsupported because it contains Unicode characters
Unicode characters in key value
If the data within a field that is
used in an alternate key will contain one of the following characters
<,>,*,%,&,:,/,\ then update or upsert (PATCH) actions will not work.
The suggestion from the Microsoft Docs is to create another field (such as a code, or a simplified name) that does not contain these characters
https://learn.microsoft.com/en-us/powerapps/maker/common-data-service/define-alternate-keys-reference-records#unicode-characters-in-key-value
In this case you have to change ’Water Auth/Company’ with ’Water Auth%2FCompany’ because of '/' special character.
I hope it works.
Ugur

Mac computers aren't processing mailto: links correctly when they have // in them (mailto://)

Sorry for the question title, it's a little difficult to phrase in my opinion. Here is the full question:
The WYSIWYG HTML editor we use on our websites includes a // in the mailto: link when inserted into the text editor box (mailto://). We are a webfirm and use this editor on many, many websites. For example, all the mail links inserted appear like this:
Text Here
We just noticed this morning that Windows computers do not include the // in the To: field when clicked regardless of the email client it's opened with. It will include the email as normal (email#domain.com).
However, Mac computers are including the // though, so whenever someone tries to send an email using these links, it's trying to email //email#domain.com - which isn't delivering, because obviously it's an invalid format with the //s.
Does anyone have any knowledge to why this is happening? The WYSIWYG editor we are using is obout. If we have to go back and remove these // from every single website we've built, it would be a tremendous task. I'm just wondering why Macs seem to not process the link correctly, while Windows computers do.
The Macs are processing the link correctly. Windows is incorrectly removing data and your editor is incorrectly encoding the data.
The mailto: URL scheme is defined by RFC 2368. It defines it as:
mailtoURL = "mailto:" [ to ] [ headers ]
to = #mailbox
headers = "?" header *( "&" header )
header = hname "=" hvalue
hname = *urlc
hvalue = *urlc
"#mailbox" is as specified in RFC 822 [RFC822]. This means that it
consists of zero or more comma-separated mail addresses, possibly
including "phrase" and "comment" components. Note that all URL
reserved characters in "to" must be encoded: in particular,
parentheses, commas, and the percent sign ("%"), which commonly occur
in the "mailbox" syntax.
There is no provision for removing characters such as /.

Processing form input in a Joomla component

I am creating a Joomla component and one of the pages contains a form with a text input for an email address.
When a < character is typed in the input field, that character and everything after is not showing up in the input.
I tried $_POST['field'] and JFactory::getApplication()->input->getCmd('field')
I also tried alternatives for getCmd like getVar, getString, etc. but no success.
E.g. John Doe <j.doe#mail.com> returns only John Doe.
When the < is left out, like John Doe j.doe#mail.com> the value is coming in correctly.
What can I do to also have the < character in the posted variable?
BTW. I had to use & lt; in this question to display it as I want it. This form suffers from the same problem!!
You actually need to set the filtering that you want when you grab the input. Otherwise, you will get some heavy filtering. (Typically, I will also lose # symbols.)
Replace this line:
JFactory::getApplication()->input->getCmd('field');
with this line:
JFactory::getApplication()->input->getRaw('field');
The name after the get part of the function is the filtering that you will use. Cmd strips everything but alphanumeric characters and ., -, and _. String will run through the html clean tags feature of joomla and depending on your settings will clean out <>. (That usually doesn't happen for me, but my settings are generally pretty open to the point of no filtering on super admins and such.
getRaw should definitely work, but note that there is no filtering at all, which can open security holes in your application.
The default text filter trims html from the input for your field. You should set the property
filter="raw"
in your form's manifest (xml) file, and then use getRaw() to retrieve the value. getCmd removes the non-alphanumeric characters.

rfc2047 multiple encoded-word in email subject

I need to send an email with the Subject containing cyrillic letters. But my recipients sometimes receive incorrect letters due to some problems with mail server and/or client. I always send emails in windows-1251 encoding, but sometimes a mail client shows letter's Subject and Sender in another encoding (KOI-8R) and our users can't understand the message.
I tried to use an encoded-word tag as described in RFC 2047 Standard. For example, my Subject field in the email now looks like:
Subject: =?WINDOWS-1251?B?wiDt5eTw4PUg8vPt5PD7IOL75PD7IOIg4+Xy8OD1IPL78P/yIOIg4uXk8OAg/+Tw?=
=?WINDOWS-1251?B?4CDq5eTw4C4gwvvw4uDiIPEg4vvk8Psg4iDy8+3k8OUg4+Xy?=
=?WINDOWS-1251?B?8PssIOL78vDzIOL75PDu6SD/5PDgIOrl5PDgLCDi+/Lw8yDj?=
=?WINDOWS-1251?B?5fLw7ukg4vvk8OUg7O7w5PMsIP/k8OAg4iDi5eTw4Cwg4vvk?=
=?WINDOWS-1251?B?8PMg4iDy8+3k8PMu?=
These lines was generated by Oracle function UTL_ENCODE.MIMEHEADER_ENCODE.
All mail clients (Lotus Notes, gmail.com) show only the first line of such email subject (only first 48 symbols).
What is the problem with my mail subject?
The problem is, that you do not fold correctly, according to RFC 2822. To make a multi line field in the header each line has to start with a white space.
What you need to do is:
replace(UTL_ENCODE.MIMEHEADER_ENCODE(subject, 'UTF8', UTL_ENCODE.BASE64), UTL_TCP.CRLF, UTL_TCP.CRLF || ' ')
This should solve your problem.

Outlook handling of quoted url parameters in mailto link

I'm attempting to populate the body of a mailto link with an html link. The target browser is IE 7+ and mail client is Outlook 2007+. Before I ask my question, i'll acknowledge the fact that the body parameter is intended for short text messages as called out here:
https://stackoverflow.com/a/4304779/573083
and detailed here:
The special "body" indicates that the associated is the body of the
message. The "body" field value is intended to contain the content for
the first text/plain body part of the message. The "body" pseudo
header field is primarily intended for the generation of short text
messages for automatic processing (such as "subscribe" messages for
mailing lists), not for general MIME bodies. Except for the encoding
of characters based on UTF-8 and percent-encoding, no additional
encoding (such as e.g., base64 or quoted-printable; see [RFC2045]) is
used for the "body" field value. As a consequence, header fields
related to message encoding (e.g., Content-Transfer-Encoding) in a
'mailto' URI are irrelevant and MUST be ignored. The "body" pseudo
header field name has been registered with IANA for this special
purpose (see Section 8.2).
That being said, there have been a number of threads on SO with varying levels of success with inserting links in the body tag. for example: https://stackoverflow.com/a/1455881/573083 and https://stackoverflow.com/a/9138245/573083
My issue is similiar, but it is specifically with outlook rendering quoted parameters of embedded links. I currently have the following that is almost working:
A link
A partial link appears correctly in the outlook body, however outlook is not including the final quoted url parameter ("somevalue") in the link; the ="somevalue" is just appearing as plain text. Viewing the source of the email message shows that outlook is closing the enclosing <a> tag as it is interpreting the %22 as the end of the link. I've attempted to escape the %22 with %2f, /, ' - to no avail. I believe that I need the correct sequence for outlook to understand that the %22 should be included in the link, and not as the closure of the enclosing link.
Any help would be appreciated.
Judging by the ?, you haven't encoded the body component.
> encodeURIComponent("http://someserver.somedomain/somepage.aspx?id=1234%26somekey=%22somevalue%22")
"http%3A%2F%2Fsomeserver.somedomain%2Fsomepage.aspx%3Fid%3D1234%2526somekey%3D%2522somevalue%2522"
So the code should be:
A link
Or more likely:
A link
I would put the link inside "<" & ">".
%20 = space
%0D = new line
%3C = "<"
%3E = ">"
<html>
<body>hi
A link</body>
</html>

Resources