if (c->state != SMTP_RCPT)
return respond(c, err_wantrcpt);
c->state = SMTP_DATA;
+ c->dstate = 2;
return respond(c, data_ok);
}
smtpd_quit(struct conn *c, char *cmd, int len, int argoff)
{
c->state = SMTP_CLOSED;
- return respond(c, quit_ok);
+ return respond(c, quit_ok, banner_hostname);
}
static int
static int
do_smtp(struct conn *c, char **buf, int *len)
{
+ if (*len == 0) return 0;
+
if (c->state == SMTP_DATA) {
char *s;
for (s = *buf; s < *buf + *len; s++) {
continue;
case 4: if (*s == '\n') {
c->dstate = 5;
- break;
+ continue;
}
c->dstate = 0;
continue;
+ case 5: break;
}
break;
}