During dispatch, all links are replaced with a link to /sitecore/RedirectUrlPage.aspx with additional query string parameters such as contact id and message id.
RedirectUrlPage.aspx runs the redirectUrl pipeline, which is responsible for several things, e.g. adding click events based on the query string parameters. After running the pipeline, it will redirect you to the actual link e.g. /sitecore/unsubscribe.aspx.
The link to redirect to is set in the redirectUrl/SetRedirectToUrl pipeline processor.
Now, because some links require the query string parameters, those query string parameters needs to be passed along from RedirectUrlPage.aspx to the next page. The redirectUrl/SetRedirectToUrl pipeline processor does this using the internalCarryoverFields configuration of the processor, e.g.:
<carryoverField type="Sitecore.EmailCampaign.Cd.Pipelines.RedirectUrl.CarryoverField, Sitecore.EmailCampaign.Cd">
<param desc="fieldKey" value="mid" />
The fieldKey being the query string parameter, and the urlPattern the url pattern where the fieldKey should be passed to.
In this case we're telling that the query string parameter "mid" should be passed on to any internal urls matching the .*Unsubscribe.aspx pattern.
So, to reiterate:
- Link in email: <a href="http://www.yourdomain.com/Unsubscribe.aspx">Unsubscribe</a>
- Is transformed by EXM into: <a href="http://www.yourdomain.com/RedirectUrlPage.aspx?eq=encryptedquerystring">Unsubscribe</a>
- Contact clicks the link and RedirectUrlPage redirects you to:
Problem and solution
The urlPattern matching is case-sensitive, so you need to either change your links to Unsubscribe.aspx (with capital U), or add the lower-case variation to your configuration (Sitecore.EmailExperience.ContentDelivery.config).
This bug is fixed in the next EXM release.