Icalendar .ics not showing issue after adding html content - cakephp

I got this issue with icalendar, it doesn't show the attachment and the confirmation button when sent to gmail,yahoo, aoutlook.com.
it was working before without html message and multipart/mixed header.
now when i recieve the email it only show me the the text of the calendar, it doesn't recognize it.
Content-type: multipart/mixed; boundary="982f8d486c3cbed0e28b314e7a433c3d"
--982f8d486c3cbed0e28b314e7a433c3d
Content-Type: multipart/alternative; boundary="19f4b0e33c6f735ae6f858b1df7b72f2"
--19f4b0e33c6f735ae6f858b1df7b72f2
Content-Type: text/calendar; method=REQUEST; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Testa//Tes//EN
METHOD:REQUEST
BEGIN:VEVENT
UID:20150914T205515-998107994-domain.com
DTSTAMP:20150914T205515
DTSTART:20150915T195500Z
DTEND:20150915T195500Z
ORGANIZER;CN=soy:MAILTO:admin#adminm.org
ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=xxx.yyy#gmail.com:MAILTO:xxx.yyy#gmail.com
LOCATION:hj
SUMMARY:Rendez-vous
BEGIN:VALARM
TRIGGER:-PT15M
ACTION:DISPLAY
DESCRIPTION:Reminder
END:VALARM
END:VEVENT
END:VCALENDAR
--19f4b0e33c6f735ae6f858b1df7b72f2--
--982f8d486c3cbed0e28b314e7a433c3d
Content-Type: application/ics; name="Rv-invite.ics"
Content-Disposition: attachment; filename="Rv-invite.ics"
Content-Transfer-Encoding: base64
X-Mailer: Microsoft Office Outlook 12.0
X-Mailer: CakePHP Email
Date: Mon, 14 Sep 2015 20:55:16 +0200
Message-ID: <55f71814db484f8fa8923d8664ca69fc#localhost>
Subject: Rendez-vous
MIME-Version: 1.0
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>Emails/html</title>
</head>
<body>
<p>Dear,</p>
<p>Mr xxx sent an appointment</p>
</body>
</html>
thanks in advance.

Well your second body part has 2 content-type headers:
Content-Type: application/ics; name="Rv-invite.ics"
Content-Disposition: attachment; filename="Rv-invite.ics"
Content-Transfer-Encoding: base64
and
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
It looks like some of the headers also belong to the top level and not in the body part:
X-Mailer: Microsoft Office Outlook 12.0
X-Mailer: CakePHP Email
Date: Mon, 14 Sep 2015 20:55:16 +0200
Message-ID: <55f71814db484f8fa8923d8664ca69fc#localhost>
Subject: Rendez-vous
MIME-Version: 1.0
See also this post about the correct MIME structure to use in general: Multipart email with text and calendar: Outlook doesn't recognize ics

Related

Export email to EML format which contains EML attachments

