diff options
author | Gilles Chehade <gilles@poolp.org> | 2018-06-15 20:22:40 +0200 |
---|---|---|
committer | Gilles Chehade <gilles@poolp.org> | 2018-06-15 20:22:40 +0200 |
commit | 44d280914d95bbb2967ac84bf9151b7f0ce48df4 (patch) | |
tree | 6e36357bcda5cca4ff5009aa381b949fd1f8cee9 /smtpd/smtp_client.c | |
parent | sync (diff) | |
download | OpenSMTPD-44d280914d95bbb2967ac84bf9151b7f0ce48df4.tar.xz OpenSMTPD-44d280914d95bbb2967ac84bf9151b7f0ce48df4.zip |
sync with openbsd
Diffstat (limited to 'smtpd/smtp_client.c')
-rw-r--r-- | smtpd/smtp_client.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/smtpd/smtp_client.c b/smtpd/smtp_client.c index 6ea6be70..289ff3b2 100644 --- a/smtpd/smtp_client.c +++ b/smtpd/smtp_client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtp_client.c,v 1.4 2018/05/24 11:01:30 eric Exp $ */ +/* $OpenBSD: smtp_client.c,v 1.5 2018/06/09 10:01:17 eric Exp $ */ /* * Copyright (c) 2018 Eric Faurot <eric@openbsd.org> @@ -73,6 +73,7 @@ enum { #define SMTP_EXT_AUTH_PLAIN 0x08 #define SMTP_EXT_AUTH_LOGIN 0x10 #define SMTP_EXT_DSN 0x20 +#define SMTP_EXT_SIZE 0x40 struct smtp_client { void *tag; @@ -81,6 +82,7 @@ struct smtp_client { int state; int flags; int ext; + size_t ext_size; struct io *io; char *reply; @@ -645,6 +647,7 @@ smtp_client_io(struct io *io, int evt, void *arg) static int smtp_client_readline(struct smtp_client *proto) { + const char *e; size_t len; char *line, *msg, *p; int cont; @@ -702,6 +705,11 @@ smtp_client_readline(struct smtp_client *proto) proto->ext |= SMTP_EXT_PIPELINING; else if (strcmp(msg, "DSN") == 0) proto->ext |= SMTP_EXT_DSN; + else if (strncmp(msg, "SIZE ", 5) == 0) { + proto->ext_size = strtonum(msg + 5, 0, SIZE_T_MAX, &e); + if (e == NULL) + proto->ext |= SMTP_EXT_SIZE; + } } if (smtp_client_replycat(proto, line) == -1) { |