diff --git a/plugin-counters.c b/plugin-counters.c index 187bf14..60c30c4 100644 --- a/plugin-counters.c +++ b/plugin-counters.c @@ -35,6 +35,15 @@ static const response* init(void) return 0; } +static const response* helo(str* hostname, str* capabilities) +{ + if (!str_cats(capabilities, "SIZE ")) return &resp_oom; + if (!str_catu(capabilities, session_getnum("maxdatabytes", 0))) return &resp_oom; + if (!str_catc(capabilities, '\n')) return &resp_oom; + return 0; + (void)hostname; +} + static const response* reset(void) { minenv("maxdatabytes", "DATABYTES"); @@ -145,6 +154,7 @@ static const response* end(int fd) struct plugin plugin = { .version = PLUGIN_VERSION, .init = init, + .helo = helo, .reset = reset, .sender = sender, .recipient = recipient, diff --git a/protocol-smtp.c b/protocol-smtp.c index aa7a4d9..a206adc 100644 --- a/protocol-smtp.c +++ b/protocol-smtp.c @@ -397,10 +397,7 @@ static int init(void) return 1; } - if (!str_copys(&init_capabilities, "SIZE ") - || !str_catu(&init_capabilities, session_getnum("maxdatabytes", 0)) - || !str_catc(&init_capabilities, '\n') - || !str_cats(&init_capabilities, "8BITMIME\nENHANCEDSTATUSCODES\nPIPELINING")) { + if (!str_cats(&init_capabilities, "8BITMIME\nENHANCEDSTATUSCODES\nPIPELINING")) { respond(&resp_oom); return 1; } diff --git a/tests/plugin-reject b/tests/plugin-reject index 880eb3b..ea1be1e 100644 --- a/tests/plugin-reject +++ b/tests/plugin-reject @@ -12,7 +12,6 @@ EOF 220 local.host mailfront ESMTP^M 250 local.host^M 250-local.host^M -250-SIZE 0^M 250-8BITMIME^M 250-ENHANCEDSTATUSCODES^M 250 PIPELINING^M @@ -23,7 +22,6 @@ EOF 220 local.host mailfront ESMTP^M 250 local.host^M 250-local.host^M -250-SIZE 0^M 250-8BITMIME^M 250-ENHANCEDSTATUSCODES^M 250 PIPELINING^M