I was testing relayd a while back against a couple of IIS 7.5 servers
serving Exchange 2010.  It looks like IIS 7.5 (included with Windows 2008
R2) really wants HTTP 1.1 requests to include the User-Agent header in the
request; leaving it out generates a "400 Bad Request" response.

The HTTP 1.1 spec[1] says of the User-Agent header, "User agents SHOULD
include this field with requests."  Not a MUST, so maybe Microsoft is doing
it wrong by seemingly requiring it.  But since it's a SHOULD, perhaps relayd
should be sending it anyway for HTTP 1.1 requests?  Either way, it's a quick
fix and makes my relay check statements work:

Index: parse.y
===================================================================
RCS file: /cvs/src/usr.sbin/relayd/parse.y,v
retrieving revision 1.159
diff -u -p -r1.159 parse.y
--- parse.y     21 Sep 2011 18:45:40 -0000      1.159
+++ parse.y     10 Nov 2011 16:53:20 -0000
@@ -228,7 +228,7 @@ hostname    : /* empty */           {
                                fatal("calloc");
                }
                | HOST STRING   {
-                       if (asprintf(&$$, "Host: %s\r\nConnection: close\r\n",
+                       if (asprintf(&$$, "Host: %s\r\nUser-Agent: 
relayd\r\nConnection: close\r\n",
                            $2) == -1)
                                fatal("asprintf");
                }



Is this useful?

[1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.43

--
Seth

Reply via email to