We are using Redemption from an Outlook addin for save messages to EML format (RFC822).
There was an unfortunate situation when one of out customer attached several EML file attachments into her email (and these emails were saved with Redemption).
The generated EML is not the same if I open in Outlook like the original message.
IMHO the issue caused by the fact the attached EML files using the same "00B0FEED_message_boundary" ID for message part boundaries.
I try to explain below:
... headers ..
Content-type: Multipart/mixed; charset=iso-8859-1;
boundary="00B0FEED_message_boundary"
Content-Description: Multipart message
--00B0FEED_message_boundary
Content-type: Multipart/alternative; charset=ISO-8859-1;
boundary="00B0FEEE_message_boundary"
Content-Description: Multipart message
--00B0FEEE_message_boundary
Content-type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Content-Description: Message text
... message body in plain text format ...
--00B0FEEE_message_boundary
Content-type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: Quoted-printable
Content-Disposition: inline
Content-Description: HTML text
... message body in HTML format ...
--00B0FEEE_message_boundary--
--00B0FEED_message_boundary
Content-type: application/octet-stream; charset=iso-8859-1;
name="=?iso-8859-1?Q?1=20Ab-=20und=20Zuschl=E4ge=2EEML?="
Content-Transfer-Encoding: Quoted-printable
Content-Disposition: attachment;
filename="=?iso-8859-1?Q?1=20Ab-=20und=20Zuschl=E4ge=2EEML?="
Content-Description: =?iso-8859-1?Q?1=20Ab-=20und=20Zuschl=E4ge=2EEML?=
... first attached message headers ...
Content-type: Multipart/mixed; charset=3Dutf-8;
boundary=3D"00B0FEED_message_boundary" <------ inner message boundary ID
Content-Description: Multipart message
--00B0FEED_message_boundary
Content-type: Multipart/related; charset=3DISO-8859-1;
boundary=3D"00B0FEEE_message_boundary"
Content-Description: Multipart message
--00B0FEEE_message_boundary
Content-type: Multipart/alternative; charset=3DISO-8859-1;
boundary=3D"00B0FEEF_message_boundary"
Content-Description: Multipart message
--00B0FEEF_message_boundary
Content-type: text/plain; charset=3Dutf-8
Content-Transfer-Encoding: Quoted-printable
Content-Disposition: inline
Content-Description: Message text
... first attached message body in plain text ...
--00B0FEEF_message_boundary
Content-type: text/html; charset=3Dutf-8
Content-Transfer-Encoding: Quoted-printable
Content-Disposition: inline
Content-Description: HTML text
... first attached message body in HTML ...
--00B0FEEF_message_boundary--
--00B0FEED_message_boundary--
--00B0FEED_message_boundary
... several other similar EML messages
This message not opening correctly in Outlook, but if I change the inner message boundary ID (and modify the corresponding part in the inner message) the EML opening correctly. So I presume this similar ID the cause of my issue.
Is there any workaround to force to use random ID for message boundary? Maybe to force to BASE64 encode the attachments?

Is there any harm in using a fake domain as location in MHTML?

