raseone

Q: sending webpages in Apple Mail

Hello, thank you for reading.

 

I was using the "email this page" feature in recent versions of safari to help test html email designs. I realized that is I used relative links (/images/image.jpg rather than http://www.example.com/images/image.jpg) that Safari/Apple Mail would automatically base64 encode all of the included images eliminating the paths to the images & replacing them with the base64 code in the message source.

 

The base64 code was then viewable in the raw source on the recipient end. I did this quite a few times & grew to find it useful for several reasons.

 

The problem that I am now having (a couple months later) is that I can't repeat the process. I have tried sharing web pages with both absolute & relative paths & I am no longer able to see the base64 encoding on the recipient side. Instead I see the images & layout perfectly but when I view the message source I see the relative image paths with no domain name.

 

This code of course looks like it shouldn't work since the relative paths have no domain name from which to load the images... so it would appear that some encoding is still happening but I can no longer see it in the source.

 

Can anyone please help me understand what I am missing here?

 

Thanks in advance.

Mac Pro, Mac OS X (10.7.5)

Posted on Jun 6, 2016 2:02 PM

Close

Q: sending webpages in Apple Mail

  • All replies
  • Helpful answers

  • by leroydouglas,

    leroydouglas leroydouglas Jun 6, 2016 5:01 PM in response to raseone
    Level 7 (23,539 points)
    Notebooks
    Jun 6, 2016 5:01 PM in response to raseone
  • by raseone,

    raseone raseone Jun 7, 2016 10:05 AM in response to leroydouglas
    Level 1 (4 points)
    Mac OS X
    Jun 7, 2016 10:05 AM in response to leroydouglas

    Thanks for taking the time to read & reply Leroy.

     

    I understand how to use the sharing features in Safari & Mail. My questions was much more specific than that. If anyone has had this specific experience or any familiarity with the specific scenario I'm referencing I'd really appreciate some input.

  • by leroydouglas,

    leroydouglas leroydouglas Jun 7, 2016 10:49 AM in response to raseone
    Level 7 (23,539 points)
    Notebooks
    Jun 7, 2016 10:49 AM in response to raseone

    raseone wrote:

     

    The problem that I am now having (a couple months later) is that I can't repeat the process.


    Mac Pro, Mac OS X (10.7.5)

     

    Was this after an upgrade of your OS X? This may be a difference in how the new Mail is handled out of your control.

  • by MrHoffman,

    MrHoffman MrHoffman Jun 7, 2016 10:54 AM in response to raseone
    Level 6 (15,627 points)
    Mac OS X
    Jun 7, 2016 10:54 AM in response to raseone

    Try a different mail client, and try sending the messages via a different mail server, and maybe a mail client on a different target operating system.  Mail servers can do all sorts of things with MIME-encoded messages.   See what happens, and look for differences.

     

    Sending messages in HTML format has always been somewhat dicy, as HTML rendering varies (widely) from mail client to client.  OS X and iOS work similarly, but HTML rendering in other systems can differ... massively.

     

    Any embedded images in HTML should transfer via MIME, but remote images can be disabled within many mail clients as this is a technique used both by marketeers and spammers to detect messages that have been read.   (It would not surprise me that you're running into this, as the mail client may well be either avoiding sending a remote image reference in the message, or — with Yosemite or later — it might be part of the support for transfering files via Mail Drop.)

     

    Mail servers can be set to strip attachments for any of various reasons, including content type, attachment size, remote image loads, and security.

     

    Send a trivial message, expunge (consistently!) any confidential data in the headers, and post the MIME here.

     

    Also see if OS X 10.11.5 works better here, or at least works differently.  If you're not already running that.

  • by raseone,

    raseone raseone Jun 7, 2016 1:00 PM in response to MrHoffman
    Level 1 (4 points)
    Mac OS X
    Jun 7, 2016 1:00 PM in response to MrHoffman

    Thanks guys. Still trying to solve the mystery.

     

    I'll dig up one of the emails expunge the info & post some sample source.

     

    I do understand the drastically different rendering of html emails across various webmail & local email clients as well as the differing re-writing/ reinterpreting of code etc. I'm not having trouble viewing images or sending images within my html layouts. Everything renders fine across all clients. I've do a lot of email design & webpage design for many years.

     

    I'll try to rephrase the issue.

     

    A few months ago I stumbled across an easy way to produce a version of an html email with base64 encoded images simply by "sharing" the email (hosted on a web server with relative links to jpg images) through Safari's sharing feature. This was useful to me for testing & comparison & was a shortcut to something that takes much longer to do manually.

     

    In the source code for the email, on the recipient end, in Apple Mail I could see the images base64 encoded. I believe they were placed into the html layout via CID tags with all the individual base64 strings at the end of the code.

     

    I did this several times over a couple of days & viewed the resulting emails in various clients & even tested them on emailonacid.com. The designs and images are very proprietary so I'd have to work up a safe sample to post code... unfortunately since I can't seem to make it happen again my only choice will be to tediously sanitize one of the existing examples. That will take some work so I'll try to post code tomorrow.

     

    ... it is possible that this base64/cid version of the code only appears only in a very specific version of Apple Mail or when shared from a very specific version of Safari. I'm trying to nail that down now. In any case all versions of both were fairly recent & the sharing feature always works fine no matter if image paths are relative or absolute.

     

    Here's what I see now...

     

    If I host one of these emails on my server with relative links to images then use safari's share feature to send the web page as an email it works great & looks perfect however when I view the source code for the (received) email in Apple mail I see relative links with no domain name that look as if they should not work. I don't see the full domain path being added, I don't see the base64 encoding, just relative links (/images/img.jpg) just as I wrote them. This is sorta confusing. Strangely I see this same thing in both very old & completely current versions of Safari & mail. I'm working across all my devices to try to reproduce the effect with no luck so far.

  • by MrHoffman,

    MrHoffman MrHoffman Jun 7, 2016 2:06 PM in response to raseone
    Level 6 (15,627 points)
    Mac OS X
    Jun 7, 2016 2:06 PM in response to raseone

    Use a different mail client, and hope that your intended recipients have very-much-less-than-desirable security settings for accessing remote images.    What you're attempting here is indistinguishable from one of the usual techniques used by spammers and other folks interested in tracking their message recipients, and mail clients will hopefully continue to make that more difficult.  (I suspect this was an intentional change in the mail client, too — Yosemite and later now default the remote image load to off, and there was a related bug here in Spotlight.)

  • by leroydouglas,

    leroydouglas leroydouglas Jun 7, 2016 2:14 PM in response to MrHoffman
    Level 7 (23,539 points)
    Notebooks
    Jun 7, 2016 2:14 PM in response to MrHoffman

    MrHoffman wrote:

     

    — Yosemite and later now default the remote image load to off

     

    Yes this was my suspicion, however I could not pull up the Developers Library reference to this.

  • by MrHoffman,

    MrHoffman MrHoffman Jun 7, 2016 3:16 PM in response to leroydouglas
    Level 6 (15,627 points)
    Mac OS X
    Jun 7, 2016 3:16 PM in response to leroydouglas
  • by raseone,

    raseone raseone Jun 7, 2016 3:34 PM in response to MrHoffman
    Level 1 (4 points)
    Mac OS X
    Jun 7, 2016 3:34 PM in response to MrHoffman

    Ok. That seems kinda insulting.  Maybe I'm not communicating the questions well. I appreciate your time but It would be better if someone who understands the questions better could reply.

     

    Let me try again...

     

    I'm inquiring if anyone can identify any specific situation in which Safari's share feature through Apple Mail would automatically base64 encode the images in an html email. For example, in my case it would seem to do it specifically when links to images were relative rather than absolute.

     

    I'm also asking about the source code usually produced by the share feature showing relative links (/images/img.jpg as opposed to http://example.com/images/img.jpg). Obviously the source code being displayed in Apple Mail can not be the full & actual code since these relative links would of course not work on the recipients end.

     

    My web searches show others asking the same questions but so far no definitive answers.

     

    I will try the developer program support also but any insights would be appreciated.

     

     

     

    @ mr hoffman & mr douglas

     

    These questions have absolutely nothing to do with weather or not any individual user has remote images turned on or off. As far as I know any image blocking would effect base64 images same as it would remote images & since I've stated a few times already that these images are hosted on a server & the html uses relative links I'm not sure how that's relevant at all. These questions have nothing to do with sending the emails to actual recipients, only with internal development & testing which includes viewing emails & source code thereof in various email clients and analysis sites. These questions have nothing to do with any bizarre user tracking or spam. There have been no changes to my versions of Safari or Apple Mail since I last did this so that sorta blows your theory that my evil plan has been thwarted by better security

     

    So it's no problem at all if you misunderstand or don't have an answer or have not seen this occur. I'm not sure why you want to jump to all these suspicious accusations and assume I have some nefarious plan. Development of html emails & landing pages etc. is a common job for design firms or ad agencies. As for your detective work on me I'm happy to provide my developer account if anyone for some reason you feel you need to investigate me further.

  • by leroydouglas,

    leroydouglas leroydouglas Jun 7, 2016 4:22 PM in response to MrHoffman
    Level 7 (23,539 points)
    Notebooks
    Jun 7, 2016 4:22 PM in response to MrHoffman
  • by raseone,

    raseone raseone Jun 7, 2016 4:45 PM in response to leroydouglas
    Level 1 (4 points)
    Mac OS X
    Jun 7, 2016 4:45 PM in response to leroydouglas

    So you two heroes are just gonna label me as some scamming spammer for asking a question about the "share" feature in Apple Safari? Is this the level of support one should expect in the Apple Support Community? Getting no answer or the wrong answer is fine but I could do without the misguided, baseless accusations.

     

    Understanding the mechanics of how various email clients display emails is no different than understanding how different browsers render web pages. I am a designer & part of my job is making sure that the html emails & landing pages I am sometimes tasked to develop will display properly across a multitude of webmail clients and local email clients & browsers.

     

    You're not rescuing anyone by pointing out the very obvious fact that all web servers log access to the files they host. Every web server ever has always done this since the beginning of time. It has absolutely nothing at all to do with the questions that I'm asking. People are generally free to block images in email if they want. That has nothing to do with me or with my questions.

     

    I'm not the only person wondering about the relative links & encoding in the source code. Any reasonable insights are still very welcome.

  • by MrHoffman,

    MrHoffman MrHoffman Jun 7, 2016 5:12 PM in response to raseone
    Level 6 (15,627 points)
    Mac OS X
    Jun 7, 2016 5:12 PM in response to raseone

    No offense is intended.    it's simply that what you're doing may well be completely above board and entirely reasonable, but what you're doing here — if you're trying to get remote email clients to load images remotely — is also completely indistinguishable from a spammer.

     

    Test with a different email client to send out your messages.   See if that works.

     

    But even if that works, I'd expect that remote image loads will continue to become less common.

  • by raseone,

    raseone raseone Jun 7, 2016 8:52 PM in response to MrHoffman
    Level 1 (4 points)
    Mac OS X
    Jun 7, 2016 8:52 PM in response to MrHoffman

    I can narrow it down some...

     

    Under Yosemite 10.10.4 using Safari 8.0.7 & Apple Mail version 8.2 I definitely get source code on the receiving end (Apple Mail > View > Message > Raw Source) that shows base64 encoded images  placed  into the  html layout thusly:

     

    <img width=3D"202" height=3D"33" apple-inline=3D"yes" =

    id=3D"A3D68..................." apple-width=3D"yes" =

    apple-height=3D"yes" =

    src=3D"cid:84AEC................@bla1.ca.blablabla.bla." =

    class=3D"">

     

    Each "cid" corresponds to a base64 encoded image. The whole html layout is heavily re-written.

     

    It makes sense because the relative image paths from the server would of course not work. I would guess that this encoding & heavy re-writing of the html is always occurring when one uses that "share" button in Safari to send a page via Apple Mail however it seems  that some versions of Apple Mail display (almost) the original code as written while some versions display the reformatted code that Mail is actually using to display the email. Still working to nail it down.