commit - 06220a702a876245348b8dad461557562521dda3
commit + 53b354a9b87cfe0696ef8411dec25f45b7ca6f41
blob - 626f0f6e2b3ff5fcb3d1c3da7d91b822ddf62b3e
blob + 539bac7cc375424390dff3068a761144925e0099
--- opensmtpd.c
+++ opensmtpd.c
char *params, char *linedup)
{
char *end, *mailfrom;
+ enum osmtpd_status status;
unsigned long imsgid;
uint32_t msgid;
void (*f)(struct osmtpd_ctx *, uint32_t, const char *,
osmtpd_errx(1, "Invalid line received: missing status: %s",
linedup);
end++[0] = '\0';
- mailfrom = params;
+ if (ctx->version_major == 0 && ctx->version_minor < 6) {
+ mailfrom = params;
+ status = osmtpd_strtostatus(end, linedup);
+ } else {
+ mailfrom = end;
+ status = osmtpd_strtostatus(params, linedup);
+ }
if (cb->storereport) {
if ((ctx->mailfrom = strdup(mailfrom)) == NULL)
osmtpd_err(1, NULL);
}
- params = end;
if ((f = cb->cb) != NULL)
- f(ctx, msgid, mailfrom, osmtpd_strtostatus(params, linedup));
+ f(ctx, msgid, mailfrom, status);
}
static void
char *params, char *linedup)
{
char *end, *rcptto;
+ enum osmtpd_status status;
unsigned long imsgid;
uint32_t msgid;
size_t i;
linedup);
end++[0] = '\0';
- rcptto = params;
- params = end;
+ if (ctx->version_major == 0 && ctx->version_minor < 6) {
+ rcptto = params;
+ status = osmtpd_strtostatus(end, linedup);
+ } else {
+ rcptto = end;
+ status = osmtpd_strtostatus(params, linedup);
+ }
if (cb->storereport) {
for (i = 0; ctx->rcptto[i] != NULL; i++)
}
if ((f = cb->cb) != NULL)
- f(ctx, msgid, rcptto,
- osmtpd_strtostatus(params, linedup));
+ f(ctx, msgid, rcptto, status);
}
static void
osmtpd_errx(1, "In valid phase: %d\n", phase);
}
-static enum
-osmtpd_status osmtpd_strtostatus(const char *status, char *linedup)
+static enum osmtpd_status
+osmtpd_strtostatus(const char *status, char *linedup)
{
if (strcmp(status, "ok") == 0)
return OSMTPD_STATUS_OK;