Error in Email Action "html body data value too large" - salesforce

I am getting this error "html body data value too large" when I am replying to customer's mail which includes any table.
So basically I am getting this error because of that table.
If anyone have any solution please help me.

Try to inspect the raw html of that table, for example running a SELECT HtmlBody, TextBody FROM EmailMessage WHERE Id = '...'. I suspect the client sent you something nasty generated by MS Outlook, with lots of hidden styles, useless <span>s etc.
You could try to foward it to some email client and reply only to plaintext version? Or copy the content to new email, chances are useless stuff will be dropped. Or start a draft messsage, use a script or data loader to edit the content and cut the rubbish out.

Related

A Confusion about Raw query parameter

I am writing a simple migration tool in which I have to migrate gmail mailboxes to some other email provider. I am confused about raw string returned from gmail api.
In Google document, it says:
"raw": Returns the entire email message content in the raw field as a URL-safe base64 encoded string and the payload field is not used. This includes the identifiers, labels, metadata, MIME structure, and small body parts (typically less than 2KB).
So this means "raw" returns only small body parts less than 2kb and if the body parts are more than 2KB, there will be a problem. I have checked with some dummy emails containing email body(including inline attachments) more than 2KB, and it still works. It still returns the complete body without any problem. Sorry,if I missed something, please clear my confusion. If "raw" is working fine for all email body sizes , I will be using this approach in my project instead of "full" query parameter.
best regards,
messages.get(format=RAW) returns the entire email always. That document: https://developers.google.com/gmail/api/v1/reference/users/messages/get is incorrect and needs to be fixed.

Forward message using the Gmail API without using JavaMail

Is there a way to use the Gmail API based Message object to forward a message without using the JavaMail library (Javax)?
Thanks.
Looking for a way to bounce the Message object to another recipient WITHOUT using any JAVAMAIL classes (MimeMessage for instance)
So far no luck cause I'm pretty sure that the message's Raw will have to be re-encoded somehow.
Will love some help.
EDIT:
Found one solution which is equivalent to bouncing an message to another recipient. Thanks to Eric for the pointing me in the right direction. use the Gmail API get method for the specific email with "raw" format. decode the raw string from the parsed message->replace "To:" with new recipient address and re-encode the raw (base62url). Create a new message with newly encoded raw and send
Depends on what you mean by "Forward" I imagine. If you mean it in the "bounce message" of old mailers of yore (resend the exact same content to a new recipient without changing body or headers) then yeah should be trivial.
If, instead, you mean what more current mailers do when you forward it (set new From, To, Subject headers, include original To+Cc+From headers somewhere in the body below something like "Forwarded message" and your own user-added content) then you probably need to deal with something like javax.mail for those changes. If you're sure the emails are simple (e.g. just a text/plain part) you could attempt it without javax.mail and use the parsed Message object (format=FULL) to create a new email. But javax.mail is probably best.

Gmail API Users.Messages.get return some messages without any label

Trying to get messages from Gmail using RESTFul API using get operation and some messages are returned empty labels (other parts of the payload are ok).
What is the reason to get empty labels ?
Thanks
Messages without labels are archived messages.
This seems like expected behavior. If they don't have any labels (e.g. not even INBOX) then they are simply in All Mail (e.g. they have been archived and are in the mailbox, etc).

Is this a Bot modifying my URLs for some tracking purpose?

I don't know if this is bad code on our part, or a bot/spider doing something for tracking purposes. What I'm seeing is our URLs are getting modified, and it's generating site errors and error emails that I'm set up to get when it seems like my site is being hacked.
For example, a URL that should read/load like this
http://site.com/page.asp?pid=915411&order=Date
gets loaded like this
http://site.com/page.asp?pid=-1'&order=Date
the email I get shows
query string = pid=-1%27&order=Date
The IP address that comes up in the error emails always change, but many point to Kiev or Minsk, but are so varied I don't see how I can stop this from happening easily. My site is on an IIS 7.5 server, win2008.
Someone is trying to hack your application. They are testing if your application uses values from the forms or URL directly into SQL statements.
This hacking attempt is easy and called "SQL injection". Check your application if it is vulnerable, fix it immediately if required.
Additionally, try to track the attackers and if you see them coming from a set of IP addresses, block them.
Using HTTP_REEFER we are able to control the URL Modifying on directly.
Try the below code
if Request.ServerVariables("HTTP_REFERER") = "" Then
RESPONSE.WRITE " <b><h1><font color=blue></font><font color=red>UNSECURED MENU ACCESS</font><font color=blue></font><h1></b> "
response.end
End if

DotNetNuke Event Logging format

Using DotNetNuke 5.
I am using the EventLogController along with LogInfo to add custom messages to the event logs in dot net nuke.
Within LogInfo we have a method to Add a Property/Value. I am under the assumption that the Controller.AddLog(logInfo) converts the properties & vlaues into XML using the LogInfo->Serialize method for DNN to store it.
My problem is that I want linebreaks in my message. Is there anyway I can add a newline. "\r\n" wouldn't work, wouldn't work, CDATA escaped wouldn't work. Everything gets escaped through the Log function.
How do I pretty print the log message myself?
Regards, V
Sadly, due to the HTML encoding that is done on all messages, you are going to be out of luck trying to do this in the DNN event Log.
Depending on what/where you are, you have a few options.
You can add them as individual detail lines using properties, see my example below.
You could report on something yourself, using a custom log table or something similar
If you are in the context of a Scheduled Job, you can log to that history, which is NOT escaped.
Examples
Log Properties
objLog = new DotNetNuke.Services.Log.EventLog.LogInfo();
objLog.AddProperty("SecureMyInstall", "Phase 2 Error Processing User Accounts");
objLog.LogTypeKey = DotNetNuke.Services.Log.EventLog.EventLogController.EventLogType.HOST_ALERT.ToString();
objLogger.AddLog(objLog);
The content of the logs is displayed as HTML, so you should be able to put <br /> to add line breaks.

Resources