int found=0;
char *dupemail;
activeuser *aup;
+ maillock *mlp;
if (getreguserfromnick(sender))
return CMD_ERROR;
if (csa_checkaccountname(sender, sender->nick))
return CMD_ERROR;
+ for(mlp=maillocks;mlp;mlp=mlp->next) {
+ if(!match(mlp->pattern->content, cargv[0])) {
+ chanservstdmessage(sender, QM_MAILLOCKED);
+ return CMD_ERROR;
+ }
+ }
+
dupemail = strdup(cargv[0]);
local=strchr(dupemail, '@');
- if(!local)
+ if(!local) {
+ free(dupemail);
return CMD_ERROR;
+ }
*(local++)='\0';
mdp=findnearestmaildomain(local);
for(smdp=mdp; smdp; smdp=smdp->parent) {
if(MDIsBanned(smdp)) {
free(dupemail);
- chanservstdmessage(sender, QM_DOMAINBANNED);
+ chanservstdmessage(sender, QM_MAILLOCKED);
return CMD_ERROR;
}
if((smdp->count >= smdp->limit) && (smdp->limit > 0)) {
}
}
- mdp=findorcreatemaildomain(cargv[0]);
+ free(dupemail);
aup->helloattempts++;
-
- rup=getreguser();
- rup->status=0;
- rup->ID=++lastuserID;
- strncpy(rup->username,sender->nick,NICKLEN); rup->username[NICKLEN]='\0';
- rup->created=time(NULL);
- rup->lastauth=0;
- rup->lastemailchange=time(NULL);
- rup->flags=QUFLAG_NOTICE;
- rup->languageid=0;
- rup->suspendby=0;
- rup->suspendexp=0;
- rup->password[0]='\0';
- rup->email=getsstring(cargv[0],EMAILLEN);
-
- rup->localpart=getsstring(dupemail,EMAILLEN);
- free(dupemail);
- rup->domain=mdp;
- addregusertomaildomain(rup, rup->domain);
- rup->info=NULL;
+ rup=csa_createaccount(sender->nick,"", cargv[0]);
+ csa_createrandompw(rup->password, PASSLEN);
sprintf(userhost,"%s@%s",sender->ident,sender->host->name->content);
rup->lastuserhost=getsstring(userhost,USERLEN+HOSTLEN+1);
- rup->suspendreason=NULL;
- rup->comment=NULL;
- rup->knownon=NULL;
- rup->checkshd=NULL;
- rup->stealcount=0;
- rup->fakeuser=NULL;
- addregusertohash(rup);
- csa_createrandompw(rup->password, PASSLEN);
+
chanservstdmessage(sender, QM_NEWACCOUNT, rup->username,rup->email->content);
cs_log(sender,"HELLO OK created auth %s (%s)",rup->username,rup->email->content);
csdb_createuser(rup);
csdb_createmail(rup, QMAIL_NEWACCOUNT);
-
+
return CMD_OK;
}