I'm generating mhtml files to package a local page into a single file.
At first, reading the specification https://www.rfc-editor.org/rfc/rfc2557 it seemed to me that I can just ditch location all together and use relative paths but I'm running into security errors with that, I get the error "Not allowed to load local resource: file://..."
This is when the file looks like this:
From: <MHTML Generator>
Subject: test
MIME-Version: 1.0
Content-Type: multipart/related; boundary="boundary_N7JVHbsWDzwnj6aXjmh4dZq33fjuicQy24LSKDEMrUmXONq4oO1zW1EYSQ3C38OB"; type="text/html"
--boundary_N7JVHbsWDzwnj6aXjmh4dZq33fjuicQy24LSKDEMrUmXONq4oO1zW1EYSQ3C38OB
Content-Type: text/html
Content-Transfer-Encoding: BASE64
PGh0bWw+PGhlYWQ+PC9oZWFkPjxib2R5Pg0KPGltZyBzcmM9InBpY3Mvb2sucG5nIj4NClRlc3QhISBoZXJlIEkgYW0NCjwvYm9keT48L2h0bWw+
--boundary_N7JVHbsWDzwnj6aXjmh4dZq33fjuicQy24LSKDEMrUmXONq4oO1zW1EYSQ3C38OB
Content-Location: pics/ok.png
Content-Type: image/png
Content-Transfer-Encoding: BASE64
iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAcbUlEQVR4Xu1dv08XyRv+/jOHMRdjYSFgRYEkRhKh0lyCMbGyIhRqYSikhAB3ROIPOiyV5uyEShISbZDExpyJCbEDPYWoeOh8eT7nesu6uzM7O7Mzs/O8iTluP7uzM+88zzPvzM6P/wkaPUAPROuB/0VbchacHqAHBAXAAxB8/frVg1yoZSGkvKqVKO67KABx1z9LH7kHKAAlAChq7ZLrdX9PXp1OB39n002u5d1XdG9R2riel176evbZdJ7K8qqabt670tWg64O85yLnt7T4FACPBCBLroQoWXJkr+cJkqlreQJj4/0ywVL1QZ7PpCyI+AYKgKTyiwiQB9gywhbdn34mL6KoSsCyaEFGsuyzZflJ36sqNun3l0UL2Sqp4gMKQDU1owAoCkBR2J+9LgOrjFR54bdq6ycTEB2iFpHR9Ltk4qTqAwoABaCaBxTuLiK/jKxlv+eF+wl4i/r1Zc/kta5lobpKP1uF5GXjA9k8ZUlc9mxdHyhUK2858AAjgAhhkEfsCN3AIlMA4sQABSDOes8rNSMAYoEeiNgDFICIK59FpwcoAMQAPRCxBygAEVc+i04PUACIAXogYg9QAFpQ+e/evRMvXrwQjx8/Fvfv3xfT09Pixo0b4sqVK+LChQvi7Nmzoq+vT3R3d4vjx4+Lo0ePiq6uLvHLL790/uFvXMNvuAf34hk8izSQFtJE2ngH3oV30sL3AAUgkDr89u2b2NzcFMvLy2J+fl6MjY2J4eFhceLEiR9ETgjd1H/xbuQBeUGekDfkEXmlheEBCoCn9bS1tdVpbScnJ8XIyIhTolcVFAgD8oy8owwoC81PD1AAPKmX7e1t8ejRo0643d/f76xVr0p21ftRJpQNZURZaX54gALgqB4QJq+vr4uZmZlOGJ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v7sdRlYZaTKC79VWz+ZgOgQtYiMpt8lEydVH1AAKADVPKBwdxH5ZWQt+z0v3E/AW9SvL3smr3UtC9VV+tkqJC8bH8jmKUvismfr+kChWnnLgQcYAUQIgzxiR+gGFpkCECcGKABx1nteqf8P1UpMmQMpUq4AAABRdEVYdENvbW1lbnQAQ29weXJpZ2h0IElOQ09SUyBHbWJIICh3d3cuaWNvbmV4cGVyaWVuY2UuY29tKSAtIFVubGljZW5zZWQgcHJldmlldyBpbWFnZbaaaaYAAAA4dEVYdENvcHlyaWdodABDb3B5cmlnaHQgSU5DT1JTIEdtYkggKHd3dy5pY29uZXhwZXJpZW5jZS5jb20pTs6ZTgAAAFp6VFh0Q29tbWVudAAAeJxzzi+oLMpMzyhR8PRz9g8KVnDPTfJQ0CgvL9fLTM7PS60oSC3KTM1LTtVLzs/VVNBVCM3LyUxOzStOTVEoKEoty0wtV8jMTUxPBQC4jxoknLyY4wAAAEF6VFh0Q29weXJpZ2h0AAB4nHPOL6gsykzPKFHw9HP2DwpWcM9N8lDQKC8v18tMzs9LrShILcpMzUtO1UvOz9UEAH02EGgc3eaPAAAAAElFTkSuQmCC
--boundary_N7JVHbsWDzwnj6aXjmh4dZq33fjuicQy24LSKDEMrUmXONq4oO1zW1EYSQ3C38OB--
However, if I add a fake base location:
From: <MHTML Generator>
Subject: test
MIME-Version: 1.0
Content-Type: multipart/related; boundary="boundary_N7JVHbsWDzwnj6aXjmh4dZq33fjuicQy24LSKDEMrUmXONq4oO1zW1EYSQ3C38OB"; type="text/html"
--boundary_N7JVHbsWDzwnj6aXjmh4dZq33fjuicQy24LSKDEMrUmXONq4oO1zW1EYSQ3C38OB
Content-Location: https://fake.com
Content-Type: text/html
Content-Transfer-Encoding: BASE64
PGh0bWw+PGhlYWQ+PC9oZWFkPjxib2R5Pg0KPGltZyBzcmM9InBpY3Mvb2sucG5nIj4NClRlc3QhISBoZXJlIEkgYW0NCjwvYm9keT48L2h0bWw+
--boundary_N7JVHbsWDzwnj6aXjmh4dZq33fjuicQy24LSKDEMrUmXONq4oO1zW1EYSQ3C38OB
Content-Location: https://fake.com/pics/ok.png
Content-Type: image/png
Content-Transfer-Encoding: BASE64
iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAcbUlEQVR4Xu1dv08XyRv+/jOHMRdjYSFgRYEkRhKh0lyCMbGyIhRqYSikhAB3ROIPOiyV5uyEShISbZDExpyJCbEDPYWoeOh8eT7nesu6uzM7O7Mzs/O8iTluP7uzM+88zzPvzM6P/wkaPUAPROuB/0VbchacHqAHBAXAAxB8/frVg1yoZSGkvKqVKO67KABx1z9LH7kHKAAlAChq7ZLrdX9PXp1OB39n002u5d1XdG9R2riel176evbZdJ7K8qqabt670tWg64O85yLnt7T4FACPBCBLroQoWXJkr+cJkqlreQJj4/0ywVL1QZ7PpCyI+AYKgKTyiwiQB9gywhbdn34mL6KoSsCyaEFGsuyzZflJ36sqNun3l0UL2Sqp4gMKQDU1owAoCkBR2J+9LgOrjFR54bdq6ycTEB2iFpHR9Ltk4qTqAwoABaCaBxTuLiK/jKxlv+eF+wl4i/r1Zc/kta5lobpKP1uF5GXjA9k8ZUlc9mxdHyhUK2858AAjgAhhkEfsCN3AIlMA4sQABSDOes8rNSMAYoEeiNgDFICIK59FpwcoAMQAPRCxBygAEVc+i04PUACIAXogYg9QAFpQ+e/evRMvXrwQjx8/Fvfv3xfT09Pixo0b4sqVK+LChQvi7Nmzoq+vT3R3d4vjx4+Lo0ePiq6uLvHLL790/uFvXMNvuAf34hk8izSQFtJE2ngH3oV30sL3AAUgkDr89u2b2NzcFMvLy2J+fl6MjY2J4eFhceLEiR9ETgjd1H/xbuQBeUGekDfkEXmlheEBCoCn9bS1tdVpbScnJ8XIyIhTolcVFAgD8oy8owwoC81PD1AAPKmX7e1t8ejRo0643d/f76xVr0p21ftRJpQNZURZaX54gALgqB4QJq+vr4uZmZlOGJ3uk6uSKtT7UFaUeXZ2tuMDdhkcgfDgtRSABn2/v78v1tbW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dxH5ZWQt+z0v3E/AW9SvL3smr3UtC9VV+tkqJC8bH8jmKUvismfr+kChWnnLgQcYAUQIgzxiR+gGFpkCECcGKABx1nteqf8P1UpMmQMpUq4AAABRdEVYdENvbW1lbnQAQ29weXJpZ2h0IElOQ09SUyBHbWJIICh3d3cuaWNvbmV4cGVyaWVuY2UuY29tKSAtIFVubGljZW5zZWQgcHJldmlldyBpbWFnZbaaaaYAAAA4dEVYdENvcHlyaWdodABDb3B5cmlnaHQgSU5DT1JTIEdtYkggKHd3dy5pY29uZXhwZXJpZW5jZS5jb20pTs6ZTgAAAFp6VFh0Q29tbWVudAAAeJxzzi+oLMpMzyhR8PRz9g8KVnDPTfJQ0CgvL9fLTM7PS60oSC3KTM1LTtVLzs/VVNBVCM3LyUxOzStOTVEoKEoty0wtV8jMTUxPBQC4jxoknLyY4wAAAEF6VFh0Q29weXJpZ2h0AAB4nHPOL6gsykzPKFHw9HP2DwpWcM9N8lDQKC8v18tMzs9LrShILcpMzUtO1UvOz9UEAH02EGgc3eaPAAAAAElFTkSuQmCC
--boundary_N7JVHbsWDzwnj6aXjmh4dZq33fjuicQy24LSKDEMrUmXONq4oO1zW1EYSQ3C38OB--
Then everything works good. I cannot find the fake domain expressed anywhere during runtime so.. I'm inclined to just use this hack. Does anyone know of any downsides?

