commit 0fb4c799d83c496ce928115aecd3ff531e49ece9 from: Martijn van Duren date: Thu Sep 5 09:35:36 2019 UTC Change cidentity back to identity. Rename sidentity to greeting.identity commit - f0f9389e66f9685fa2965736d8e266fa98120659 commit + 0fb4c799d83c496ce928115aecd3ff531e49ece9 blob - acc026b2c8062c0edb9a7bf98b3f4df11c76d6e0 blob + 76a4910a41b9100a23778cc039aacc53ba756e44 --- opensmtpd.c +++ opensmtpd.c @@ -846,10 +846,10 @@ osmtpd_register_need(int incoming) OSMTPD_NEED_FCRDNS)) osmtpd_register(OSMTPD_TYPE_REPORT, OSMTPD_PHASE_LINK_CONNECT, incoming, 1, NULL); - if (needs & OSMTPD_NEED_SIDENTITY) + if (needs & OSMTPD_NEED_GREETING) osmtpd_register(OSMTPD_TYPE_REPORT, OSMTPD_PHASE_LINK_GREETING, incoming, 1, NULL); - if (needs & OSMTPD_NEED_CIDENTITY) + if (needs & OSMTPD_NEED_IDENTITY) osmtpd_register(OSMTPD_TYPE_REPORT, OSMTPD_PHASE_LINK_IDENTIFY, incoming, 1, NULL); if (needs & OSMTPD_NEED_CIPHERS) @@ -1097,8 +1097,8 @@ osmtpd_newline(struct io *io, int ev, void *arg) ctx->ctx.reqid = search.ctx.reqid; ctx->ctx.rdns = NULL; ctx->ctx.fcrdns = OSMTPD_STATUS_TEMPFAIL; - ctx->ctx.sidentity = NULL; - ctx->ctx.cidentity = NULL; + ctx->ctx.identity = NULL; + ctx->ctx.greeting.identity = NULL; ctx->ctx.ciphers = NULL; ctx->ctx.msgid = 0; ctx->ctx.mailfrom = NULL; @@ -1270,8 +1270,8 @@ osmtpd_link_disconnect(struct osmtpd_callback *cb, str if (ondeletecb_session != NULL) ondeletecb_session(ctx, session->ctx.local_session); free(session->ctx.rdns); - free(session->ctx.sidentity); - free(session->ctx.cidentity); + free(session->ctx.identity); + free(session->ctx.greeting.identity); free(session->ctx.ciphers); free(session->ctx.mailfrom); for (i = 0; session->ctx.rcptto[i] != NULL; i++) @@ -1288,7 +1288,7 @@ osmtpd_link_greeting(struct osmtpd_callback *cb, struc void (*f)(struct osmtpd_ctx *, const char *); if (cb->storereport) { - if ((ctx->sidentity = strdup(identity)) == NULL) + if ((ctx->greeting.identity = strdup(identity)) == NULL) osmtpd_err(1, NULL); } @@ -1303,7 +1303,7 @@ osmtpd_link_identify(struct osmtpd_callback *cb, struc void (*f)(struct osmtpd_ctx *, const char *); if (cb->storereport) { - if ((ctx->sidentity = strdup(identity)) == NULL) + if ((ctx->identity = strdup(identity)) == NULL) osmtpd_err(1, NULL); } blob - 8b5b5cd17cd7233bd2390346c5d89cc5bdc6e777 blob + 9a58a8d8764b383d3e902c5ee51f806f44b3552b --- opensmtpd.h +++ opensmtpd.h @@ -64,8 +64,8 @@ enum osmtpd_phase { #define OSMTPD_NEED_DST 1 << 1 #define OSMTPD_NEED_RDNS 1 << 2 #define OSMTPD_NEED_FCRDNS 1 << 3 -#define OSMTPD_NEED_SIDENTITY 1 << 4 -#define OSMTPD_NEED_CIDENTITY 1 << 5 +#define OSMTPD_NEED_IDENTITY 1 << 4 +#define OSMTPD_NEED_GREETING 1 << 5 #define OSMTPD_NEED_CIPHERS 1 << 6 #define OSMTPD_NEED_MSGID 1 << 7 #define OSMTPD_NEED_MAILFROM 1 << 8 @@ -85,8 +85,12 @@ struct osmtpd_ctx { struct sockaddr_storage dst; char *rdns; enum osmtpd_status fcrdns; - char *sidentity; - char *cidentity; + /* HELO/EHLO identity */ + char *identity; + struct greeting { + char *identity; + /* textstring not supplied by smtpd */ + } greeting; char *ciphers; uint32_t msgid; char *mailfrom;