Forum Moderators: open
The only way to do what you want to do on the IIS side is to use a dedicated IP address for that site, and don't configure ANY host headers for the site. There isn't any way to have a wildcard host header setting in IIS.
Just like that.
<%
If request.servervariables("HTTP_HOST") = "mail.domain.com" Then
response.redirect "http://www.domain.com/mail/whatever/"
End If
%>
That should accomplish what you want to do.