I've provided the step-by-step for the client side.

The IRC server in question returns a "402 No such server".

The way NICKSERV (the raw command) is implemented on this server/network (running ircd-ratbox) is through a custom in-house module called m_xxxxserv.c. I do not have permission from the author to post the entire code, but I can ask him if asked. It's nothing magical or secret.

The C code is very easy to understand. Kept short for brevity (though this forum's code tag support seems to destroy indentation; not my fault):

struct Message nickserv_msgtab = {
"NICKSERV", 0, 0, 0, MFLG_SLOW,
{mg_unreg, {mg_nickserv, 2}, mg_ignore, mg_ignore, mg_ignore, {mg_nickserv, 2}}
};

...

static int mg_nickserv(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
struct Client *target_p;
char combined[1024];

if ( (target_p = find_client(SERVICES_HOST)) == NULL )
{
sendto_one_numeric(source_p, ERR_NOSUCHSERVER,
form_str(ERR_NOSUCHSERVER), SERVICES_HOST);
return 1;
}

combined[0] = 0;
combine_string(parc, parv, combined);

sendto_one(target_p, ":%s PRIVMSG NickServ@" SERVICES_HOST " :%s", parv[0], combined);

return 0;
}

Here we can see that if the client issues a raw NICKSERV command, and the NickServ service/server is unavailable/not connected to the network, the server the client is using returns ERR_NOSUCHSERVER, which is a standard irc-ratbox response. From the official ircd-ratbox source:

include/numeric.h:#define ERR_NOSUCHSERVER 402
src/messages.tab:/* 402 ERR_NOSUCHSERVER, */ "%s :No such server",

Last edited by koitsu; 05/02/23 12:07 PM.