This patch will add a simple challenge/response to people messenging you who are not in your friends list. Apply the patch, compile, install. Quit/restart your connection to bitlbee if appropriate. Once connected, you need to do this in &bitlbee: set handle_unknown challenge set unknown_challenge "[Antispam] to reach me, say 'rumpelstiltskin'" set unknown_response rumpelstiltskin set unknown_action add What this will do, is send the challenge message to anyone contacting you who's not in your friends list; but if they do say the code word 'rumpelstiltskin', they will instead be added temporarilly to your friends list, and their message will come through. Just like handle_unknown=add, if you want the add to be permanent, you'll need to do the add yourself. This was based on bitlbee-1.2, patched April 11 2008 Author: Jason Fesler License: Public domain. Warrantee: None, express or implied. I'd appreciate it if you mailed me if you found this useful. diff -w -cr bitlbee-1.2.orig/irc.c bitlbee-1.2/irc.c *** bitlbee-1.2.orig/irc.c Thu Feb 7 13:25:16 2008 --- bitlbee-1.2/irc.c Fri Apr 11 08:30:15 2008 *************** *** 113,118 **** --- 113,121 ---- set_add( &irc->set, "default_target", "root", NULL, irc ); set_add( &irc->set, "display_namechanges", "false", set_eval_bool, irc ); set_add( &irc->set, "handle_unknown", "root", NULL, irc ); + set_add( &irc->set, "unknown_challenge", "you are not on my buddy list - message me again with SECRET-WORD to contact me", NULL, irc ); + set_add( &irc->set, "unknown_response", "secret-word", NULL, irc ); + set_add( &irc->set, "unknown_action", "add", NULL, irc ); set_add( &irc->set, "lcnicks", "true", set_eval_bool, irc ); set_add( &irc->set, "ops", "both", set_eval_ops, irc ); set_add( &irc->set, "password", NULL, passchange, irc ); diff -w -cr bitlbee-1.2.orig/protocols/nogaim.c bitlbee-1.2/protocols/nogaim.c *** bitlbee-1.2.orig/protocols/nogaim.c Sat Jan 19 16:17:52 2008 --- bitlbee-1.2/protocols/nogaim.c Fri Apr 11 09:26:38 2008 *************** *** 636,641 **** --- 636,671 ---- { char *h = set_getstr( &irc->set, "handle_unknown" ); + /* Challenge response */ + char *challenge = set_getstr( &irc->set, "unknown_challenge"); + char *cresponse = set_getstr( &irc->set, "unknown_response"); + char *uc_msg; + char *uc_cresponse; + char *action; + if ((g_strcasecmp( h, "challenge") == 0 ) && (challenge) && (cresponse) && (msg)) + { + uc_msg = g_ascii_strup(msg,-1); + uc_cresponse = g_ascii_strup(cresponse,-1); + if (g_strstr_len(uc_msg,strlen(uc_msg),uc_cresponse)) + { + /* We see the required response - accept it*/ + action = set_getstr(&irc->set,"unknown_action"); + if (!action) action = "add"; + if (!action[0]) action="add"; + h=action; + g_free(uc_msg); + g_free(uc_cresponse); + } + else + { + ic->acc->prpl->buddy_msg(ic,handle,challenge,0); // 0 == flags ? + g_free(uc_msg); + g_free(uc_cresponse); + return; + } + } + /* End of challenge/response */ + if( g_strcasecmp( h, "ignore" ) == 0 ) { if( set_getbool( &irc->set, "debug" ) )