syslog_r(LOG_INFO, &sdata, "%s: %s -> %s %ldsec by lists:%s", cp->addr, cp->mail, cp->rcpt, (long)(t - cp->s), doreply(cp));
cp->lists = strdup(doreply(cp));
nextstate(struct con *cp){	switch (cp->state) {	case 0:		/* banner sent; wait for input */		cp->ip = cp->ibuf;		cp->il = sizeof(cp->ibuf) - 1;		cp->state = 1;		cp->r = t;		break;	case 1:		/* received input: parse, and select next state */		if (match(cp->ibuf, "HELO") ||		    match(cp->ibuf, "EHLO")) {			snprintf(cp->obuf, cp->osize,			    "250 Hello, spam sender. "			    "Pleased to be wasting your time.\n");			cp->op = cp->obuf;			cp->ol = strlen(cp->op);			cp->state = 2;			cp->w = t + 1;			break;		}		goto mail;	case 2:		/* sent 250 Hello, wait for input */		cp->ip = cp->ibuf;		cp->il = sizeof(cp->ibuf) - 1;		cp->state = 3;		cp->r = t;		break;	mail:	case 3:		if (match(cp->ibuf, "MAIL")) {			setlog(cp->mail, sizeof cp->mail, cp->ibuf);			snprintf(cp->obuf, cp->osize,			    "250 You are about to try to deliver spam. "			    "Your time will be spent, for nothing.\n");			cp->op = cp->obuf;			cp->ol = strlen(cp->op);			cp->state = 4;			cp->w = t + 1;			break;		}		goto rcpt;	case 4:		/* sent 250 Sender ok */		cp->ip = cp->ibuf;		cp->il = sizeof(cp->ibuf) - 1;		cp->state = 5;		cp->r = t;		break;	rcpt:	case 5:		if (match(cp->ibuf, "RCPT")) {			setlog(cp->rcpt, sizeof(cp->rcpt), cp->ibuf);			snprintf(cp->obuf, cp->osize,			    "250 This is hurting you more than it is "			    "hurting me.\n");			cp->op = cp->obuf;			cp->ol = strlen(cp->op);			cp->state = 6;			cp->w = t + 1;			break;		}		goto spam;	case 6:		/* sent 250 blah */		cp->ip = cp->ibuf;		cp->il = sizeof(cp->ibuf) - 1;		cp->state = 50;		cp->r = t;		break;	spam:	case 50:		syslog_r(LOG_INFO, &sdata, "%s: %s -> %s %ldsec by lists:%s",		    cp->addr, cp->mail, cp->rcpt, (long)(t - cp->s), doreply(cp));		cp->op = cp->obuf;		cp->ol = strlen(cp->op);		cp->state = 99;		cp->w = t + 1;		break;	case 99:		closecon(cp);		break;	default:		errx(1, "illegal state %d", cp->state);		break;	}}