When login in to yahoo using bitlbee, I always get the message that my account is lock but If I use yahoo messenger I can login to my account without any problem. The same is happening to google talk.
The srv_lookup routine in lib/misc.c always returns zero responses on Cygwin. It is configured to do this because the ns_initparse and ns_parserr routines are not provided on Cygwin. Because srv_lookup always returns zero results Jabber accounts where the server does not match the @server.com portion of the username have to explicitly set a server name. This means that you can not do tls_verify on those accounts. For instance, username@gmail.com with a srv_lookup fail must set server name to talk.google.com. But Google returns a certificate for gmaill.com which the verify code thinks is the wrong server because it does not match the server name.
This patch does 3 things.
It changes the configure script to check for res_qeruy and dn_expandname when looking for libresolv. It also has a new check for ns_initparse and ns_initparserr to see if libresolv or libc provides them.
It changes the lib/misc.csrv_lookup routine to use dn_expandname instead of the custom code. This allows srv_lookup to process compressed names correctly. Cygwin res_query returns a compressed name and since bitlbee already requires libresolv this seems like the more correct solution.
It adds lib/ns_parse.c to provide ns_initparse and ns_parserr on platforms where those were not detected at ./configure time. This is a copy of a file from libbind-6.0 source with the copyright still in place and just minor modification. Removal of two functions that bitlbee does not use and added some #ifdefds and #include “bittlbee.h”. Reading the copyright/license notice I believe this is acceptable.
The end goal of this patch is to allow me to set up a Jabber account with username@gmail.com and tls_verify to true.
I know bitlbee doesn’t officially support Cygwin which is why I’m providing a patch instead of just reporting a bug. If the addition of ns_parse.c is more than bitlbee wants to take on I think the first two parts of the patch are still valuable and will help me in maintaining my own patch.