while parsing email content why class and id attributes are removed
In many of the web email clients while parsing email content , they remove class and id a开发者_如何学Pythonttributes from the email content. why they are removing so? If those things are retained what are the problems may occur?
They do it for security reasons. It might be an overly aggressive filter, but a lot of people are paranoid like that.
Microsoft Outlook for example doesn't allow any CSS or even inline CSS. Most clients will block external scripts/images, this is so that the email author cannot tell if the email was opened or not. EG:
<img src="http://spamsite.com/img1.jpg?uniqueCode=3543407" />
The server links the unique code to that email dispatch, and then you know if the address is a valid one when the image is requested, opening the floodgates to more spam, because hey, this guy opens and reads these emails.
I imagine blocking classes/ID's is associated with blocking external CSS/Javascript from running. Also internal CSS with background images loaded from external URLs can be a security concern, so I imagine the email clients just decided to block it all instead of writing complicated and hard to maintain rules to filter out all the dangerous bits.
精彩评论