The parsing of an eml with javamail doesn't recognize properly nested messages

I'm implementing an .eml parser using Javamail 1.5.6, I've started copying from msghow.java a sample provided within javamail.
I'm testing an eml which contains as attachment another eml, this is an extract:
MIME-Version: 1.0
Date: Tue, 30 Apr 2019 16:20:45 +0200
Message-ID: <CA+fLqEW8TUfSxih9DTp2WXa63pS7wf1eZiro_9k1XS4AShN5Zg#mail.gmail.com>
Subject: Message with an eml as attachment
From: a b <ab#gmail.com>
To: cd#pec.cd.it
Content-Type: multipart/mixed; boundary="00000000000057f76c0587c01bc9"
--00000000000057f76c0587c01bc9
Content-Type: multipart/alternative; boundary="00000000000057f7670587c01bc7"
--00000000000057f7670587c01bc7
Content-Type: text/plain; charset="UTF-8"
Hello guys,
this is a simple message from a not certified account, it contains only one
attachment, an eml message
--00000000000057f7670587c01bc7
Content-Type: text/html; charset="UTF-8"
<div dir="ltr">Hello guys,<div><br></div><div>this is a simple message from a not certified account, it contains only one attachment, an eml message</div></div>
--00000000000057f76c0587c01bc9
Content-Type: message/rfc822; name="Cena zerebao.eml"
Content-Disposition: attachment; filename="Cena zerebao.eml"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_jv3vpu760
Content-ID: <f_jv3vpu760>
WC1Ob3Rlcy1JdGVtOiBGcmksIDYgSnVsIDIwMTggMTc6NDA6MDAgKzAyMDA7DQogdHlwZT00MDA7
IG5hbWU9T3JpZ2luYWxNb2RUaW1lDQpYLU5vdGVzLUl0ZW06IE1lbW87DQogbmFtZT1Gb3JtDQpY
LU5vdGVzLUl0ZW06IFN0ZE5vdGVzTHRyMjU7DQo.... and so on
Javamail recognizes that eml but when I get its subject, date, body, attachments and so on, they all are null.
msghow.java itself doesn't see them.
Before javamail I implemented my parser with mime4j and I haven't this problem, but now I would like to parse emls using only javamail if possible
From the javadocs describing the mail.mime.allowencodedmessages property:
The MIME spec does not allow body parts of type message/* to be encoded. The Content-Transfer-Encoding header is ignored in this case. Some versions of Microsoft Outlook will incorrectly encode message attachments. Setting this System property to "true" will cause the Content-Transfer-Encoding header to be honored for message attachments. The default value of this property is false.

Gmail REST API: send reply message with attachments uploadType=media

I really need your help!
I want to send a reply message with the Gmail REST API. Using the standard url:
https://www.googleapis.com/gmail/v1/users/userId/messages/send, everything works fine. By sending the raw data of the message and the thread id, the new message is attached to the same thread.
Now as I want our customers to be able to upload bigger attachments i use the upload url: https://www.googleapis.com/upload/gmail/v1/users/userId/messages/send?uploadType=media.
I send the request with Content-Type set to message/rfc822 as set in the documentation, but I can't find a way to send also the Thread id.
I tried adding it as a header (example: Thread-Id) to the MimeMessage, but it only works when i send the message to Outlook - there the message is sent to the same thread.
I have also populated the In-Reply-To header, the References header and the Subject is the same as in the original thread with additional 'Re:'. Gmail still creates a new thread for this message.
Update:
I have tried using the upload uri with parameter uploadType=multipart and here is my request:
Content-Type: multipart/related; boundary="=-EEoaSdATsa0it8EbymRVdg=="
--=-EEoaSdATsa0it8EbymRVdg==
Content-Type: application/json
Content-Transfer-Encoding: base64
eyJ0aHJlYWRJZCI6IjE1ZTdlZmJhYTc3MzViZjcifQ==
--=-EEoaSdATsa0it8EbymRVdg==
Content-Type: message/rfc822
From: deni.gencheva#gmail.com
Date: Fri, 27 Oct 2017 16:13:37 +0300
Subject: Re: RE:
Message-Id: <ESXEYD0PP2U4.RL2HHWMRGNXE#localhost.localdomain>
Sender: {sender email}
Reply-To: {sender email}
To: {one receiver email}
In-Reply-To:
=?us-ascii?q?
=3CHE1PR0402MB3323926A291565E98E66C1DCFC720=40HE1PR0402MB3323=2Eeur?=
=?us-ascii?q?prd04=2Eprod=2Eoutlook=2Ecom=3E?=
References:<HE1PR0402MB3323926A291565E98E66C1DCFC720#HE1PR0402MB3323.eurprd04.prod.outlook.com>
<CAJM2npmj3DWntngux8KovxPoNJ+KOS4tKm=LAo1YoG3vxWLQdg#mail.gmail.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-VCM8QFnp+o3VG1fmByraaw=="
--=-VCM8QFnp+o3VG1fmByraaw==
Content-Type: application/octet-stream; name="test document.rtf"
Content-Disposition: attachment; filename="test document.rtf"
Content-Transfer-Encoding: base64
Content-Id: <5e655580-14b6-0d1f-9e86-ad1c590691db>
{attachment base64 encoded content}
--=-VCM8QFnp+o3VG1fmByraaw==
Content-Type: multipart/alternative; boundary="=-pst5gHw2fNhIKAdrMRT2wg=="
--=-pst5gHw2fNhIKAdrMRT2wg==
Content-Type: text/plain; charset=utf-8
{message body as plain text}
--=-pst5gHw2fNhIKAdrMRT2wg==
Content-Type: text/html; charset=utf-8
{message body as html}
--=-pst5gHw2fNhIKAdrMRT2wg==--
--=-VCM8QFnp+o3VG1fmByraaw==--
--=-EEoaSdATsa0it8EbymRVdg==--
But API returns an error which states that multipart/related is not an allowed content type.

Gmail automatically urlencodes links in mail

I'm trying to send an email to a gmail account containing a link which looks like this:
http://www.example.com/#/something#param=1
This is a link to an AngularJS application which needs the second '#' as a separator.
The problem is that gmail changes the seconds '#' to '%23' and this causes the application not to recognize the char as a separator.
Is there anything I can do with this?
Thanks.
I did a quick test using gmail to try to figure out what happens.
Here is the raw message
MIME-Version: 1.0
Received: by 10.96.50.232 with HTTP; Mon, 19 Jan 2015 05:44:30 -0800 (PST)
Date: Mon, 19 Jan 2015 14:44:30 +0100
Delivered-To: *******#gmail.com
Message-ID: <CPZt8dX3Q17wXmU7UT2iXp7q4tSn1UsDmyiUbXFVK7xE2Q0C10A#mail.gmail.com>
Subject: test
From: <name> <*******#gmail.com>
To: <name> <*******#gmail.com>
Content-Type: multipart/alternative; boundary=20cf303b41179134a6050d0185f4
--20cf303b41179134a6050d0185f4
Content-Type: text/plain; charset=UTF-8
http://www.example.com/#/something#param=1
--20cf303b41179134a6050d0185f4
Content-Type: text/html; charset=UTF-8
<div dir="ltr">http://www.example.com/#/something#param=1<br></div>
--20cf303b41179134a6050d0185f4--
The original message is showing the correct values, but I also noticed how my actual gmail client shows the second # as the html encoded %23.
Surprisingly enough, in contrast to what I suggested in my comment, using plain-text will actually give the desired result.
MIME-Version: 1.0
Received: by 10.96.50.232 with HTTP; Mon, 19 Jan 2015 06:06:39 -0800 (PST)
Date: Mon, 19 Jan 2015 15:06:39 +0100
Delivered-To: *****#gmail.com
Message-ID: <KMBt8bX2CrmEL66iRFAJ+_s_1W2eodD=9X=bMdsBK_13qzh6DaA#mail.gmail.com>
Subject: test4
From: <name> <*****#gmail.com>
To: <name> <*****#gmail.com>
Content-Type: text/plain; charset=UTF-8
http://www.example.com/#/something#param=1
I don't know how your AngularJS application reads the link from the email, so plain-text may not be an option, but the link in the above email is mapped to http://www.example.com/#/something#param=1 in my gmail client.

Resources