/** * gen_regcheckemail.C: Rejects account registrations with certain email addresses. * * Copyright © 2007 Pippijn van Steenhoven / The Ermyth Team * Rights to this code are as documented in COPYING. * * * Portions of this file were derived from sources bearing the following license: * Copyright © 2006 Jilles Tjoelker * Rights to this code are as documented in doc/pod/license.pod. * * $Id: gen_regcheckemail.C,v 1.5 2007/09/16 18:54:43 pippijn Exp $ */ #include "atheme.h" #include static char const rcsid[] = "$Id: gen_regcheckemail.C,v 1.5 2007/09/16 18:54:43 pippijn Exp $"; REGISTER_MODULE ("contrib/gen_regcheckemail", false, "Jilles Tjoelker "); static bool check_registration (sourceinfo_t *si, char const * const account, char const * const email) { register int i = 0; char const * const bademails[] = { "*@hotmail.com", "*@msn.com", "*@gmail.com", "*@yahoo.com", NULL }; while (bademails[i] != NULL) { if (!match (bademails[i], email)) { command_fail (si, fault::noprivs, "Sorry, we do not accept registrations with email addresses from that domain. Use another address."); return false; } i++; } return true; } bool _modinit (module *m) { user_t::callback.can_register.attach (check_registration); return true; } void _moddeinit (void) { user_t::callback.can_register.detach (check_registration); }