-/* $OpenBSD: smtpctl.c,v 1.156 2018/01/26 08:00:54 eric Exp $ */
+/* $OpenBSD: smtpctl.c,v 1.157 2018/01/30 12:44:55 eric Exp $ */
/*
* Copyright (c) 2013 Eric Faurot <eric@openbsd.org>
#include <string.h>
#include <time.h>
#include <unistd.h>
+#include <vis.h>
#include <limits.h>
#include "smtpd.h"
show_queue_envelope(struct envelope *e, int online)
{
const char *src = "?", *agent = "?";
- char status[128], runstate[128];
+ char status[128], runstate[128], errline[LINE_MAX];
status[0] = '\0';
else if (e->ss.ss_family == AF_INET6)
src = "inet6";
+ strnvis(errline, e->errorline, sizeof(errline), 0);
+
printf("%016"PRIx64
"|%s|%s|%s|%s@%s|%s@%s|%s@%s"
"|%zu|%zu|%zu|%zu|%s|%s\n",
(size_t) e->lasttry,
(size_t) e->retry,
runstate,
- e->errorline);
+ errline);
}
static void
-/* $OpenBSD: util.c,v 1.132 2017/01/09 14:49:22 reyk Exp $ */
+/* $OpenBSD: util.c,v 1.133 2018/01/30 12:44:55 eric Exp $ */
/*
* Copyright (c) 2000,2001 Markus Friedl. All rights reserved.
const char *
parse_smtp_response(char *line, size_t len, char **msg, int *cont)
{
- size_t i;
-
if (len >= LINE_MAX)
return "line too long";
!isdigit((unsigned char)line[2]))
return "reply code out of range";
- /* validate reply message */
- for (i = 0; i < len; i++)
- if (!isprint((unsigned char)line[i]))
- return "non-printable character in reply";
-
return NULL;
}