Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qmail-smtpd: introduce an array of EHLO string generators #172

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 11 additions & 2 deletions qmail-smtpd.c
Expand Up @@ -55,13 +55,17 @@ void err_noop(arg) char *arg; { out("250 ok\r\n"); }
void err_vrfy(arg) char *arg; { out("252 send some mail, i'll try my best\r\n"); }
void err_qqt() { out("451 qqt failure (#4.3.0)\r\n"); }

static void (*ehlo_gen[])() = {
NULL
};

stralloc greeting = {0};

void smtp_greet(code) char *code;
{
substdio_puts(&ssout,code);
substdio_put(&ssout,greeting.s,greeting.len);
out("\r\n");
}
void smtp_help(arg) char *arg;
{
Expand Down Expand Up @@ -220,12 +224,17 @@ stralloc rcptto = {0};

void smtp_helo(arg) char *arg;
{
smtp_greet("250 "); out("\r\n");
smtp_greet("250 ");
seenmail = 0; dohelo(arg);
}
void smtp_ehlo(arg) char *arg;
{
smtp_greet("250-"); out("\r\n250-PIPELINING\r\n250 8BITMIME\r\n");
unsigned int i;
smtp_greet("250-");
DerDakon marked this conversation as resolved.
Show resolved Hide resolved
for (i = 0; ehlo_gen[i]; i++) {
ehlo_gen[i]();
}
out("250-PIPELINING\r\n250 8BITMIME\r\n");
seenmail = 0; dohelo(arg);
}
void smtp_rset(arg) char *arg;
Expand Down