Skip to content

Commit

Permalink
qmail-smtpd: introduce an array of EHLO string generators
Browse files Browse the repository at this point in the history
This is of no direct use for the vanilla version, but it allows to simplify
the integration of different patches which add add EHLO arguments. They will
only need to add their print function to this array and it will get called.
  • Loading branch information
DerDakon committed Jul 26, 2020
1 parent b52f6d2 commit a09a08c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion qmail-smtpd.c
Expand Up @@ -60,6 +60,9 @@ 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};

Expand Down Expand Up @@ -230,7 +233,12 @@ void smtp_helo(arg) char *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-");
for (i = 0; ehlo_gen[i]; i++) {
ehlo_gen[i]();
}
out("\r\n250-PIPELINING\r\n250 8BITMIME\r\n");
seenmail = 0; dohelo(arg);
}
void smtp_rset(arg) char *arg;
Expand Down

0 comments on commit a09a08c

Please sign in to comment.