Welcome to Esato.com




C905: Customizing User-Agent: string?


Click to view updated thread with images




Posted by Hlorri
Is there a way to customize the User-Agent: string that the phone browser (or, more to the point, Exchange ActiveSync) sends?

The issue that my debranded C905a fails with our Exchange 2007 OWA server at work, wheras my Nokia phones (currently N97), my coworkers' iPhones, etc all connect fine. Investigating further, I found that the issue is really dumb coding on Microsoft's part (or perhaps our own IT department, who knows), where they apparently use the User-Agent: header in the HTTP request to decide what content to serve.

Using the "wget" command line tool on my Mac and/or Linux box to simulate the different browsers, I get:


$ wget --no-check-certificate --user-agent='Mozilla/5.0 (SymbianOS/9.4; Series60/5.0 NokiaN97-3/10.2.012; Profile/MIDP-2.1 Configuration/CLDC-1.1; en-us) AppleWebKit/525 (KHTML, like Gecko) WicKed/7.1.12344' https://cbd.mail.lifetech.com/
HTTP request sent, awaiting response... 200 OK

$ wget --no-check-certificate --user-agent='SonyEricssonC905/R1EA Browser/NetFront/3.4 Profile/MIDP-2.1 Configuration/CLDC-1.1 JavaPlatform/JP-8.4.2' https://cbd.mail.lifetech.com/
HTTP request sent, awaiting response... 500 ( The server denied the specified Uniform Resource Locator (URL). Contact the server administrator. )


Yet further, I find that the magic word is "Mozilla":

$ wget --no-check-certificate --user-agent='Mozilla' https://cbd.mail.lifetech.com/
HTTP request sent, awaiting response... 200 OK

$ wget --no-check-certificate --user-agent='AnythingElse' https://cbd.mail.lifetech.com/
HTTP request sent, awaiting response... 500 ( The server denied the specified Uniform Resource Locator (URL). Contact the server administrator. )


Yes, I have already submitted a ticket to our IT help desk - but because our company recently outsourced IT support operations to an outside vendor, I don't expect much from them.

I have also tried setting up a HTTP proxy on my own Apache web server, using a combination of mod_rewrite, mod_proxy and mod_headers to intercept and change the "User-Agent:" header on the way from my phone to the OWA server; however I am still having some issues with reverse rewriting (where "https://" links don't get translated back to "http://" as they should.. long complex story).

So - the bottom line is: Is there a way to modify the User-Agent string on the phone itself? I tried using A2Uploader to browse through the filesystem on the phone, but could not find anything relevant....

Thanks in advance!
[ This Message was edited by: Hlorri on 2009-08-04 09:34 ]


Posted by EkoBonk
I am looking for an answer to this as well - did you ever figure out if it was possible?

Posted by EkoBonk
Forgot to add notification



Click to view updated thread with images


© Esato.com - From the Esato mobile phone discussion forum